WO2020056878A1 - 一种应用界面启动时长的获取方法、装置及终端设备 - Google Patents

一种应用界面启动时长的获取方法、装置及终端设备 Download PDF

Info

Publication number
WO2020056878A1
WO2020056878A1 PCT/CN2018/113732 CN2018113732W WO2020056878A1 WO 2020056878 A1 WO2020056878 A1 WO 2020056878A1 CN 2018113732 W CN2018113732 W CN 2018113732W WO 2020056878 A1 WO2020056878 A1 WO 2020056878A1
Authority
WO
WIPO (PCT)
Prior art keywords
time
time point
rendering
rendering work
interface
Prior art date
Application number
PCT/CN2018/113732
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 网宿科技股份有限公司
Priority to US16/769,219 priority Critical patent/US20210173697A1/en
Priority to EP18933895.7A priority patent/EP3851966A4/en
Publication of WO2020056878A1 publication Critical patent/WO2020056878A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3438Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment monitoring of user actions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3409Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
    • G06F11/3419Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment by assessing time
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30145Instruction analysis, e.g. decoding, instruction word fields
    • G06F9/30149Instruction analysis, e.g. decoding, instruction word fields of variable length instructions
    • G06F9/30152Determining start or end of instruction; determining instruction length
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/541Interprogram communication via adapters, e.g. between incompatible applications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system

Definitions

  • Embodiments of the present invention relate to the field of terminal devices, and in particular, to a method for acquiring the startup time of an application interface, and a device and device thereof.
  • Testers have a large workload and low use case coverage, which cannot cover all scenarios of all devices in the market.
  • the interface is finally drawn and rendered to the moment before the user's eyes, it can only be judged by visual observation.
  • the system does not give a callback notification at this moment. Therefore, based on this, some public technical solutions are currently proposed.
  • the script can be used to determine when the interface rendering is completed by the machine instead of the human. To collect relevant data, saving manpower workload.
  • the purpose of the embodiments of the present invention is to provide a method, a device and a terminal device for obtaining the application interface startup time, which can accurately obtain the application interface startup time, and can be directly integrated into the application, which is simple to implement and saves the work of testers. the amount.
  • an embodiment of the present invention provides a method for acquiring an application interface startup time, including the following steps:
  • the current time point is recorded as the time point of the rendering work message, and among the time points of multiple rendering work messages recorded in chronological order, the first meeting
  • the time point of the conditional rendering work message is set as the second time point, where the preset condition is: the time difference between the time point of rendering the work message and the time point of the subsequent rendering work message is the preset duration;
  • An embodiment of the present invention further provides a device for acquiring an application interface startup duration, including:
  • a recording module configured to record a first time point when an interface start instruction is issued
  • the recording module is also used to record the current time point as the time point of the rendering work message each time the monitoring module listens to the rendering work message;
  • the application interface startup time determination module is configured to use the time point of the first rendering work message that meets the preset condition as the second time point among the time points of multiple rendering work messages recorded in chronological order;
  • the condition is that the time difference between the time when the work message is rendered and the time point when the subsequent work message is rendered is a preset time, and the time difference between the first time point and the second time point is used as the application interface startup time.
  • An embodiment of the present invention further provides a terminal device, including:
  • At least one processor At least one processor
  • a memory connected in communication with the at least one processor
  • the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the method for acquiring an application interface startup time.
  • An embodiment of the present invention also provides a computer-readable storage medium storing a computer program, and the computer program is executed by a processor to implement the foregoing method for acquiring an application interface startup duration.
  • the embodiment of the present invention records the first time point when the startup interface instruction is issued as the time when the application program interface starts to start.
  • the rendering mechanism when the device completes complex and time-consuming work, it will be strictly followed. Refresh the interface characteristics (that is, the interval between two adjacent rendering messages is a specific time interval), and obtain the time when the rendering mechanism refreshes the interface for the first time according to the rendering frequency as the end time of the application interface startup completion. , So that according to the start time and end time, the accurate start time of the application interface can be obtained.
  • the records at these points in time are all operated by terminal devices, they can be directly integrated into the application to achieve the purpose of collecting a large amount of data of online users and covering a wide range of use cases without the need for a large number of dedicated testers. Testing can save manual workload.
  • the above-mentioned monitoring of the rendering work message includes: continuously monitoring the rendering work message until the Nth rendering work message is monitored; wherein N is a preset value.
  • N is a preset value.
  • most of the work processed when the application's interface is started is distributed in a certain number of frames, so collecting the time point information of each rendering message in the preset N frames can basically cover most of the Scenarios for developers to analyze performance issues.
  • the above-mentioned monitoring of the rendering work message includes: a time point for determining whether a rendering work message that meets a preset condition appears after each monitoring of the rendering work message; when a rendering work message that meets a preset condition appears, Stop listening for render job messages. Because when the application is in a normal interactive and smooth situation, the rendering mechanism will refresh the screen strictly according to a certain frequency, that is, the time difference between the two rendering work messages is constant, so if the time point that meets the preset conditions appears, it means that The application is already in a normal interactive situation and no more time points need to be recorded.
  • the above-mentioned record of the first time point of issuing the interface instruction includes: monitoring the life cycle of all interfaces of the application; when receiving the callback notification of the life cycle of all interfaces of the application, the time point at which the monitoring callback notification is received, records Is the first point in time.
  • the method for obtaining the startup duration of the application interface further includes: reporting the time points of the multiple rendering work messages recorded to the server.
  • the recorded string of time points includes information about some important nodes and the approximate time information of the interface rendering. Uploading this information to the server can facilitate developers to analyze performance issues.
  • FIG. 1 is a flowchart of a method for acquiring an application interface startup duration according to a first embodiment of the present invention
  • FIG. 2 is a flowchart of a method for acquiring an application interface startup duration according to a second embodiment of the present invention
  • FIG. 3 is a schematic diagram of a time point of rendering a work message monitored in a second embodiment according to the present invention.
  • FIG. 4 is a schematic structural diagram of an apparatus for acquiring an application interface startup duration according to a third embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a terminal device according to a fourth embodiment of the present invention.
  • a first embodiment of the present invention relates to a method for acquiring an application interface startup time.
  • the first time point when the start interface instruction is issued is recorded; the rendering work message is monitored; wherein, each time the rendering work message is monitored, the current time point is recorded as the time point of the rendering work message, and recorded in chronological order Of the time points of multiple rendering work messages, the time point of the first rendering work message that meets a preset condition is used as the second time point; wherein the preset condition is: the time point of rendering the work message and the subsequent rendering The time difference between the time points of the work message is a preset time length; and the time difference between the first time point and the second time point is used as the application interface startup time.
  • the rendering mechanism By recording the first time point when the start interface instruction is issued as the start time of the application program interface; in the rendering mechanism, when the device completes complex and time-consuming work, it will refresh the characteristics of the interface according to the strict rendering frequency (that is, the adjacent The interval between two rendering messages is a characteristic of a specific time interval.)
  • the time point when the rendering mechanism first refreshes the interface according to the rendering frequency is used as the end time of the application interface startup completion, so according to the start and end time, that is, Get accurate startup time of the application interface.
  • the records at these points in time are all operated by terminal devices, they can be directly integrated into the application to achieve the purpose of collecting a large amount of data of online users and covering a wide range of use cases without the need for a large number of dedicated testers. Testing can save manual workload.
  • the method for obtaining the startup time of the application interface in this embodiment is shown in FIG. 1, and specifically includes the following steps:
  • Step 101 The terminal device records a first time point at which the start interface instruction is issued.
  • the terminal device in this embodiment may be a terminal device such as a mobile phone, a computer, and a tablet, which are not described in detail here.
  • the terminal device can record the first time point of the startup interface instruction in two ways.
  • the first way is to bury a point in the source program, and in each startActivity () instruction
  • the current time T1 is actively recorded at the execution time of T1
  • T1 is the first time point when the start interface command is issued.
  • the second method is to monitor the life cycle of the interface used by the application.
  • the time point when the monitoring callback notification is received is recorded as the first time point. That is, in the entrance of the terminal application, through the "ActivityLifecycleCallbacks" instruction, the lifecycles of all the interfaces of the monitoring application are registered and registered.
  • the current time point is recorded as the T1 time point.
  • the Android system is used as an example in this embodiment, but the technical solution provided by the present invention can also be applied to other operating systems, and is not limited to being applied to the Android system.
  • the called interface can be adjusted based on the settings of the operating system.
  • the first method records the time point accurately, but the implementation is more complicated, and the relevant code needs to be buried and processed in various places in the source program.
  • the time recorded in the second method will be slightly delayed, but the implementation is simple and only needs to be processed at the source program entrance, and although the recorded time is after the interface startup instruction is executed, it corresponds to the interface Before various business scenarios work, drawing work, rendering work, so this time delay will not have much impact.
  • the first method or the second method can be selected to record the first time point when the start interface instruction is issued.
  • step 102 to step 105 the rendering work message is monitored.
  • terminal device systems such as the Android system
  • an application runs during processing of messages, and each message carries some tasks. For example, opening an interface instruction is a task, and drawing an interface is a task. It is a task to deal with the business scene, and it is also a task to render to the user.
  • the refresh and presentation of the terminal device interface are dependent on the rendering mechanism. They are refreshed at a fixed frequency, such as Android devices, which are fixed at 60 frames per second. That is, under normal circumstances, every 16.6 ms will have a task to render the interface carried by the message and placed in the message queue for execution.
  • the application interface is time-consuming because the business scenario work of the interface, the calculation and drawing of the user interface (UI), and the rendering of the interface are performed after the interface framework is set up by the system. Operation.
  • the business scenario of the product is too complicated, too much work needs to be processed, the UI of the interface is too complicated, and there are too many levels of UI control nesting, then these operations will be too time consuming.
  • the interval is a characteristic of a specific time interval), and the end time of the completion of the startup of the application interface is obtained.
  • Step 102 Determine whether the rendering work message is monitored. If yes, go to step 103, otherwise continue to step 102.
  • the terminal device can monitor the rendering work messages in the following ways:
  • a callback notification for monitoring the execution of rendering work can be registered by the system's "Choreographer.postFrameCallback ()" instruction.
  • the system's Choreographer.FrameCallback.doFrame () will be called back, and the time when the callback notification is received will be used as the time point for the monitored rendering work messages.
  • the terminal device determines whether the rendering work message is monitored, in fact, it is monitoring whether the rendering work is performed. If the callback notification is received, it is determined that the rendering work has been performed, that is, the rendering work message is monitored. At this time, step 103 is performed, and the current time point is recorded as the time of the monitored rendering work message; otherwise, it continues to determine whether the rendering work message is monitored .
  • Step 104 Determine whether the time point of the rendering work message that meets the preset conditions appears. If yes, proceed to step 105, otherwise proceed to step 102 and continue to monitor the next rendering work message.
  • the preset condition in this embodiment is that a time difference between a time point at which a work message is rendered and a time point at which a subsequent work message is rendered is a preset time length, where the preset time length may be two adjacent times in the running process of the application. The interval between refreshing the interface. If the terminal device determines that the time point of the current rendering work message satisfies a preset condition, it indicates that the application program is running normally, and it is not necessary to continue to monitor the rendering work message, and directly proceeds to step 105, otherwise it proceeds to step 102 and continues monitoring.
  • the refresh and presentation of the terminal device interface are dependent on the rendering mechanism, they are refreshed at a fixed frequency, such as Android devices, which are fixed at a frequency of 60 frames per second, which means that under normal circumstances, the application program is Every 16.6ms during the running process, a task of the rendering interface will be carried by the message and placed in the message queue for execution. If the time difference between the time points of two adjacent rendering work messages is the same as that of the application during the running process The interval between two refreshes of the interface is an indication that the application interface has been drawn. The first point in time that meets this condition is the point in time when the application program interface is drawn and rendered in front of the user.
  • time difference between the time points between two adjacent rendering work messages is not the interval between the two refreshing interfaces of the application during the running process, it indicates that the application interface has not been drawn and the monitoring needs to continue.
  • Step 105 Use the time point of the rendering work message that meets the preset conditions as the second time point, and obtain the application interface startup time according to the first time point and the second time point.
  • step 102 to step 104 each time when a rendering work message is monitored, the current time point is recorded as the time point of the rendering work message, until the time point when the rendering work message that meets the preset conditions is obtained, the The time point is the time point when the application program interface drawing is completed, and it is recorded as the second time point, which indicates that the application is in a normal interactive situation. No more time points need to be recorded. The terminal device no longer continues to monitor rendering work messages.
  • the application interface startup time can be obtained. That is, the time difference between the first time point and the second time point is used as the application interface startup time.
  • the time difference calculation of the first time point and the second time point may be implemented by the terminal device itself, or the time difference calculation of the first time point and the second time point may be implemented by the server.
  • the terminal device reports the time points of the recorded multiple rendering work messages to the server, and the server calculates the time difference between the first time point and the second time point, thereby obtaining the application interface startup time. Since the recorded rendering work message time points include the approximate time information of the interface rendering, reporting the time points of multiple recorded rendering work messages to the server can also facilitate developers to analyze the performance issues of the device.
  • the server can also detect whether the time when the rendering work messages that meet the preset conditions occur is detected according to the recorded time points of the rendering work messages, and When a time when a rendering work message meeting a preset condition is detected is detected, the terminal device is notified. That is to say, in practical applications, the terminal device may also determine, based on the notification message from the server, whether or not a time when a rendering work message meeting a preset condition appears.
  • the first time point of issuing the startup interface instruction is recorded as the start time of the application program interface.
  • the rendering mechanism when the device completes complex and time-consuming work, it will refresh the interface according to the strict rendering frequency. (That is, the interval between two adjacent rendering messages is a specific time interval), the time when the rendering mechanism refreshes the interface for the first time according to the rendering frequency is used as the end time for the completion of the application interface startup. Time and end time, you can get the exact start time of the application interface. And because the records at these points in time are all operated by terminal devices, they can be directly integrated into the application to achieve the purpose of collecting a large amount of data of online users and covering a wide range of use cases without the need for a large number of dedicated testers. Testing can save manual workload.
  • a second embodiment of the present invention relates to a method for acquiring an application interface startup time.
  • the second embodiment is substantially the same as the first embodiment, and the main difference is that in the first embodiment, after each time the rendering work message is monitored, it is determined whether or not a rendering work message meeting a preset condition appears, When the rendering work message meeting the preset condition appears, stop the monitoring of the rendering work message.
  • the rendering work message is continuously monitored until the N-th rendering work message is monitored; where N is a preset value.
  • the method for obtaining the startup time of the application interface in this embodiment is shown in FIG. 2, and specifically includes the following steps.
  • Step 201 The terminal device records a first time point when the start interface instruction is issued.
  • Step 202 Determine whether the rendering work message is monitored. If yes, go to step 203, otherwise continue to step 202.
  • Step 203 Record the current time point as the time point of the rendering work message monitored.
  • Steps 203 to 203 are substantially the same as steps 101 to 103 of the first embodiment. To avoid repetition, details are not repeated here.
  • Step 204 It is determined whether the number of monitored rendering work messages reaches N. If yes, step 205 is performed; otherwise, step 202 is performed, and the next rendering work message is monitored.
  • N is a preset value, and can be specifically set to a value greater than 5.
  • the terminal device can register a callback notification that listens to the execution of rendering work. When the system's message queue has reached the execution of the rendering work message on the current interface, it will be called back. The current time point is recorded here, and the process is repeated until N rendering work messages are recorded, and the terminal device no longer listens to the rendering work messages. In most scenarios, most of the work handled when the interface of the terminal device application is started is distributed in a certain number of frames. Therefore, collecting the time point information of each rendering message in the preset N frames can basically cover Most scenarios are for developers to analyze performance issues without continuing to listen.
  • N may be taken as 10. Due to the rendering mechanism, when the application is normally interactive and smooth, the screen is refreshed strictly at 60 frames per second, and in most scenarios, most of the work handled by the application's interface when it starts is distributed over 5 frames. Therefore, if N is greater than 5, more scenes can already be covered, and setting N to 10 can further ensure that the time point of rendering work messages that meet the conditions is obtained. Of course, this value can also be modified, but it is recommended to use 10 as the benchmark first, and then after receiving a large amount of data, analyze and confirm the data, and then see if it needs to be shortened or increased accordingly.
  • Step 205 Obtain a second time point from the time points of the N rendering work messages, and obtain the application interface startup time according to the first time point and the second time.
  • the terminal device has recorded N time points for rendering work messages, and judges each of these N time points one by one. If the time point of a certain rendering work message is the first time point that satisfies a preset condition as the second time point ,
  • the preset condition is: the time difference between the time point at which the work message is rendered and the time point at which the next work message is rendered is the preset time length (such as the interval time between the two refreshing interfaces of the application during the running process), the second time The point is the time when the program interface is started. Therefore, the difference between the first time point and the second time point can be used as the application interface startup time.
  • T1-T10 in FIG. 4 are the time points of the 10 monitored rendering work messages. It can be seen that after the application interface is started, there are three Time-consuming operations, one took 2023ms for T1-T2, one took 1020ms for T2-T3, one took 300ms for T3-T4, and then tended to the normal rendering frequency: 16.6ms. Then it can be considered that the time of T1-T4: 3043ms is the startup time of the interface, and the developer can use this information to find out what the three time-consuming operations are and what tasks can be optimized.
  • a third embodiment of the present invention relates to an apparatus for acquiring an application interface startup time, as shown in the figure, including:
  • a recording module 401 configured to record a first time point when an interface start instruction is issued
  • the recording module 401 is further configured to record the current time point as the time point of the rendering work message each time the monitoring module 402 listens to the rendering work message;
  • the application interface startup time determination module 403 is configured to use the time point of the first rendering work message that meets a preset condition as the second time point among the time points of multiple rendering work messages recorded in chronological order; It is assumed that a time difference between a time point when a work message is rendered and a time point when a subsequent work message is rendered is a preset time length, and a time difference between a first time point and a second time point is used as a startup time of the application interface.
  • this embodiment is a system example corresponding to the first or second embodiment, and this embodiment can be implemented in cooperation with the first or second embodiment.
  • the related technical details mentioned in the first embodiment or the second embodiment are still valid in this embodiment. In order to reduce repetition, details are not repeated here. Accordingly, the related technical details mentioned in this embodiment can also be applied in the first embodiment or the second embodiment.
  • each module involved in this embodiment is a logic module.
  • a logical unit may be a physical unit, or a part of a physical unit, and may also be a plurality of physical units. Combined implementation of units.
  • no unit that is not closely related to solving the technical problem proposed by the present invention is introduced, but this does not mean that there are no other units in this embodiment.
  • the fourth embodiment of the present invention relates to a terminal device.
  • the terminal device includes:
  • At least one processor 501 At least one processor 501;
  • a memory 502 in communication with at least one processor 501;
  • the memory 502 stores instructions that can be executed by the at least one processor 501, and the instructions are executed by the at least one processor 501, so that the at least one processor 501 can execute the foregoing method for acquiring an application interface startup time.
  • the memory 502 and the processor 501 are connected in a bus manner.
  • the bus may include any number of interconnected buses and bridges.
  • the bus connects one or more processors 501 and various circuits of the memory 502 together.
  • the bus can also connect various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art, and therefore, they will not be described further herein.
  • the bus interface provides an interface between the bus and the transceiver.
  • a transceiver can be a single component or multiple components, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium.
  • the data processed by the processor 501 is transmitted on a wireless medium through an antenna. Further, the antenna also receives the data and transmits the data to the processor 501.
  • the processor 501 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions.
  • the memory 502 may be used to store data used by the processor 501 when performing operations.
  • the processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions.
  • the memory can be used to store data used by the processor when performing operations.
  • a fifth embodiment of the present invention relates to a computer-readable storage medium storing a computer program.
  • the computer program is executed by the processor, the above method embodiment is implemented.
  • the program is stored in a storage medium and includes several instructions for making a device ( It may be a single-chip microcomputer, a chip, or the like) or a processor to perform all or part of the steps of the method described in each embodiment of the present application.
  • the foregoing storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks and other media that can store program codes .

Abstract

一种应用界面启动时长的获取方法、装置及终端设备,属于终端设备领域。通过记录启动界面指令发出的第一时间点;在每一次监听到渲染工作消息时,记录当前时间点作为渲染工作消息的时间点,并在按时间顺序记录的多个渲染工作消息的时间点中,将首个满足预设条件的渲染工作消息的时间点,作为第二时间点;其中,预设条件为:渲染工作消息的时间点与前一个的渲染工作消息的时间点的时差为预设时长;将第一时间点和第二时间点的时差,作为应用界面启动时长,获得的启动时长准确且实现简单,可以直接集成在应用程序中,节省了测试人员的工作量。

Description

一种应用界面启动时长的获取方法、装置及终端设备 技术领域
本发明实施例涉及终端设备领域,特别涉及应用界面启动时长的获取方法及其装置、设备。
背景技术
随着产品业务的不断迭代,业务场景越来越复杂、交互方式越来越多时,必然会造成应用的性能问题,尤其是在应用各界面的启动时长这个方面,随着应用场景的不断复杂化,所耗的工作必然增多,造成的后果之一就是用户从开始操作要打开某个界面到这个界面最终渲染并呈现给用户这段时长会有所增加。而同样的程序,在不同的终端设备中运行时,由于硬件不同、网络不同、设备系统不同等等因素,所反应出的性能问题也有所不同,或许在某些设备上性能良好,界面启动时长很短,但在某些设备上就会出现性能问题,出现界面启动耗时过长问题。因此,能够正确获取、并采集用户使用应用过程中,各界面的启动时长数据,对于开发人员的性能优化工作有着重要的意义。
由于单单只靠系统API(Application Program Interface应用程序接口)无法正确计算出界面的启动时长,最多只能获取到系统发出启动界面指令这个时刻的时间与将要启动的界面框架搭建完毕时刻的时间,这个时刻界面还未绘制渲染完成,而我们需要的是界面完全呈现到用户眼前的这个时刻的时间点。
现有技术中的普遍做法是通过测试人员人工的来测试、体验界面的启动时长,以这点作为依据交给开发人员进行性能优化。但这种方法仍然存在以下不足:
(1)测试人员工作量大,且用例覆盖面低,无法覆盖市场所有设备各种场景。
(2)只在应用测试阶段采集相关性能数据,一旦应用上线则无法继续收集相关信息。
因为界面最终绘制并渲染呈现到用户眼前的这个时刻,只能通过肉眼观察判断,系统没有给出这个时刻的回调通知。因此,基于这点,目前有一些公开的技术方案则是提出,借助图片采集、识别、匹配技术,结合设备的摄像头等硬件,通过脚本达到让机器代替人工来判断界面渲染完成的时刻,以此来采集相关数据,节省人力工作量。
这种技术方案虽然可以准确的获取界面的启动时长,但需要相关硬件配置支持,且实现难度较大,在上线的产品中大量应用不大现实。
发明内容
本发明实施方式的目的在于提供一应用界面启动时长的获取方法、装置及终端设备,能够准确获取到应用界面的启动时长,而且可以直接集成在应用程序中,实现简单,节省了测试人员的工作量。
为解决上述技术问题,本发明的实施方式提供了一种应用界面启动时长的获取方法,包括以下步骤:
记录启动界面指令发出的第一时间点;
监听渲染工作消息;其中,每一次监听到渲染工作消息时,记录当前时间点作为渲染工作消息的时间点,并在按时间顺序记录的多个渲染工作消息的时间点中,将首个满足预设条件的渲染工作消息的时间点,作为第二时间点;其中,预设条件为:渲染工作消息的时间点与后一个渲染工作消息的时间点的时差为预设时长;
将第一时间点和第二时间点的时差,作为应用界面启动时长。
本发明的实施方式还提供了一种应用界面启动时长的获取装置,包括:
记录模块,用于记录启动界面指令发出的第一时间点;
监听模块,用于监听渲染工作消息;
记录模块还用于在监听模块每一次监听到渲染工作消息时,记录当前时间点作为渲染工作消息的时间点;
应用界面启动时长确定模块,用于在按时间顺序记录的多个渲染工作消息的时间点中,将首个满足预设条件的渲染工作消息的时间点,作为第二时间点;其中,预设条件为:渲染工作消息的时间点与后一个的渲染工作消息的时间点的时差为预设时长,将第一时间点和第二时间点的时差,作为应用界面启动时长。
本发明的实施方式还提供了一种终端设备,包括:
至少一个处理器;以及,
与上述至少一个处理器通信连接的存储器;其中,
存储器存储有可被上述至少一个处理器执行的指令,该指令被上述至少一个处理器执行,以使上述至少一个处理器能够执行上述的的应用界面启动时长的获取方法。
本发明的实施方式还提供了一种计算机可读存储介质,存储有计算机程序,计算机程序被处理器执行时实现上述的应用界面启动时长的获取方法。
本发明实施方式相对于现有技术而言,通过记录启动界面指令发出的第一时间点作为应用程序界面开始启动的时间;利用渲染机制中,当设备完成复杂且耗时的工作后将按照严格 的渲染频率来刷新界面的特性(即相邻两个渲染消息之间的间隔为一特定时间间隔的特性),获取到渲染机制首次按渲染频率刷新界面的时间点作为应用界面启动完成的结束时间,从而根据开始启动的时间和结束时间,即可得到准确的应用界面的启动时长。并且由于这些时间点的记录都是由终端设备操作的,所以可以直接集成在应用程序中,以此达到采集线上用户的大量数据,用例覆盖广的目的,同时不需要专门的测试人员进行大量测试,可以节省人工工作量。
另外,上述监听渲染工作消息,包括:持续监听渲染工作消息,直至监听到第N个渲染工作消息;其中,所述N为预设数值。在大部分场景下,应用的界面启动时所处理的工作大多数都是分布在一定帧数内,因此采集预设的N帧内每个渲染消息执行的时间点信息,基本就可以覆盖大部分场景,供开发人员分析性能问题。
另外,上述监听渲染工作消息,包括:在每一次监听到渲染工作消息后,判断是否出现满足预设条件的渲染工作消息的时间点;在出现满足预设条件的渲染工作消息的时间点时,停止渲染工作消息的监听。由于当应用处于正常可交互、流畅的情况下,渲染机制是会严格按照一定频率刷新屏幕的,即两个渲染工作消息之间的时差一定,因此若出现满足预设条件的时间点,则表明应用已处于正常可交互情况,不需要再记录更多的时间点了。
另外,上述记录启动界面指令发出的第一时间点,包括:监听应用所有界面的生命周期;在接收到应用所有界面的生命周期的监听回调通知时,将接收到监听回调通知的时间点,记录为所述第一时间点。
另外,上述的应用界面启动时长的获取方法,还包括:将记录的多个渲染工作消息的时间点,上报至服务器。记录的一串时间点信息中包括了一些重要节点的信息,以及界面渲染的大致时间信息,将这些信息上传服务器可方便开发人员分析性能问题。
附图说明
一个或多个实施例通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施例的限定。
图1是根据本发明第一实施方式提供的应用界面启动时长的获取方法的流程图;
图2是根据本发明第二实施方式提供的应用界面启动时长的获取方法的流程图;
图3是根据本发明第二实施方式中监听到的渲染工作消息的时间点的示意图;
图4是根据本发明第三实施方式提供的应用界面启动时长的获取装置的结构示意图;
图5是根据本发明第四实施方式提供的终端设备的结构示意图。
具体实施方式
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合附图对本发明的各实施方式进行详细的阐述。然而,本领域的普通技术人员可以理解,在本发明各实施方式中,为了使读者更好地理解本申请而提出了许多技术细节。但是,即使没有这些技术细节和基于以下各实施方式的种种变化和修改,也可以实现本申请所要求保护的技术方案。
本发明的第一实施方式涉及一种应用界面启动时长的获取方法。本实施方式中,记录启动界面指令发出的第一时间点;监听渲染工作消息;其中,每一次监听到渲染工作消息时,记录当前时间点作为渲染工作消息的时间点,并在按时间顺序记录的多个渲染工作消息的时间点中,将首个满足预设条件的渲染工作消息的时间点,作为第二时间点;其中,预设条件为:渲染工作消息的时间点与后一个的渲染工作消息的时间点的时差为预设时长;将第一时间点和第二时间点的时差,作为应用界面启动时长。
通过记录启动界面指令发出的第一时间点作为应用程序界面开始启动的时间;利用渲染机制中,当设备完成复杂且耗时的工作后将按照严格的渲染频率来刷新界面的特性(即相邻两个渲染消息之间的间隔为一特定时间间隔的特性),获取到渲染机制首次按渲染频率刷新界面的时间点作为应用界面启动完成的结束时间,从而根据开始启动的时间和结束时间,即可得到准确的应用界面的启动时长。并且由于这些时间点的记录都是由终端设备操作的,所以可以直接集成在应用程序中,以此达到采集线上用户的大量数据,用例覆盖广的目的,同时不需要专门的测试人员进行大量测试,可以节省人工工作量。
下面对本实施方式的应用界面启动时长的获取方法的实现细节进行具体的说明,以下内容仅为方便理解提供的实现细节,并非实施本方案的必须。
本实施方式中的应用界面启动时长的获取方法如图1所示,具体包括以下步骤:
步骤101:终端设备记录启动界面指令发出的第一时间点。本实施方式的终端设备可以是手机、电脑、平板等终端设备,在此不一一赘述。
具体地说,以Android系统的终端为例,终端设备记录启动界面指令发出的第一时间点可以有两种方式,第一种方式是通过在源程序中埋点,在每条startActivity()指令的执行时刻主动记录当前时间点T1,T1即为发出启动界面指令的第一时间点。第二种方式是监听应用所用界面的生命周期,在接收到应用所有界面的生命周期的监听回调通知时,将接收到监听回调通知的时间点,记录为第一时间点。也就是说,在终端应用的入口中,通过“ActivityLifecycleCallbacks”指令统一注册监听应用所有界面的生命周期,在接收到onActivityCreated()回调时,将当前时间点作为T1时间点记录。值得注意的是,本实施例中 是以Android系统为例进行说明,但本发明所提供的技术方案同样能应用在其他操作系统中,而并不限制于应用在Android系统中,当应用在其他操作系统中时,所调用的接口可基于操作系统的设定而调整。
其中,第一种方式记录的时间点精准,但实现较复杂,需要在源程序中各处里埋点、处理相关代码。而第二种方式记录的时间点会稍微有点延迟,但实现简单,只需要在源程序入口处处理即可,而且记录的时间点虽然是在界面启动指令执行之后,但却是在界面对应的各种业务场景工作、绘制工作、渲染工作之前,因此这点时间延迟并不会有太大影响。这两种方式都可以实现本步骤,具体实施时可根据需要选择以第一种方式或第二种方式,记录启动界面指令发出的第一时间点。
在步骤102至步骤105中,监听渲染工作消息。由于终端设备系统,如Android系统,是基于消息驱动的,一个应用的运行过程中就是在处理一个个的消息,每个消息都会携带一些任务,比如打开界面指令是一个任务,绘制界面是一个任务,处理业务场景工作的是一个任务,渲染呈现给用户也是一个任务。在某一时刻,只会有一个消息处于执行中,其余消息都会在消息队列中等待执行。终端设备界面的刷新、呈现都是依赖于渲染机制,都是以一个固定的频率来刷新界面,比如Android设备,固定以60帧/秒的频率刷新,也就是说,正常情况下,每隔16.6ms会有一个渲染界面的任务被消息携带并放于消息队列中等待执行。
而应用的界面启动之所以会耗时,是因为界面对应的业务场景工作、界面UI(User Interface用户接口)的计算和绘制、界面的渲染操作都是在界面框架由系统搭建完毕之后会去执行的操作。一旦由于产品的业务场景过于复杂,所需要处理的工作过多,界面的UI过于复杂,UI控件嵌套层次过多,那么这些操作就都会过于耗时。用户最终看到界面渲染并呈现的时刻,是需要等这些工作都处理完毕后,那么就会造成不好的用户体验。因此,在本实施方式中,通过对渲染工作消息的监听,利用渲染机制中,当设备完成复杂且耗时的工作后将按照严格的渲染频率来刷新界面的特性(即相邻两个渲染消息之间的间隔为一特定时间间隔的特性),获取到应用界面启动完成的结束时间。
下面对本实施方式的步骤102至步骤104进行具体说明:
步骤102:判断是否监听到渲染工作消息,若是,则执行步骤103,否则继续执行步骤102。
具体地说,终端设备可通过以下方式实现对渲染工作消息的监听:在源程序中,可通过系统的“Choreographer.postFrameCallback()”指令来注册监听渲染工作执行的回调通知。当系统的消息队列已经轮到当前界面的渲染工作消息执行时,系统的 Choreographer.FrameCallback.doFrame()会被回调,将接收到回调通知的时刻,作为监听到的渲染工作消息的时间点。
也就是说,终端设备判断是否监听到渲染工作消息,实际上就是在监听渲染工作是否被执行。若接收到回调通知时则判定渲染工作已执行,即监听到渲染工作消息,此时执行步骤103,记录当前时间点作为监听到的渲染工作消息的时间点;否则继续判断是否监听到渲染工作消息。
步骤104:判断是否出现满足预设条件的渲染工作消息的时间点,若是,则进入步骤105,否则进入步骤102,继续监听下一个渲染工作消息。
本实施方式中的预设条件为渲染工作消息的时间点与后一个的渲染工作消息的时间点的时差为预设时长,其中,预设时长可以为应用程序在运行过程中的相邻两次刷新界面的间隔时长。若终端设备判定当前渲染工作消息的时间点满足预设条件,则表明应用程序已正常运行,无需继续监听渲染工作消息,直接进入步骤105,否则进入步骤102,继续监听。
具体地,可以通过以下方式判断渲染工作消息的时间点是否满足预设条件:
比对记录的最近的两个渲染工作消息的时间点,计算它们的斜率,当计算出最近记录到的时间点已经趋于60帧/秒,也就是两个时间点之间大概间隔16.6ms时,就可以认为当前页面已经处理完复杂的工作任务,那么就可以认为界面已经呈现给用户了。
由于终端设备界面的刷新、呈现都是依赖于渲染机制,都是以一个固定的频率来刷新界面,比如安卓设备,固定以60帧/秒的频率刷新,也就是说正常情况下,应用程序在运行过程中每隔16.6ms会有一个渲染界面的任务被消息携带并放于消息队列中等待执行,若相邻两个渲染工作消息的时间点之间的时差为应用程序在运行过程中的相邻两次刷新界面的间隔时长,则表明该应用程序界面已经绘制完成。首个满足这个条件的时间点,即为应用程序界面绘制完毕且渲染呈现在用户眼前的时间点。
如果相邻两个渲染工作消息的时间点之间的时差并不是应用程序在运行过程中的相邻两次刷新界面的间隔时长,则表明该应用程序界面还未绘制结束,需要继续监听。
步骤105:将满足预设条件的渲染工作消息的时间点作为第二时间点,根据第一时间点和第二时间点,得到应用界面启动时长。
具体地说,由于在步骤102至步骤104中,每一次监听到渲染工作消息时,都会记录当前时间点作为渲染工作消息的时间点,直至得到满足预设条件的渲染工作消息的时间点,该时间点即为应用程序界面绘制完成的时间点,记为第二时间点,表明应用已处于正常可交互情况,不需要再记录更多的时间点了,终端设备不再继续监听渲染工作消息。
由于第一时间点为启动界面指令的发出时刻,第二时间点为程序界面绘制完成的时刻,因此,根据第一时间点和第二时间点,即可得到应用界面启动时长。即,将第一时间点和第二时间点的时差,作为应用界面启动时长。
在具体实现时,可以由终端设备自身实现第一时间点和第二时间点的时差计算,也可以由服务器实现第一时间点和第二时间点的时差计算。例如,终端设备将记录的多个渲染工作消息的时间点,上报至服务器,通过服务器计算第一时间点和第二时间点的时差,从而得到应用界面启动时长。由于记录的渲染工作消息时间点包括了界面渲染的大致时间信息,因此,将记录的多个渲染工作消息的时间点,上报至服务器,还可以方便开发人员分析设备的性能问题。而且,如将记录的多个渲染工作消息的时间点,上报至服务器,则还可以由服务器根据记录的渲染工作消息的时间点,检测是否出现满足预设条件的渲染工作消息的时间,并在检测到出现满足预设条件的渲染工作消息的时间时,通知给终端设备。也就是说,在实际应用中,终端设备还可以根据服务器的通知消息,判断是否出现满足预设条件的渲染工作消息的时间点。
在本实施方式中,通过记录启动界面指令发出的第一时间点作为应用程序界面开始启动的时间;利用渲染机制中,当设备完成复杂且耗时的工作后将按照严格的渲染频率来刷新界面的特性(即相邻两个渲染消息之间的间隔为一特定时间间隔的特性),获取到渲染机制首次按渲染频率刷新界面的时间点作为应用界面启动完成的结束时间,从而根据开始启动的时间和结束时间,即可得到准确的应用界面的启动时长。并且由于这些时间点的记录都是由终端设备操作的,所以可以直接集成在应用程序中,以此达到采集线上用户的大量数据,用例覆盖广的目的,同时不需要专门的测试人员进行大量测试,可以节省人工工作量。
本发明的第二实施方式涉及一种应用界面启动时长的获取方法。第二实施方式与第一实施方式大致相同,主要区别之处在于:在第一实施方式中,在每一次监听到渲染工作消息后,判断是否出现满足预设条件的渲染工作消息的时间点,在出现满足预设条件的渲染工作消息的时间点时,停止渲染工作消息的监听。而在本发明第二实施方式中,持续监听渲染工作消息,直至监听到第N个渲染工作消息;其中,N为预设数值。
本实施方式中的应用界面启动时长的获取方法如图2所示,具体包括以下步骤。
步骤201:终端设备记录启动界面指令发出的第一时间点。
步骤202:判断是否监听到渲染工作消息,若是,则执行步骤203,否则继续执行步骤202。
步骤203:记录当前时间点作为监听到的渲染工作消息的时间点。
至步骤203与第一实施方式的步骤101至步骤103大致相同,为避免重复,此处不再一一赘述。
步骤204:判断监听到的渲染工作消息的个数是否达到N个,若是,则执行步骤205,否则执行步骤202,监听下一个渲染工作消息。
具体地说,N为预设值,具体可设为大于5的数值。在源程序中,终端设备可注册监听渲染工作执行的回调通知。当系统的消息队列已经轮到当前界面的渲染工作消息执行时,会被回调,在这里记录当前时间点,循环这个过程,直到记录了N条渲染工作消息,终端设备不再监听渲染工作消息。在大部分场景下,终端设备应用的界面启动时所处理的工作大多数都是分布在一定帧数内,因此采集预设的N帧内每个渲染消息执行的时间点信息,基本就可以覆盖大部分场景,供开发人员分析性能问题,无需继续监听。
在具体实现时,N可取为10。由于渲染机制当应用处于正常可交互、流畅的情况下,是会严格按照60帧/秒刷新屏幕,而在大部分场景下,应用的界面启动时所处理的工作大多数都是分布在5帧内,因此,N大于5就已经能够覆盖到较多的场景,将N取为10,可进一步保证得到满足条件的渲染工作消息的时间点。当然也可以修改这个数值,但建议是先用10作为基准,然后再收到大量的数据之后,对数据进行分析确认好,再看是否需要进行相应的缩短或增加。
步骤205:从N个渲染工作消息的时间点中得到第二时间点,并根据第一时间点和第二时间,得到应用界面启动时长。
具体地说,终端设备已经记录了N个渲染工作消息的时间点,对这N这时间点逐一判断,若某一渲染工作消息的时间点为首个满足预设条件的时间点作为第二时间点,预设条件为:渲染工作消息的时间点与后一个渲染工作消息的时间点的时差为预设时长(如应用程序在运行过程中的相邻两次刷新界面的间隔时长),第二时间点即为程序界面启动完成的时间点。因此,第一时间点与第二时间点的差值即可作为应用界面启动时长。
以图4所示的监听到的渲染工作消息的时间点为例,图4中的T1-T10为监听到的10个渲染工作消息的时间点,可见,应用界面在启动之后,总共有三个较为耗时的操作,一个是T1-T2耗费了2023ms,一个是T2-T3耗费了1020ms,一个是T3-T4耗时了300ms,之后趋向于正常的渲染频率:16.6ms。那么就可以认为T1-T4的时间:3043ms为该界面的启动时长,开发人员便可以根据这些信息去查找上述耗时的三个操作都是什么任务,是否可以进行优化处理。
上面各种方法的步骤划分,只是为了描述清楚,实现时可以合并为一个步骤或者对某些 步骤进行拆分,分解为多个步骤,只要包括相同的逻辑关系,都在本专利的保护范围内;对算法中或者流程中添加无关紧要的修改或者引入无关紧要的设计,但不改变其算法和流程的核心设计都在该专利的保护范围内。
本发明第三实施方式涉及一种应用界面启动时长的获取装置,如图所示,包括:
记录模块401,用于记录启动界面指令发出的第一时间点;
监听模块402,用于监听渲染工作消息;
记录模块401还用于在监听模块402每一次监听到渲染工作消息时,记录当前时间点作为渲染工作消息的时间点;
应用界面启动时长确定模块403,用于在按时间顺序记录的多个渲染工作消息的时间点中,将首个满足预设条件的渲染工作消息的时间点,作为第二时间点;其中,预设条件为:渲染工作消息的时间点与后一个的渲染工作消息的时间点的时差为预设时长,将第一时间点和第二时间点的时差,作为所述应用界面启动时长。
不难发现,本实施方式为与第一实施方式或第二实施方式相对应的系统实施例,本实施方式可与第一实施方式或第二实施方式互相配合实施。第一实施方式或第二实施方式中提到的相关技术细节在本实施方式中依然有效,为了减少重复,这里不再赘述。相应地,本实施方式中提到的相关技术细节也可应用在第一实施方式中或第二实施方式中。
值得一提的是,本实施方式中所涉及到的各模块均为逻辑模块,在实际应用中,一个逻辑单元可以是一个物理单元,也可以是一个物理单元的一部分,还可以以多个物理单元的组合实现。此外,为了突出本发明的创新部分,本实施方式中并没有将与解决本发明所提出的技术问题关系不太密切的单元引入,但这并不表明本实施方式中不存在其它的单元。
本发明第四实施方式涉及一种终端设备,如图5所示,包括:
至少一个处理器501;以及,
与至少一个处理器501通信连接的存储器502;其中,
存储器502存储有可被至少一个处理器501执行的指令,指令被至少一个处理器501执行,以使至少一个处理器501能够执行上述应用界面启动时长的获取方法。
其中,存储器502和处理器501采用总线方式连接,总线可以包括任意数量的互联的总线和桥,总线将一个或多个处理器501和存储器502的各种电路连接在一起。总线还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路连接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口在总线和收发机之间提供接口。收发机可以是一个元件,也可以是多个元件,比如多个接收器和发送器,提供用于在传输介 质上与各种其他装置通信的单元。经处理器501处理的数据通过天线在无线介质上进行传输,进一步,天线还接收数据并将数据传送给处理器501。
处理器501负责管理总线和通常的处理,还可以提供各种功能,包括定时,外围接口,电压调节、电源管理以及其他控制功能。而存储器502可以被用于存储处理器501在执行操作时所使用的数据。
处理器负责管理总线和通常的处理,还可以提供各种功能,包括定时,外围接口,电压调节、电源管理以及其他控制功能。而存储器可以被用于存储处理器在执行操作时所使用的数据。
本发明第五实施方式涉及一种计算机可读存储介质,存储有计算机程序。计算机程序被处理器执行时实现上述方法实施例。
即,本领域技术人员可以理解,实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
本领域的普通技术人员可以理解,上述各实施方式是实现本发明的具体实施例,而在实际应用中,可以在形式上和细节上对其作各种改变,而不偏离本发明的精神和范围。

Claims (10)

  1. 一种应用界面启动时长的获取方法,其特征在于,包括:
    记录启动界面指令发出的第一时间点;
    监听渲染工作消息;其中,每一次监听到所述渲染工作消息时,记录当前时间点作为所述渲染工作消息的时间点,并在按时间顺序记录的多个所述渲染工作消息的时间点中,将首个满足预设条件的所述渲染工作消息的时间点,作为第二时间点;其中,所述预设条件为:所述渲染工作消息的时间点与后一个所述渲染工作消息的时间点的时差为预设时长;
    将所述第一时间点和所述第二时间点的时差,作为所述应用界面启动时长。
  2. 根据权利要求1所述的应用界面启动时长的获取方法,其特征在于,所述监听渲染工作消息,包括:
    持续监听所述渲染工作消息,直至监听到第N个所述渲染工作消息;其中,所述N为预设数值。
  3. 根据权利要求2所述的应用界面启动时长的获取方法,其特征在于,所述预设数值大于5。
  4. 根据权利要求1所述的应用界面启动时长的获取方法,其特征在于,所述监听渲染工作消息,包括:
    在每一次监听到所述渲染工作消息后,判断是否出现满足所述预设条件的所述渲染工作消息的时间点;
    在出现满足所述预设条件的所述渲染工作消息的时间点时,停止所述渲染工作消息的监听。
  5. 根据权利要求1至4中任一项所述的应用界面启动时长的获取方法,其特征在于,所述记录启动界面指令发出的第一时间点,包括:
    监听应用所有界面的生命周期;
    在接收到所述应用所有界面的生命周期的监听回调通知时,将接收到所述监听回调通知的时间点,记录为所述第一时间点。
  6. 根据权利要求1至4中任一项所述的应用界面启动时长的获取方法,其特征在于,还包括:
    将所述记录的多个所述渲染工作消息的时间点,上报至服务器。
  7. 根据权利要求1至4中任一项所述的应用界面启动时长的获取方法,其特征在于,
    所述预设时长为应用程序在运行过程中的相邻两次刷新界面的间隔时长。
  8. 一种应用界面启动时长的获取装置,其特征在于,包括
    记录模块,用于记录启动界面指令发出的第一时间点;
    监听模块,用于监听渲染工作消息;
    所述记录模块还用于在所述监听模块每一次监听到所述渲染工作消息时,记录当前时间点作为所述渲染工作消息的时间点;
    应用界面启动时长确定模块,用于在按时间顺序记录的多个所述渲染工作消息的时间点中,将首个满足预设条件的所述渲染工作消息的时间点,作为第二时间点;其中,所述预设条件为:所述渲染工作消息的时间点与后一个所述渲染工作消息的时间点的时差为预设时长,将所述第一时间点和所述第二时间点的时差,作为所述应用界面启动时长。
  9. 一种终端设备,其特征在于,包括:
    至少一个处理器;以及,
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如权利要求1至7中任一所述的应用界面启动时长的获取方法。
  10. 一种计算机可读存储介质,存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至7中任一项所述的应用界面启动时长的获取方法。
PCT/CN2018/113732 2018-09-21 2018-11-02 一种应用界面启动时长的获取方法、装置及终端设备 WO2020056878A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US16/769,219 US20210173697A1 (en) 2018-09-21 2018-11-02 Method, apparatus and terminal device for acquiring application interface startup time
EP18933895.7A EP3851966A4 (en) 2018-09-21 2018-11-02 METHOD OF DETERMINING THE START DURATION OF AN APPLICATION INTERFACE, DEVICE AND TERMINAL DEVICE

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811109357.8 2018-09-21
CN201811109357.8A CN109446040B (zh) 2018-09-21 2018-09-21 一种应用界面启动时长的获取方法、装置及终端设备

Publications (1)

Publication Number Publication Date
WO2020056878A1 true WO2020056878A1 (zh) 2020-03-26

Family

ID=65530948

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/113732 WO2020056878A1 (zh) 2018-09-21 2018-11-02 一种应用界面启动时长的获取方法、装置及终端设备

Country Status (4)

Country Link
US (1) US20210173697A1 (zh)
EP (1) EP3851966A4 (zh)
CN (1) CN109446040B (zh)
WO (1) WO2020056878A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114168222A (zh) * 2021-11-29 2022-03-11 北京博睿宏远数据科技股份有限公司 一种启动耗时的获取方法、装置、终端设备和存储介质
US11762939B2 (en) 2021-08-25 2023-09-19 International Business Machines Corporation Measure GUI response time

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112799746A (zh) * 2019-11-14 2021-05-14 青岛海信移动通信技术股份有限公司 通信终端与终端数据的处理方法
CN111177222B (zh) * 2019-12-26 2023-03-03 腾讯云计算(北京)有限责任公司 模型测试方法、装置及计算设备、存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104424092A (zh) * 2013-08-22 2015-03-18 腾讯科技(深圳)有限公司 页面加载时长测试方法及装置
CN105573755A (zh) * 2015-12-15 2016-05-11 北京奇虎科技有限公司 一种应用Activity渲染时间获取方法和装置
CN106897209A (zh) * 2015-12-18 2017-06-27 北京奇虎科技有限公司 一种界面加载时间计算方法和装置
CN107797904A (zh) * 2017-09-12 2018-03-13 福建天晴数码有限公司 一种测量响应时间的方法及终端
CN108196904A (zh) * 2017-12-27 2018-06-22 广州品唯软件有限公司 计算页面响应时长的方法、装置和计算机存储介质

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5452435A (en) * 1993-03-31 1995-09-19 Kaleida Labs, Inc. Synchronized clocks and media players
US7774817B2 (en) * 2001-01-31 2010-08-10 Microsoft Corporation Meta data enhanced television programming
JP2009004010A (ja) * 2007-06-20 2009-01-08 Toshiba Corp 半導体記憶装置およびその駆動方法
US8799769B2 (en) * 2011-02-08 2014-08-05 Ebay Inc. Application above-the-fold rendering measurements
US10068508B2 (en) * 2013-08-30 2018-09-04 Google Llc Measuring user interface performance consistency
US9600400B1 (en) * 2015-10-29 2017-03-21 Vertafore, Inc. Performance testing of web application components using image differentiation
US10165071B2 (en) * 2016-01-15 2018-12-25 Google Llc Client-side activity monitoring
US10331195B2 (en) * 2016-06-06 2019-06-25 Qualcomm Incorporated Power and performance aware memory-controller voting mechanism
CN107741910B (zh) * 2017-10-18 2021-06-29 北京奇虎科技有限公司 应用程序安装性能测试方法、装置、计算设备及存储介质
CN107885645B (zh) * 2017-10-31 2020-06-23 阿里巴巴集团控股有限公司 计算页面首屏渲染时长的方法、装置及电子设备
CN114254222A (zh) * 2021-11-29 2022-03-29 中国平安财产保险股份有限公司 一种统计单页应用的可交互时间的方法、装置及电子设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104424092A (zh) * 2013-08-22 2015-03-18 腾讯科技(深圳)有限公司 页面加载时长测试方法及装置
CN105573755A (zh) * 2015-12-15 2016-05-11 北京奇虎科技有限公司 一种应用Activity渲染时间获取方法和装置
CN106897209A (zh) * 2015-12-18 2017-06-27 北京奇虎科技有限公司 一种界面加载时间计算方法和装置
CN107797904A (zh) * 2017-09-12 2018-03-13 福建天晴数码有限公司 一种测量响应时间的方法及终端
CN108196904A (zh) * 2017-12-27 2018-06-22 广州品唯软件有限公司 计算页面响应时长的方法、装置和计算机存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3851966A4 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11762939B2 (en) 2021-08-25 2023-09-19 International Business Machines Corporation Measure GUI response time
CN114168222A (zh) * 2021-11-29 2022-03-11 北京博睿宏远数据科技股份有限公司 一种启动耗时的获取方法、装置、终端设备和存储介质
CN114168222B (zh) * 2021-11-29 2023-10-17 北京博睿宏远数据科技股份有限公司 一种启动耗时的获取方法、装置、终端设备和存储介质

Also Published As

Publication number Publication date
EP3851966A1 (en) 2021-07-21
US20210173697A1 (en) 2021-06-10
EP3851966A4 (en) 2021-12-22
CN109446040A (zh) 2019-03-08
CN109446040B (zh) 2021-01-22

Similar Documents

Publication Publication Date Title
WO2020056878A1 (zh) 一种应用界面启动时长的获取方法、装置及终端设备
WO2018161622A1 (zh) 一种获取应用卡顿信息的方法及设备
US20170244626A1 (en) Device and settings management platform
US20160242024A1 (en) Purposed device management platform
US9584364B2 (en) Reporting performance capabilities of a computer resource service
WO2018103245A1 (zh) 一种界面卡顿监测方法、装置及可读取存储介质
US9389936B2 (en) Monitoring the responsiveness of a user interface
CN108521353B (zh) 定位性能瓶颈的处理方法、设备及可读存储介质
US9467934B1 (en) Methods and systems for locating nearest bluetooth beacons
WO2021027702A1 (zh) 超宽带定位方法和装置
US11288164B2 (en) Dynamic distributed tracing instrumentation in a microservice architecture
US20140229527A1 (en) Real-time, interactive measurement techniques for desktop virtualization
EP3617889A1 (en) Stutter detection method and device
CN107045475B (zh) 测试方法和装置
US20180165108A1 (en) System and Methods for Utilizing a Script to Instruct a Bluetooth Low Energy Client in Interfacing with a Bluetooth Low Energy Server
WO2017206893A1 (zh) 界面刷新同步方法、装置、终端及存储介质
CN106775620B (zh) 一种定时方法及装置
WO2023246638A1 (zh) 信息处理方法、装置、可穿戴设备和电子设备
US9292401B2 (en) Systems and methods for determining desktop readiness using interactive measures
US10937149B2 (en) Non-transitory computer-readable storage medium for storing comparison program, comparison device, and comparison method
EP2972879A1 (en) Method and system for analyzing a trace timeline of computer system activity
WO2022135014A1 (zh) 绘图流水线调节方法、装置、计算机设备和存储介质
US9514241B1 (en) Consistently delivering a web page having source code with a dynamic instruction
US20220247621A1 (en) Method, apparatus, and system for distributed sensor monitoring and management in a system-on-chip
CN110175263A (zh) 一种定位视频帧的方法、保存视频的方法及终端设备

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: 18933895

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2018933895

Country of ref document: EP

Effective date: 20210415