WO2018099356A1 - 一种用于分析Android端应用运行流畅度的方法和系统 - Google Patents

一种用于分析Android端应用运行流畅度的方法和系统 Download PDF

Info

Publication number
WO2018099356A1
WO2018099356A1 PCT/CN2017/113255 CN2017113255W WO2018099356A1 WO 2018099356 A1 WO2018099356 A1 WO 2018099356A1 CN 2017113255 W CN2017113255 W CN 2017113255W WO 2018099356 A1 WO2018099356 A1 WO 2018099356A1
Authority
WO
WIPO (PCT)
Prior art keywords
time
application
frame
fluency
running
Prior art date
Application number
PCT/CN2017/113255
Other languages
English (en)
French (fr)
Inventor
刘一琛
Original Assignee
武汉斗鱼网络科技有限公司
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 武汉斗鱼网络科技有限公司 filed Critical 武汉斗鱼网络科技有限公司
Publication of WO2018099356A1 publication Critical patent/WO2018099356A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3604Analysis of software for verifying properties of programs
    • G06F11/3612Analysis of software for verifying properties of programs by runtime analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

Definitions

  • the invention relates to the field of application development, and particularly relates to a method for analyzing the running fluency of an Android-side application and a system for analyzing the running fluency of an Android-side application.
  • the object of the present invention is to provide a method for analyzing the running fluency of an Android application and a system for analyzing the running smoothness of an Android application, which can intuitively reflect the smooth running of the application. degree.
  • the technical solution adopted by the present invention includes: obtaining the total time of each frame of the application in real time, wherein the total time of each frame is obtained by the command line tool.
  • the data is parsed and summed, and a background analysis component is created.
  • the analysis component analyzes the total time of each frame of the application in real time, and obtains and displays the real-time fluency of the application.
  • the frame data includes a drawing time, a preparation time, a calculation time, and an execution time of each operation
  • the total time of each frame is a drawing time, a preparation time, a calculation time, and an execution time.
  • the step of acquiring frame data is:
  • the real-time acquisition step of applying the total time of each frame is:
  • the result stream is saved into a file in a csv format and then parsed.
  • the background analysis component is a service component of the Android system.
  • the background analysis component runs in an asynchronous thread.
  • the invention also discloses a system for analyzing the running fluency of an Android application, comprising:
  • a data acquisition module for obtaining the total time of each frame of the application, applying each frame The total time is obtained by parsing and summing the frame data obtained by the command line tool;
  • a judging module configured to determine whether the application is currently running smoothly according to the total time of each frame of the application
  • an output module configured to display the judgment result of the judgment module on the application display end.
  • the frame data includes a drawing time, a preparation time, a calculation time, and an execution time of each operation of the application.
  • the application display end is a screen of a smart mobile device for running an application.
  • the method for analyzing the running fluency of the Android-side application of the present invention has the advantages of: acquiring the frame data of the application, and calculating the total time occupied by the application for each operation, that is, applying each frame
  • the total time based on the empirical formula, calculates whether the application runs smoothly, and can display the analysis result on the screen of the smart mobile device while running the application to be analyzed fluency, so that the developer can find out the application running the Karton.
  • the specific location is convenient for subsequent optimization of the application.
  • An advantage of the system for analyzing the running fluency of the Android application is that the data acquisition module collects the total time of each frame of the application, and then the judgment module judges the collected data, and the output module displays the result.
  • the screen of the smart mobile device visually reflects the smoothness of the application, and the degree of automation is high, which greatly reduces the difficulty of application developers.
  • FIG. 1 is a flowchart of a method for analyzing running fluency of an Android application according to the present invention.
  • the present invention provides a method for analyzing the running fluency of an Android application, which is used to analyze the running fluency of an application running on an Android operating system, and the Android operating system runs on a smart mobile device. , such as a smartphone.
  • the method includes: obtaining the total time of each frame of the application in real time, wherein the total time of each frame is obtained by parsing and summing the frame data acquired by the command line tool, and then creating a background analysis component, and analyzing each frame of the application in real time through the analysis component. The total time to derive and demonstrate the real-time fluency of the app.
  • Step S1 Start the Android application, and invoke the command line tool to obtain the frame data of the application.
  • the frame data is composed of each operation time of the application, and the total time of each frame is obtained by summing the frame data, and the frame data includes Applying the drawing time, preparation time, calculation time and execution time of each operation, the total time of applying each frame is obtained by summing the drawing time, preparation time, calculation time and execution time of each operation.
  • the command line tool is dumpsys gfxinfo.
  • Dumpsys gfxinfo is a performance analysis optimization tool for the Android operating system.
  • Dumpsys gfxinfo is called by the getRuntime method of the Runtime class in the Android operating system.
  • the steps for obtaining frame data are:
  • dumpsys gfxinfo is a command-line tool
  • the results of the tool analysis are also displayed on the command line.
  • getRuntime returns the running environment object of a process.
  • execute the command using the exec method in the running environment of the process.
  • the command executed is “dumpsys gfxinfo”.
  • the application package name pkg is added to obtain the result stream.
  • the obtained result stream is not all the application frame data, and there are other useless descriptions. Therefore, it is necessary to add the "dumpsys gfxinfo” command.
  • "grep" filters the data and finally obtains the frame data for 128 operations.
  • the complete command is "dumpsys gfxinfo pkg
  • the frame data applied to each operation is the total time of each frame applied.
  • the frame data includes the drawing time, the preparation time, the calculation time, and the execution time of each operation, and the time taken by the smart device for one frame is obtained by summing the drawing time, the preparation time, the calculation time, and the execution time, that is, Applying the total time of each frame, the result stream obtained by dumpsys gfxinfo each time is the time information of the last 128 frames.
  • the exec method is non-blocking. In order to obtain the result stream, you need to call the waitFor method in the running environment of the process to make the exec method wait. After the executed command ends, the getInputStream method in the running environment of the calling process is used to obtain the result stream. After that, the time information of the last 128 frames is obtained.
  • Step S2 Parse the frame data and sum and get the total time of each frame applied.
  • the steps to apply real-time acquisition of the total time of each frame are:
  • the result stream of the frame data obtained in step 1 is a character string, and the arrangement of the string is The formula is 4 ⁇ 128, and each column is drawing time, preparation time, calculation time and execution time, for a total of 4 columns; the composition of the total time of each frame is applied, and the frame data of one operation is applied, for a total of 128 lines. The total time of the last 128 frames of the running is applied.
  • the string of the result stream needs to be saved into a file of csv format and then parsed, that is, the result stream is saved into a file of csv format.
  • Csv is a common file format.
  • the result stream saved in a csv format is parsed to obtain a parsing stream, and the parsing stream is traversed to obtain a rendering time, a preparation time, a calculation time, and an execution time in the frame data, to obtain 128 frame data.
  • the traversal process for parsing streams is:
  • the BufferedReader tool class has a readLine method.
  • the readLine method is used to read each line of the parsing stream. In this way, the data of all the lines of the parsing stream are read in turn.
  • the string cannot be summed, it is necessary to convert the string group containing the drawing time, preparation time, calculation time, and execution time of each operation of the application into a floating point number, and finally the drawing time, preparation time, and time of the frame data.
  • the calculation time and the execution time are summed to obtain the total time of each frame applied, that is, the drawing of each operation of the application obtained after the above splitting
  • the sum, preparation time, calculation time, and execution time are summed to obtain the total time for applying each frame, that is, the time required to apply one frame of the display screen.
  • Converting a string group to a floating point number is done by the parseFloat method of the Float (single-precision floating-point) class, which parseFloat is used to parse the string and then return a floating point number.
  • Step S3 Create a background analysis component to display the application fluency analysis result in real time.
  • the background analysis component is a service component in the Android operating system
  • the service is a system service component of the Android operating system.
  • the service component can be run in the background of the Android operating system, so as to reach the foreground of the Android operating system, that is, the application of the screen of the intelligent mobile device to run fluency analysis, and the purpose of running the service component in the background of the Android operating system.
  • the service component runs by default in the main thread of the Android operating system. In order to prevent the service component from blocking the main thread, it is necessary to create an asynchronous thread.
  • the thread tool class HandlerThread provided by the android operating system creates a thread-incorporated message loop queue, and then creates one. The thread comes with the handler object bound by the message loop queue.
  • the handler is used for the processing of the asynchronous message, so that the message that needs to be called can be sent cyclically through the handler object, that is, the background analysis component service component runs in the asynchronous thread, but the application can be applied.
  • the fluency analysis results are displayed on the front end of the Android operating system, ie on the screen of the smart mobile device.
  • the refresh rate of the smart mobile device of the Android operating system is 60, that is, the screen is refreshed 60 times every 1 second, the human eye can feel the frequency of the animation 24 times per second, more than 24 times, the person feels dynamic, and 1 second 60 can almost completely feel dynamic, after 60 seconds of computing, the screen of the smart mobile device is not refreshed 16.66ms, smart mobile device If the sensory performance is that the interface is not card, the application in the Android operating system needs to be completed within 16.66ms, otherwise it will interfere with the refresh of the next interface, that is, frame dropping occurs.
  • the real-time fluency of the application is calculated using the following empirical formula:
  • I represents a smooth value
  • V represents a frame loss rate. For example, if the display time of 5 frames in the last 30 frames is more than 16.66 ms, that is, in the 30 operations of the application, 5 operations occupy the total. If the time exceeds 16.66ms, the frame is dropped 5 times, and the frame loss rate is 1/6; X is the default experience of frame loss upper limit, X is equal to 20; max indicates the maximum time occupied by the largest application, such as in the last 30 operations.
  • the longest single operation time is 20ms, then max is equal to 20; W 1 is the weight of the frame loss rate, W 2 is the weight of the frame loss time, and W 1 and W 2 are generally 1; d is W The sum of 1 and W 2 , d, is used to ensure that the value of I is within a reasonable range.
  • a calculation range is first selected, and the most recent 30 frame data is generally selected, that is, the last 30 operations are applied for analysis, and max is the maximum time occupied by the largest operation in the 30 operations.
  • the analysis results will be displayed on the screen of the smart mobile device.
  • TextView is used to display text in the Android operating system.
  • Space, setText is used to determine the conclusion.
  • the invention also discloses a system for analyzing the running fluency of an Android application based on an appeal method, comprising a data acquisition module, a judgment module and an output module.
  • the data acquisition module is configured to obtain the total time of each frame of the application, and the total time of each frame is obtained by parsing and summing the frame data acquired by the command line tool, and the frame data is composed of the application time of each application, and the frame data includes an application.
  • Drawing time, preparation time, The calculation time and the execution time that is, the frame data includes the drawing time, the preparation time, the calculation time, and the execution time of each operation of the application, and the data acquisition module collects the multiple operation time of the application, and prepares the drawing time in the frame data.
  • the time, calculation time, and execution time are summed to get the total time of each frame applied, that is, the time required to apply every frame.
  • the judging module is configured to determine whether the application is currently running smoothly according to the total time of each frame applied, that is, the total time of each frame of the plurality of applications obtained by the data acquisition module, that is, the time information of multiple operations;
  • the module is configured to display the judgment result of the judgment module on the application display end, and the application display end is a screen of the smart device for running the application.

Landscapes

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

Abstract

本发明涉及应用开发领域,公开了一种用于分析Android端应用运行流畅度的方法,包括:实时获取应用每一帧的总时间,其中,每一帧的总时间通过命令行工具获取的帧数据解析求和得到,创建后台分析组件,通过分析组件实时分析应用每一帧的总时间,得出并展示应用的实时流畅度。本发明还公开了一种用于分析Android端应用运行流畅度的系统。本发明能够直观反映应用运行的流畅度。

Description

一种用于分析Android端应用运行流畅度的方法和系统 技术领域
本发明涉及应用开发领域,具体涉及一种用于分析Android端应用运行流畅度的方法和一种用于分析Android端应用运行流畅度的系统。
背景技术
随着科学技术的飞速发展,智能设备的普及,人们通过在智能设备上安装各种应用程序,便能进行娱乐和工作,极大地方便了人们的生活。
但当智能设备上安装的应用程序的增多,由于应用程序运行的不稳定性,经常出现应用程序反应缓慢、卡死和闪退的现象,特别是在安装Android操作系统的智能设备中,应用程序反应缓慢、卡死和闪退的现象极为常见。为保证应用程序运行的流畅性,开发人员在开发应用程序时,会对应用程序的运行流畅度进行测试,而当前开发人员对应用程序运行流畅度的判断完全靠人为感官,无法真正的判断出应用程序的运行流畅性能。
发明内容
针对现有技术中存在的缺陷,本发明的目的在于提供一种用于分析Android端应用运行流畅度的方法和一种用于分析Android端应用运行流畅度的系统,能够直观反映应用运行的流畅度。
为达到以上目的,本发明采取的技术方案是,包括:实时获取应用每一帧的总时间,其中,每一帧的总时间通过命令行工具获取的帧 数据解析求和得到,并创建后台分析组件,通过分析组件实时分析应用每一帧的总时间,得出并展示应用的实时流畅度。
在上述技术方案的基础上,所述帧数据包括应用每次运算的绘制时间、准备时间、计算时间和执行时间,所述每一帧的总时间为绘制时间、准备时间、计算时间和执行时间的和。
在上述技术方案的基础上,帧数据的获取步骤为:
S1.1:启动Android端应用,并调用命令行工具dumpsys gfxinfo;
S1.2:获得应用当前进程的运行环境;
S1.3:调用运行环境中的exec方法,获取结果流,所述结果流包括应用128次运算的帧数据。
在上述技术方案的基础上,应用每一帧的总时间的实时获取步骤为:
S2.1:解析结果流得到解析流,遍历解析流得到帧数据的绘制时间、准备时间、计算时间和执行时间;
S2.2:对帧数据的绘制时间、准备时间、计算时间和执行时间求和,得到应用每次运算占用总时间。
在上述技术方案的基础上,将结果流保存成csv格式的文件后进行解析。
在上述技术方案的基础上,所述后台分析组件为Android系统的service组件。
在上述技术方案的基础上,所述后台分析组件运行在异步线程中。
本发明还公开了一种用于分析Android端应用运行流畅度的系统,包括:
数据采集模块,其用于获取应用每一帧的总时间,应用每一帧的 总时间通过命令行工具获取的帧数据解析求和得到;
判断模块,其用于根据应用每一帧的总时间,判断应用当前是否流畅运行;
输出模块,其用于将判断模块的判断结果展示于应用显示端。
在上述技术方案的基础上,所述帧数据包括应用每次运算的绘制时间、准备时间、计算时间和执行时间。
在上述技术方案的基础上,所述应用显示端为用于运行应用的智能移动设备的屏幕。
与现有技术相比,本发明的一种用于分析Android端应用运行流畅度的方法的优点在于:通过获取应用的帧数据,并计算出应用每次运算占用总时间,即应用每一帧的总时间,根据经验公式计算得出应用运行是否流畅,且能够在运行待分析流畅度的应用的同时,在智能移动设备的屏幕上显示出分析结果,方便开发人员找出应用运行卡顿的具体位置,便于后续对应用的优化。
本发明的一种用于分析Android端应用运行流畅度的系统的优点在于:数据采集模块采集应用每一帧的总时间,而后判断模块对采集的数据进行判断后,由输出模块将结果显示在智能移动设备的屏幕上,直观反映应用的流畅度,自动化程度高,极大地减轻了应用开发人员的工作难度。
附图说明
图1为本发明一种用于分析Android端应用运行流畅度的方法的流程图。
具体实施方式
以下结合附图对本发明作进一步详细说明。
参见图1所示,本发明提供一种用于分析Android端应用运行流畅度的方法,用于对运行在Android操作系统上的应用的运行流畅度进行分析,Android操作系统运行于智能移动设备上,如智能手机。该方法包括:实时获取应用每一帧的总时间,其中,每一帧的总时间通过命令行工具获取的帧数据解析求和得到,然后创建后台分析组件,通过分析组件实时分析应用每一帧的总时间,得出并展示应用的实时流畅度。
具体的步骤为:
步骤S1:启动Android端应用,并调用命令行工具,获取应用的帧数据,帧数据为应用的每次运算时间组成,对帧数据求和即可得到应用每一帧的总时间,帧数据包括应用每一次运算的绘制时间、准备时间、计算时间和执行时间,对应用每一次运算的绘制时间、准备时间、计算时间和执行时间求和即得到应用每一帧的总时间。本实施例中,命令行工具为dumpsys gfxinfo。dumpsys gfxinfo为Android操作系统的性能分析优化工具。dumpsys gfxinfo通过Android操作系统中Runtime(运行时刻)类的getRuntime方法调用。帧数据的获取步骤为:
S1.1:启动Android端应用,并调用命令行工具dumpsys gfxinfo;
S1.2:获得应用当前进程的运行环境;
S1.3:调用运行环境中的exec方法,获取结果流,所述结果流包括应用128次运算的帧数据。
由于dumpsys gfxinfo为命令行的工具,该工具分析得出的结果也显示在命令行上,我们需要将分析得出的应用运行流畅结果直接显示在智能移动设备的屏幕上,因此需要代码来实现该逻辑,代码具体为:
Process process=Runtime.getRuntime()//获取java运行环境
process.exec(“dumpsys gfxinfo pkg|grep-A 128Exexute”)//执行命令
对代码的解释如下:
使用Runtime类的getRuntime方法来获得应用当前进程的运行环境,getRuntime返回一个进程的运行环境对象,这时,使用进程的运行环境中的exec方法来执行命令,执行的命令为“dumpsys gfxinfo”,同时在执行的命令后面加上应用的包名pkg,从而获取结果流,获得的结果流并不全是应用的帧数据,还有其它的一些无用的描述,因此需要在“dumpsys gfxinfo”命令后面加上“grep”以对数据进行过滤,最终得到应用128次运算的帧数据,完整的命令即为“dumpsys gfxinfo pkg|grep-A 128Exexute”。应用每一次运算的帧数据即为应用每一帧的总时间。
帧数据包括应用每一次运算的绘制时间、准备时间、计算时间和执行时间,对绘制时间、准备时间、计算时间和执行时间求和即可得到智能设备一帧画面的所占用的时间,也就是应用每一帧的总时间,dumpsys gfxinfo每次获取的结果流为最近128帧的时间信息。
exec方法是非阻塞的,为了获取结果流,需要调用进程的运行环境中的waitFor方法使exec方法处于等待状态,等执行的命令结束后,调用进程的运行环境中的getInputStream方法来获取结果流,过滤后得到最近128帧的时间信息。
步骤S2:解析帧数据,并求和得到应用每一帧的总时间。应用每一帧的总时间的实时获取的步骤为:
步骤1中获得的帧数据的结果流为一字符串,该字符串的排列方 式为4×128的形式,每列分别为绘制时间、准备时间、计算时间和执行时间,总共4列;每行为应用每一帧的总时间的组成,应用一次运算的帧数据,总共128行,共应用运行的最近128帧的时间信息。为了便于对字符串进行解析,需要将结果流的字符串保存成一个csv格式的文件后再解析,即将结果流保存成一csv格式的文件。Csv为一常见的文件格式。
对保存成一个csv格式的结果流进行解析得到解析流,并遍历解析流得到帧数据内的绘制时间、准备时间、计算时间和执行时间,得到128个帧数据。
对解析流的遍历过程为:
调用java中的BufferedReader工具类,并创建一BufferedReader对象,java为一常见编程语言,BufferedReader为java中的缓存阅读器。然后将解析流作为参数传入到BufferedReader对象中,BufferedReader工具类有一readLine方法,readLine方法用于读取解析流的每行数据,就这样依次读完解析流所有行的数据,读完后,readLine方法每次返回的为128个帧数据中的1个帧数据的字符串,即应用一次运算的绘制时间、准备时间、计算时间和执行时间,为了方便后续步骤的求和计算,需要将每帧数据的字符串进行拆分,使用’\t’字符对每帧数据的字符串进行拆分,得到包含有应用每次运算的绘制时间、准备时间、计算时间和执行时间的字符串组,即帧数据的字符串组,以此处理完128个帧数据。
因为字符串是无法求和的,故需要将包含有应用每次运算的绘制时间、准备时间、计算时间和执行时间的字符串组转成浮点数,最后对帧数据的绘制时间、准备时间、计算时间和执行时间求和,得到应用每一帧的总时间,即对上述拆分后得到的应用每次运算的绘制时 间、准备时间、计算时间和执行时间进行求和,得到应用每一帧的总时间,即应用显示画面1帧所需时间。字符串组转成浮点数通过Float(单精度浮点型)类的parseFloat方法实现,parseFloat用于解析字符串,然后返回浮点数。
步骤S3:创建后台分析组件,实时展示应用流畅度分析结果。
本实施例中,后台分析组件为Android操作系统中的service组件,service为Android操作系统的系统服务组件。为了达到边操作应用界面边获取应用流畅度分析结果的目的,从而便于找出应用使用过程中容易卡顿的步骤或位置,且不干扰待分析流畅度的应用本身的使用,因此采用service组件,service组件可以在Android操作系统的后台运行,这样达到Android操作系统前台,即智能移动设备的屏幕运行待分析流畅度的应用,Android操作系统后台运行service组件的目的。
service组件默认运行在Android操作系统的主线程中,为了防止service组件阻塞主线程,因此需要创建一异步线程,通过android操作系统提供的线程工具类HandlerThread创建线程自带消息循环队列,然后创建一个以线程自带消息循环队列绑定的handler对象,handler用于异步消息的处理,这样通过handler对象可以将需要调用的消息进行循环发送,即后台分析组件service组件运行在异步线程中,但能够将应用的流畅度分析结果展示在Android操作系统的前台,即智能移动设备的屏幕上。
Android操作系统的智能移动设备的刷新率都是60,即每1秒刷新屏幕60次,人肉眼能感受到动画的频率是每秒24次,超过24次人就感觉是动态的,而1秒60几乎能完全感觉是动态的,1秒60次计算后即智能移动设备的屏幕没16.66ms刷新一次,智能移动设备的 若给人感官表现为界面不卡,则Android操作系统中应用每次运算需要在16.66ms内完成,否则会干扰下次界面的刷新,即出现丢帧现象。
应用的实时流畅度通过以下经验公式计算得出:
I=V*X*W1+(max/16.66)*W2-d
当I大于0时,表示流畅,当I小于0时,表示不流畅;
其中,I表示流畅值;V表示丢帧率,例如若在最近的30帧画面中,其中有5帧画面的显示时间超过16.66ms,即在应用的30次运算中,有5次运算占用总时间超过16.66ms,则丢帧5次,丢帧率为1/6;X为丢帧上限默认经验,X等于20;max表示最大的应用一次运算占用总时间,例如在最近的30次运算中,最长的单次运算总时间为20ms,则max等于20;W1为丢帧率的权重,W2为丢帧时长的权重,W1和W2一般均取值为1;d为W1与W2之和d,d用来保证I的值在一个合理的范围内。
在进行流畅值的计算时,会先选取一计算范围,一般选取最近的30个帧数据,即应用最近的30次运算进行分析,则max为该30次运算中最大的一次运算占用总时间。
得出流畅度分析结果后,将分析结果,即将流畅或不流畅的结论显示在智能移动设备的屏幕上,具体的使用TextView的setText对结论进行显示,TextView为Android操作系统中用于显示文本的空间,setText用于确定结论。
本发明还公开了一种基于上诉方法的用于分析Android端应用运行流畅度的系统,包括数据采集模块、判断模块和输出模块。
数据采集模块,其用于获取应用每一帧的总时间,应用每一帧的总时间通过命令行工具获取的帧数据解析求和得到,帧数据为应用每次运算时间组成,帧数据包括应用每次运算的绘制时间、准备时间、 计算时间和执行时间,即帧数据内包括应用每一次运算的绘制时间、准备时间、计算时间和执行时间,且数据采集模块采集应用的多次运算时间,并对帧数据中的绘制时间、准备时间、计算时间和执行时间求和得到应用每一帧的总时间,即应用每1帧所需的时间。
判断模块用于根据应用每一帧的总时间,即数据采集模块得到的多个应用每一帧的总时间,即多次运算的时间信息,采用上述经验公式,判断应用当前是否流畅运行;输出模块用于将判断模块的判断结果展示于应用显示端,应用显示端为用于运行应用的智能设备的屏幕。
本发明不局限于上述实施方式,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也视为本发明的保护范围之内。本说明书中未作详细描述的内容属于本领域专业技术人员公知的现有技术。

Claims (10)

  1. 一种用于分析Android端应用运行流畅度的方法,其特征在于,包括:
    实时获取应用每一帧的总时间,其中,每一帧的总时间通过命令行工具获取的帧数据解析求和得到;
    创建后台分析组件,通过分析组件实时分析应用每一帧的总时间,得出并展示应用的实时流畅度。
  2. 如权利要求1所述的一种用于分析Android端应用运行流畅度的方法,其特征在于:所述帧数据包括应用每次运算的绘制时间、准备时间、计算时间和执行时间,所述每一帧的总时间为绘制时间、准备时间、计算时间和执行时间的和。
  3. 如权利要求2所述的一种用于分析Android端应用运行流畅度的方法,其特征在于,帧数据的获取步骤为:
    S1.1:启动Android端应用,并调用命令行工具dumpsys gfxinfo;
    S1.2:获得应用当前进程的运行环境;
    S1.3:调用运行环境中的exec方法,获取结果流,所述结果流包括应用128次运算的帧数据。
  4. 如权利要求3所述的一种用于分析Android端应用运行流畅度的方法,其特征在于,应用每一帧的总时间的实时获取步骤为:
    S2.1:解析结果流得到解析流,遍历解析流得到帧数据的绘制时间、准备时间、计算时间和执行时间;
    S2.2:对帧数据的绘制时间、准备时间、计算时间和执行时间求和,得到应用每次运算占用总时间。
  5. 如权利要求4所述的一种用于分析Android端应用运行流畅度的方法,其特征在于:将结果流保存成csv格式的文件后进行解析。
  6. 如权利要求1所述的一种用于分析Android端应用运行流畅度的方法,其特征在于:所述后台分析组件为Android系统的service组件。
  7. 如权利要求1所述的一种用于分析Android端应用运行流畅度的方法,其特征在于:所述后台分析组件运行在异步线程中。
  8. 如权利要求1所述的一种用于分析Android端应用运行流畅度的方法,其特征在于:应用的实时流畅度通过以下经验公式计算得出:
    I=V*X*W1+(max/16.66)*W2-d
    当I大于0时,表示流畅,当I小于0时,表示不流畅;
    其中,V表示丢帧率,X为丢帧上限默认经验,X等于20,max表示最大的应用一次运算占用总时间,W1为丢帧率的权重,W2为丢帧时长的权重,d为W1与W2之和。
  9. 一种基于权利要求1所述方法的用于分析Android端应用运行流畅度的系统,其特征在于,包括:
    数据采集模块,其用于获取应用每一帧的总时间,应用每一帧的总时间通过命令行工具获取的帧数据解析求和得到;
    判断模块,其用于根据应用每一帧的总时间,判断应用当前是否流畅运行;
    输出模块,其用于将判断模块的判断结果展示于应用显示端。
  10. 如权利要求9所述的一种用于分析Android端应用运行流畅度的系统,其特征在于:所述帧数据包括应用每次运算的绘制时间、准备时间、计算时间和执行时间。
PCT/CN2017/113255 2016-11-30 2017-11-28 一种用于分析Android端应用运行流畅度的方法和系统 WO2018099356A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201611087649.7A CN106557426B (zh) 2016-11-30 2016-11-30 一种用于分析Android端应用运行流畅度的方法和系统
CN201611087649.7 2016-11-30

Publications (1)

Publication Number Publication Date
WO2018099356A1 true WO2018099356A1 (zh) 2018-06-07

Family

ID=58445879

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/113255 WO2018099356A1 (zh) 2016-11-30 2017-11-28 一种用于分析Android端应用运行流畅度的方法和系统

Country Status (2)

Country Link
CN (1) CN106557426B (zh)
WO (1) WO2018099356A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116501531A (zh) * 2023-06-19 2023-07-28 成都移信通科技有限公司 用于监测软件运行数据安全的软件插件配置方法和系统
CN116916093A (zh) * 2023-09-12 2023-10-20 荣耀终端有限公司 识别卡顿的方法、电子设备及存储介质

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106557426B (zh) * 2016-11-30 2018-09-04 武汉斗鱼网络科技有限公司 一种用于分析Android端应用运行流畅度的方法和系统
CN107239275A (zh) * 2017-05-17 2017-10-10 努比亚技术有限公司 应用运行方法、终端及计算机可读存储介质
CN107656866B (zh) * 2017-09-06 2020-11-27 厦门美图移动科技有限公司 一种测试应用流畅度的方法、移动终端和计算设备
CN108304294B (zh) * 2018-01-23 2020-05-12 武汉斗鱼网络科技有限公司 Ios应用的实时帧数监测方法、存储介质、设备及系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103136102A (zh) * 2013-02-07 2013-06-05 百度在线网络技术(北京)有限公司 一种Android平台的流畅度测试方法和装置
CN104572086A (zh) * 2014-12-24 2015-04-29 惠州Tcl移动通信有限公司 基于安卓设备的fps值获取方法及获取系统
CN105100784A (zh) * 2014-04-21 2015-11-25 展讯通信(上海)有限公司 流畅度的测试方法及装置
CN106055469A (zh) * 2016-05-19 2016-10-26 中国科学院软件研究所 一种基于代码注入的移动端应用测试系统及方法
CN106557426A (zh) * 2016-11-30 2017-04-05 武汉斗鱼网络科技有限公司 一种用于分析Android端应用运行流畅度的方法和系统

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102479151B (zh) * 2010-11-26 2014-10-22 腾讯科技(深圳)有限公司 一种网页访问速度的测试方法及装置
CN103064664B (zh) * 2012-11-28 2015-07-22 华中科技大学 一种基于性能预估的Hadoop参数自动优化方法和系统
CN103559130A (zh) * 2013-11-01 2014-02-05 百度在线网络技术(北京)有限公司 浏览器流畅度的测试方法和装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103136102A (zh) * 2013-02-07 2013-06-05 百度在线网络技术(北京)有限公司 一种Android平台的流畅度测试方法和装置
CN105100784A (zh) * 2014-04-21 2015-11-25 展讯通信(上海)有限公司 流畅度的测试方法及装置
CN104572086A (zh) * 2014-12-24 2015-04-29 惠州Tcl移动通信有限公司 基于安卓设备的fps值获取方法及获取系统
CN106055469A (zh) * 2016-05-19 2016-10-26 中国科学院软件研究所 一种基于代码注入的移动端应用测试系统及方法
CN106557426A (zh) * 2016-11-30 2017-04-05 武汉斗鱼网络科技有限公司 一种用于分析Android端应用运行流畅度的方法和系统

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116501531A (zh) * 2023-06-19 2023-07-28 成都移信通科技有限公司 用于监测软件运行数据安全的软件插件配置方法和系统
CN116501531B (zh) * 2023-06-19 2023-09-08 成都移信通科技有限公司 用于监测软件运行数据安全的软件插件配置方法和系统
CN116916093A (zh) * 2023-09-12 2023-10-20 荣耀终端有限公司 识别卡顿的方法、电子设备及存储介质
CN116916093B (zh) * 2023-09-12 2023-11-17 荣耀终端有限公司 识别卡顿的方法、电子设备及存储介质

Also Published As

Publication number Publication date
CN106557426B (zh) 2018-09-04
CN106557426A (zh) 2017-04-05

Similar Documents

Publication Publication Date Title
WO2018099356A1 (zh) 一种用于分析Android端应用运行流畅度的方法和系统
US9514026B2 (en) Debugging analysis in running multi-user systems
CN104484216B (zh) 服务接口文档和在线测试工具生成方法、装置
US8776025B2 (en) Integrated debugger and code coverage tool
US8752020B2 (en) System and process for debugging object-oriented programming code leveraging runtime metadata
RU2004100523A (ru) Средство разработки активного содержимого: исполнение задач и структурированного содержимого
US8418148B2 (en) Thread execution analyzer
US11288064B1 (en) Robotic process automation for interactive documentation
CN106020823A (zh) 一种前端Web表现与数据分离以及页面快速响应的方式
US9552221B1 (en) Monitoring application execution using probe and profiling modules to collect timing and dependency information
CN103049371A (zh) Android应用程序测试方法和测试装置
US8291386B2 (en) System and process for debugging object-oriented programming code
US11201806B2 (en) Automated analysis and recommendations for highly performant single page web applications
CN110275704A (zh) 页面数据处理方法和装置,存储介质和电子设备
KR20180009589A (ko) 프로그램 분석 장치 및 방법
CN113360385B (zh) 一种测试方法、装置、设备及介质
CN112783614A (zh) 对象处理方法、装置、设备、存储介质以及程序产品
CN107562464A (zh) 一种命令行接口的调用方法、装置及设备
Savidis et al. Complete block-level visual debugger for blockly
WO2020073200A1 (zh) 调试程序的方法和系统
CN111881025B (zh) 一种自动化测试任务调度方法、装置及系统
US20140007049A1 (en) Integrating diagnostic information in development environment
CN116128424A (zh) 数据文件质量检查方法及装置
CN106775788A (zh) 一种自动生成和运行JavaScript文件的方法
US20020062208A1 (en) Method and apparatus for visualization of microprocessor pipeline operation

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17877150

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17877150

Country of ref document: EP

Kind code of ref document: A1