Method and device for synchronously acquiring response time and frame rate of Android system

By using preset command line tools on Android devices to obtain touch and draw information, generate two-dimensional data diagrams, and directly determine the response time and frame rate, solving the problem of inefficiency in the existing technology, and achieving efficient performance testing and Cost reduction.

CN119311540AActive Publication Date: 2025-01-14镁佳(北京)科技有限公司
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411351557.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-01-14
Estimated Expiration
2044-09-26

AI Technical Summary

Technical Problem

The prior art is inefficient in obtaining the response time and frame rate of Android devices and requires additional external devices, resulting in high equipment costs and low testing efficiency.

Method used

Connect to the host computer through a preset command line tool to obtain the touch information and drawing information of the target Android device, parse this information to generate a two-dimensional data diagram, and determine the response time and frame rate without the need for external devices.

Benefits of technology

Improve the efficiency of performance testing, reduce equipment costs, and the analysis of two-dimensional data graphs can more accurately evaluate the response time and frame rate, helping to locate lag problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119311540A_ABST
    Figure CN119311540A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of performance testing, and discloses a method and a device for synchronously acquiring response time and frame rate of an Android system. The method comprises the following steps: acquiring an Android device list in preset connection with an upper computer, and determining a target Android device based on the Android device list; adopting a preset command line tool to enable the upper computer to obtain touch information and drawing information of the target Android device; the touch information and the drawing information are analyzed, a corresponding two-dimensional data graph is generated in the upper computer, and the response time and the frame rate of a selected data interval in the two-dimensional data graph are determined. According to the method, the touch information and the drawing information are acquired by adopting the preset command line tool in the Android system, so that the response time and the frame rate are determined, intermediate parameters of the Android system do not need to be acquired by virtue of an external device, and the performance test efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of performance testing, and in particular to a method and device for synchronously acquiring response time and frame rate of an Android system. Background Art

[0002] When performing performance testing of user interface (UI) interactions in the Android system, it is necessary to quantify the response time and animation frame rate in order to promote performance optimization by setting standards.

[0003] In the related art, a high frame rate camera is often used to record the screen of an Android device, and an external pressure sensing device is used to record the time points of the touch being pressed and lifted, so as to calculate the response time and frame rate of the Android device. However, there is often a problem of low efficiency in obtaining the calculation results, and a better solution is needed. Summary of the invention

[0004] In view of this, the present invention provides a method and device for synchronously acquiring response time and frame rate of an Android system, so as to solve the problem of low efficiency in acquiring response time and frame rate of an Android device.

[0005] On one hand, the present invention provides a method for synchronously acquiring the response time and frame rate of an Android system, the method comprising acquiring a list of Android devices that are pre-connected to a host computer, and determining a target Android device based on the list of Android devices; using a preset command line tool to enable the host computer to acquire touch information and drawing information of the target Android device; parsing the touch information and the drawing information, generating a corresponding two-dimensional data graph in the host computer, and determining the response time and frame rate of a selected data interval in the two-dimensional data graph.

[0006] On the other hand, the present invention also provides a device for synchronously acquiring the response time and frame rate of an Android system, the device comprising: a first determination module, used to acquire a list of Android devices that are preset connected to a host computer, and determine a target Android device based on the list of Android devices; a second determination module, used to use a preset command line tool to enable the host computer to acquire touch information and drawing information of the target Android device; an acquisition module, used to parse the touch information and the drawing information, generate a corresponding two-dimensional data graph in the host computer, and determine the response time and frame rate of a selected data interval in the two-dimensional data graph.

[0007] On the other hand, the present invention also provides a computer device, which includes: a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor implements the above-mentioned method for synchronously acquiring the response time and frame rate of the Android system by executing the computer instructions.

[0008] On the other hand, the present invention further provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to enable a computer to implement the above-mentioned method for synchronously acquiring the response time and frame rate of the Android system.

[0009] On the other hand, the present invention also provides a computer program product, including computer instructions, which are used to enable a computer to execute the method for synchronously acquiring the response time and frame rate of the Android system of the first aspect or any corresponding embodiment thereof.

[0010] The method for synchronously acquiring the response time and frame rate of the Android system in this embodiment presets the connection between the target Android device and the host computer, so that the host computer uses a preset command line tool to internally acquire the touch information and drawing information of the target Android device, and further determines the response time and frame rate of the target Android device. There is no need to use external devices to acquire the intermediate parameters of the Android system, thereby improving the efficiency of performance testing. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0012] Figure 1 It is a flowchart of a method for synchronously acquiring response time and frame rate of an Android system provided by an embodiment of the present invention;

[0013] Figure 2 It is a schematic diagram of obtaining a layer name of a method for synchronously obtaining response time and frame rate of an Android system provided by an embodiment of the present invention;

[0014] Figure 3 It is a schematic diagram of touch information acquisition of a method for synchronously acquiring response time and frame rate of an Android system provided by an embodiment of the present invention;

[0015] Figure 4 It is a schematic diagram of obtaining drawing information of a method for synchronously obtaining response time and frame rate of an Android system provided by an embodiment of the present invention;

[0016] Figure 5 It is a schematic diagram of a two-dimensional data graph of a method for synchronously acquiring response time and frame rate of an Android system provided by an embodiment of the present invention;

[0017] Figure 6It is a schematic diagram of a calculation result interface of a method for synchronously acquiring response time and frame rate of an Android system provided by an embodiment of the present invention;

[0018] Figure 7 It is a flowchart of another method for synchronously acquiring response time and frame rate of an Android system provided by an embodiment of the present invention;

[0019] Figure 8 is a structural schematic diagram of a device for synchronously acquiring response time and frame rate of an Android system provided by an embodiment of the present invention;

[0020] Fig. 9 It is a structural schematic diagram of another device for synchronously acquiring response time and frame rate of an Android system provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0021] When performing performance testing of UI interactions in the Android system, it is necessary to quantify the response time and frame rate of animation effects in order to set standards to promote performance optimization and improve user experience. The current commonly used objective acquisition method is to record the screen with a high frame rate camera (more than 120 frames) and use an external pressure sensing device to record the time points of touch pressing and lifting. Then, combine the frame disassembly and image recognition of the video to set the time point when the action is completed. Compare this end time with the start time of the touch (press or lift) to calculate the response time. At the same time, analyze the frame rate of the interactive animation by the number of frames of the same screen in the video and the fixed frame rate of the camera. In addition, performance data can also be collected by setting the tracking point location in the code.

[0022] However, the above technology may have the following problems:

[0023] 1. Obtaining intermediate data of performance testing through external means such as camera recording and external pressure sensing equipment results in low efficiency;

[0024] 2. It requires additional devices such as cameras and external pressure sensing equipment, which results in high equipment costs.

[0025] To solve at least one of the above problems, various embodiments of the present invention provide a method for synchronously acquiring the response time and frame rate of an Android system, including: acquiring a list of Android devices that are preset connected to a host computer, and determining a target Android device based on the list of Android devices; using a preset command line tool to enable the host computer to acquire touch information and drawing information of the target Android device; parsing the touch information and drawing information, generating a corresponding two-dimensional data graph in the host computer, and determining the response time and frame rate of a selected data interval in the two-dimensional data graph.

[0026] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0027] According to an embodiment of the present invention, a method for synchronously acquiring response time and frame rate of an Android system is provided. Figure 1 is a flow chart of a method for synchronously acquiring response time and frame rate of an Android system provided by an embodiment of the present invention, such as Figure 1 As shown, the process includes the following steps:

[0028] Step S101, obtaining a list of Android devices that are pre-connected to the host computer, and determining a target Android device based on the list of Android devices;

[0029] Step S102, using a preset command line tool to enable the host computer to obtain touch information and drawing information of the target Android device;

[0030] Step S103, analyzing the touch information and the drawing information, generating a corresponding two-dimensional data graph in the host computer, and determining the response time and frame rate of the selected data interval in the two-dimensional data graph.

[0031] In a possible implementation, the upper computer may refer to a computer or device responsible for control and management, and is used for communicating and processing data with the lower computer.

[0032] Specifically, the host computer may refer to a computer terminal, and the slave computer may refer to an Android device that is pre-connected to the host computer.

[0033] In a possible implementation, the preset connection may refer to an Android Debug Bridge (ABD) connection, and the list of Android devices connected to the host computer through ADB may include, but is not limited to: device identification (ID) and device status.

[0034] Among them, the ADB connection can refer to a communication channel established between a computer and an Android device through an ADB tool; the ADB tool can be a multi-functional command line tool that can be used for device management, data transmission, command execution and remote debugging.

[0035] Furthermore, the list of Android devices connected to the host computer through ADB can be queried through ADB commands; for example, all Android devices connected to the computer and their corresponding status can be obtained through the command "adb devices".

[0036] Furthermore, the preset command line tool may refer to an ABD tool.

[0037] In a possible implementation, a preset command line tool is used to enable the host computer to obtain touch information and drawing information of the target Android device, including:

[0038] An ADB tool is run in the host computer, and a first ADB command is used to enable the host computer to obtain touch information of the target Android device, and a second ADB command is used to enable the host computer to obtain drawing information of the target Android device.

[0039] Among them, touch information may refer to the touch event data of the user on the screen of the target Android device, which may include but is not limited to touch action, touch position, time, number of fingers, etc.; drawing information may refer to the relevant data when drawing graphics or interfaces on the target Android device.

[0040] In a possible implementation, the touch information and the drawing information are parsed, a corresponding two-dimensional data graph is generated in a host computer, and a response time and a frame rate of a selected data interval in the two-dimensional data graph are determined, including:

[0041] After the host computer obtains the touch information and the drawing information, it formats the touch information and the drawing information, stores the formatting result in a preset data structure, constructs a two-dimensional data graph by calling the data in the preset data structure, and further determines the response time and frame rate of the selected data interval.

[0042] Among them, response time can refer to the time delay from the occurrence of a user touch event to the completion of device processing, and frame rate can refer to the animation frame rate, that is, the number of times the interface animation or visual effect is refreshed or updated per second during the user interface interaction process, and the unit can be frames per second (Frames Per Second, FPS).

[0043] Through the above method, the target Android device is connected to the host computer through ADB, and the touch information and drawing information of the target Android device are obtained using ADB commands, and the response time and frame rate of the target Android device are further determined. There is no need to use external devices such as cameras to obtain the intermediate parameters of the Android system, thereby improving the efficiency of performance testing and reducing the equipment cost of performance testing.

[0044] In a specific embodiment, the preset connection includes a physical connection and a network connection; wherein,

[0045] When the preset connection is a physical connection, the Android device in the Android device list is connected to the host computer via a data cable;

[0046] When the preset connection is a network connection, the Android devices in the Android device list enable the preset network configuration and connect to the host computer through the same network.

[0047] Specifically, turn on the Universal Serial Bus (USB) debugging function of the target Android device, and connect it to the host computer via a USB data cable. At this time, the connection between the target Android device and the host computer is a physical connection. If the host computer can obtain the target Android device through the command "adb devices", it indicates that the connection is successful; put the target Android device and the host computer in the same network, obtain the device Internet Protocol (IP) address of the target Android device, and connect to the IP address of the target Android device through the "adb connect" command in the host computer. If the host computer can obtain the target Android device through the command "adb devices", it indicates that the connection is successful. At this time, the connection between the target Android device and the host computer is a network connection.

[0048] Among them, USB debugging can refer to a mode in which when a computer and an Android device are connected, communication is performed between the computer and the Android device to achieve data transmission.

[0049] Through the above method, the target Android device only needs to support USB debugging, which improves the versatility of UI testing; operations such as enabling USB debugging and connecting via IP address can be automatically performed in the background, reducing human intervention and thus improving efficiency.

[0050] In a specific embodiment, a preset command line tool is used to enable the host computer to obtain touch information and drawing information of the target Android device, including:

[0051] Use the preset Android service tool to obtain the layer name of the target Android device;

[0052] Using a first preset command line tool, acquiring touch information of a target Android device; the touch information includes at least one of the following: press time, lift time, and system boot time;

[0053] A second preset command line tool is used to obtain drawing information corresponding to the layer names of the target Android device; the drawing information includes at least one of the following: a vertical synchronization interval, a vertical synchronization time, a frame start preparation time, and a frame completion preparation time.

[0054] In a possible implementation, a preset Android service tool is used to obtain the layer name of the target Android device, including:

[0055] Use Android's SurfaceFlinger service to get the layer name of the target Android device.

[0056] Among them, the SurfaceFlinger service can be a key service in the Android system, which is used to manage the layers in all applications and system interfaces and combine the layers into an image that is finally displayed on the screen.

[0057] For example, the command line using the SurfaceFlinger service can be as follows:

[0058] adb -s device number shell

[0059] dumpsys SurfaceFlinger|grep "Output Layer"

[0060] Among them, adb-s device number can represent the specified Android device to be operated, shell can indicate that the following command will be executed in the terminal (shell) of the target Android device; dumpsys can be a tool in the Android system that can be used to obtain the status information of system services, and SurfaceFlinger can be the service we want to obtain; grep "OutputLayer" can represent the use of the grep command to filter the output content of dumpsys and only display the line containing "Output Layer". The output will contain detailed information of each layer, and the part in brackets is the layer name.

[0061] For example, the target Android device layer name can be obtained as follows Figure 2 As shown, Figure 2 It is a schematic diagram of obtaining a layer name of a method for synchronously obtaining response time and frame rate of an Android system provided by an embodiment of the present invention.

[0062] In a possible implementation, using a first preset command line tool to obtain touch information of a target Android device includes:

[0063] Use the getevent-lt command to obtain the touch information of the target Android device.

[0064] The getevent-lt command is used to obtain the input event information of the device, the -l flag displays the event type name, and the -t flag displays the timestamp of the added time.

[0065] For example, the acquired touch information can be as follows: Figure 3 As shown, Figure 3 is a schematic diagram of touch information acquisition of a method for synchronously acquiring response time and frame rate of an Android system provided by an embodiment of the present invention, wherein:

[0066] DOWN can represent the acquired press event, UP can represent the acquired lift event, and the time uptime in the brackets can be represented, that is, the boot time of the target Android device. The uptime here can be accurate to microseconds.

[0067] In a possible implementation, a second preset command line tool is used to obtain drawing information corresponding to the layer names of the target Android device, including:

[0068] Based on the layer name of the target Android device, use the dumpsys SurfaceFlinger-latency command to obtain the drawing information corresponding to the layer name.

[0069] For example, the acquired drawing information can be as follows: Figure 4 As shown, Figure 4 It is a schematic diagram of obtaining drawing information of a method for synchronously obtaining response time and frame rate of an Android system provided by an embodiment of the present invention.

[0070] Among them, the first row of data obtained can refer to the vertical synchronization (vsync) interval; the following 127 rows of data can refer to the 127 frames of historical data corresponding to the layer name of the target Android device. When there are less than 127 frames, 127 rows of data can be padded with 0; each frame of the 127 frames of data has 3 columns, among which the first column is the time of the next screen hardware vertical synchronization (Hardware Vertical Synchronization Time, HW-VSYNC), the second column is the moment when the frame is actually displayed on the screen, and the third column is the moment when the frame is finished drawing and ready to be displayed on the screen.

[0071] Specifically, the vsync interval can represent the display interval of each frame. The system synchronizes the drawing and display of the frame according to the above interval. The vsync interval can be calculated by dividing 1000000000 by the screen frame rate, where 1000000000 is in the form of nanoseconds of 1 second. The screen frame rate can refer to the default screen frame rate of the target Android device, for example, it can include but is not limited to 60 frames, 90 frames or 120 frames, etc.; the HW-VSYNC time can be the time point when the hardware notifies the system that it can start preparing to draw the next frame, and the system starts image processing after receiving the signal; the moment when the frame is actually displayed on the screen can indicate the time when the screen refreshes to this frame of image, that is, the image has been rendered and sent to the screen; the moment when the frame is drawn and ready to be displayed on the screen indicates that the image processing of the frame has been completed, waiting for the next VSYNC signal to arrive to display the frame.

[0072] Through the above method, the touch information and corresponding drawing information of the target Android device can be quickly obtained through the preset command line tool, which reduces the reliance on manual operations and complex tools and improves the efficiency of data collection. The SurfaceFlinger service of the Android system is used to accurately obtain the layer name and the corresponding drawing information, so that the frame rate statistics in dynamic application scenarios such as videos and games are more accurate and layered, which is suitable for data analysis of multi-window scenarios. By combining touch information with layer drawing data, the response time and frame rate performance of the system can be accurately analyzed, which is particularly suitable for UI performance testing and optimization, and helps to locate freeze problems.

[0073] In a specific embodiment, the drawing information further includes frame preparation time, where the frame preparation time is the difference between the frame completion preparation time and the frame start preparation time.

[0074] Specifically, the frame completion time is the moment when the frame in the third column is finished drawing and is ready to be displayed on the screen, and the frame start preparation time is the HW-VSYNC time in the first column. The frame preparation time represents the length of the frame from the start of preparation to the completion of preparation.

[0075] Furthermore, when the frame preparation time is greater than the vsync interval, the frame cannot be displayed on the screen within the current vsync period, resulting in frame drops and affecting visual smoothness.

[0076] Through the above method, by determining the frame preparation time, the drawing efficiency of each frame can be intuitively reflected, so as to find the performance bottleneck in the UI interface or application rendering, so as to perform targeted optimization.

[0077] In a specific embodiment, the touch information and the drawing information are parsed, a corresponding two-dimensional data graph is generated in the host computer, and the response time and frame rate of the selected data interval in the two-dimensional data graph are determined, which is implemented based on the following steps:

[0078] The host computer is made to parse the touch information and drawing information, and the device boot time is used as the horizontal axis coordinate of the two-dimensional data graph, the frame preparation time is used as the left vertical axis coordinate of the two-dimensional data graph, and the press event and the lift event are used as the right vertical axis coordinate of the two-dimensional data graph;

[0079] The vertical synchronization interval is used as the first horizontal reference line, and twice the vertical synchronization interval is used as the second horizontal reference line;

[0080] Based on the horizontal axis coordinate, the left vertical axis coordinate, the right vertical axis coordinate, the first horizontal reference line and the second horizontal reference line, construct a two-dimensional data graph corresponding to the touch information and the drawing information, and display the two-dimensional data graph on the host computer;

[0081] The click information in the two-dimensional data graph is obtained, and a selected data interval corresponding to the click information is determined based on a preset rule, and a response time and a frame rate corresponding to the selected data interval are determined.

[0082] In a possible implementation, a third preset command line tool is used to enable the host computer to obtain touch information and drawing information, including:

[0083] Specifically, the display form of the two-dimensional data graph can be as follows: Figure 5 As shown, Figure 5 : is a schematic diagram of a two-dimensional data graph of a method for synchronously acquiring response time and frame rate of an Android system provided by an embodiment of the present invention, wherein:

[0084] The uptime obtained by the getevent-lt command is used as the horizontal axis coordinate of the two-dimensional data graph, the calculated frame preparation time is used as the left vertical axis coordinate, the press event is represented as 1, and the lift event is represented as 2 as the right vertical axis coordinate, one times the vsync interval (i.e. vsync 1) is used as the first horizontal reference line, and two times the vsync interval (i.e. vsync 2) is used as the second horizontal reference line.

[0085] Furthermore, the obtained frame preparation time of the target Android device is used as a bar chart in a two-dimensional data graph, using the left vertical axis coordinate; the press event and the lift event are used as discrete points in the two-dimensional data graph, using the right vertical axis coordinate.

[0086] It is worth noting that Figure 5 The two-dimensional data graph format is not the only one. It is just an example. The details can be set according to the needs.

[0087] Depend on Figure 5 It can be seen that when a press event and a lift event are detected, the system will draw an animation of a preset number of frames, which is reflected in the figure as a bar chart with a preset number of press events and lift events; when the height of the bar chart (that is, the frame preparation time of the frame) is higher than the vsync 1 reference line, the frame animation cannot be displayed at the current VSYNC moment, and must wait for the next vsync signal (that is, vsync 2) to arrive, resulting in frame loss.

[0088] Through the above method, by mapping the touch information and the drawing information to a two-dimensional data graph, the user can intuitively see the association between the touch event and the frame drawing, which is convenient for analyzing the response time of the interactive operation and the animation frame rate; by setting the first and second horizontal reference lines, the user can more easily find the situation where the frame preparation time exceeds the vertical synchronization interval, thereby identifying problems such as frame rate drop, screen freeze or frame loss; the user can click on a specific point or area in the two-dimensional data graph to automatically select the relevant data interval according to preset rules, which not only improves the efficiency of data analysis, but also reduces the errors that may occur when the user manually selects data.

[0089] In a specific embodiment, obtaining click information in a two-dimensional data graph and determining a selected data interval corresponding to the click information based on a preset rule includes:

[0090] When the click object represented by the click information is a press event or a lift event in the two-dimensional data graph, the first timestamp corresponding to the press event or the lift event in the two-dimensional data graph is used as the first start frame, and the first frame after the start frame with an interval greater than a preset time between two consecutive frames is used as the first end frame;

[0091] Using the area between the first start frame and the first end frame as the first selected data interval;

[0092] When the click object represented by the click information is a specific frame in the two-dimensional data graph, the second timestamp of the press event or lift event before the specific frame and closest to the specific frame in the two-dimensional data graph is used as the second start frame, and the last frame of the continuous drawing area after the specific frame is used as the second end frame;

[0093] The area between the second start frame and the second end frame is used as the second selected data interval.

[0094] In a possible implementation, the first selected data interval or the second selected data interval is displayed in a highlighted form in the two-dimensional data graph; the preset time may be 0.5 seconds.

[0095] Furthermore, by determining the first selected data interval or the second selected data interval, it is ensured that the drawing frames within the data interval are valid frames, that is, the above-mentioned drawing frames can be directly observed by the user's eyes. By counting the preparation time and display time of these frames, the flow degree of the motion effect can be evaluated.

[0096] Wherein, determination of the valid frame is related to the user's touch information, and the first selected data interval or the second selected data interval is always relative to the user's input, so that the frame in the first selected data interval or the second selected data interval can directly reflect the user's interactive behavior;

[0097] Secondly, in the first selected data interval, the frame interval being greater than the preset time is used as a sign of interval selection, which means that the user interaction may have an obvious pause in this time period. The above pause indicates that the frames in this time period may not be directly perceived by the user, so these frames are regarded as invalid frames.

[0098] Through the above method, by limiting the time interval between frames, it is ensured that the frames in the selected area can form a continuous animation process, making the user's visual experience smoother; the area between the start frame and the end frame is selected so that the calculation result can cover the effective drawing frames, which are directly related to the user's actual experience and help evaluate the smoothness and responsiveness of the motion effect.

[0099] In a specific embodiment, determining the response time and frame rate corresponding to the selected data interval includes:

[0100] Determine the first frame time and the last frame time corresponding to the selected data interval, and determine the time from pressing to the first frame and the time from lifting to the first frame corresponding to the selected data interval based on the first frame time and the touch information, and determine the time from pressing to the last frame and the time from lifting to the last frame corresponding to the selected data interval based on the last frame time and the touch information;

[0101] Based on the drawing information in the selected data interval, the frame rate, maximum freeze time, number of frames and frame interval distribution corresponding to the selected data interval are determined.

[0102] In one possible implementation, the first frame time represents the timestamp of the first frame in the selected data interval, which is used to indicate the starting point of the interval; the last frame time represents the timestamp of the last frame in the selected data interval, which represents the end point of the interval; the press-to-first frame time represents the interval between the time when the user touches the screen and the first frame time of the interval, which indicates the time when the system starts drawing after the user's operation; the lift-to-first frame time represents the interval between the time when the user releases the screen and the first frame time of the interval, which indicates the drawing delay after releasing; the press-to-last frame time represents the interval between the time when the user touches the screen and the last frame time of the interval, which indicates the time from the user's operation to the completion of the last frame of the interval; the lift-to-last frame time represents the interval between the time when the user releases the screen and the last frame time, which indicates the completion of the drawing of the interval after releasing.

[0103] Among them, the time from pressing to the first frame can be the first frame time-pressing time, the time from lifting to the first frame can be the first frame time-lifting time, the time from pressing to the last frame can be the last frame time-pressing time, and the time from lifting to the last frame can be the last frame time-lifting time.

[0104] Furthermore, the frame rate can be the total number of frames divided by the total time difference, and the total time difference can be the last frame time minus the first frame time; the maximum freeze time can represent the maximum time interval between two adjacent frames in the selected data interval; and the frame interval distribution can represent the distribution of time intervals between adjacent frames.

[0105] Exemplarily, the intervals of the frame interval distribution may include, but are not limited to: (vsync,∞), [100,∞), [50,100), [40,50).

[0106] Among them, (vsync,∞) can represent the case where the frame interval is greater than the vertical synchronization interval (vsync), [100,∞) can represent the case where the frame interval is greater than or equal to 100ms, [50,100) can represent the case where the frame interval is between 50ms and 100ms, and [40,50) can represent the case where the frame interval is between 40ms and 50ms.

[0107] In a possible implementation, the time from press to first frame, the time from lift to first frame, the time from press to last frame, the time from lift to last frame, the frame rate, the maximum freeze time, the number of frames and the distribution of frame intervals are the calculation result sets corresponding to the selected data interval, and can be displayed all at once in a display such as Figure 6 The calculation results interface is shown.

[0108] Figure 6 It is a schematic diagram of a calculation result interface of a method for synchronously acquiring response time and frame rate of an Android system provided in an embodiment of the present invention, wherein the calculation result set in the calculation result interface can be selectively stored or exported in the form of a report according to needs.

[0109] Through the above method, there is no need to take the average multiple times for the same use case, and the post-processing data calculation and statistical recording can be performed continuously; the response time and animation frame rate are calculated once, and the data is recorded on demand. While paying attention to the response time, the smoothness and jamming are also paid attention to; the data graph interactively completes the response time, frame rate, and frame interval distribution statistical calculation of a single operation, and completes multi-dimensional calculation of the same set of data, thereby improving the efficiency of obtaining performance data results.

[0110] For example, Figure 7 is a flow chart of another method for synchronously acquiring response time and frame rate of an Android system provided by an embodiment of the present invention, such as Figure 7 As shown, the figure includes the following steps:

[0111] Step S701, obtaining a list of Android devices;

[0112] Here, use the command "adb devices" to obtain all Android devices connected to the computer and their corresponding status;

[0113] Step S702, determining the target Android device;

[0114] Here, determine the target Android device in the Android device list;

[0115] Step S703, obtaining the layer name;

[0116] Here, the Android SurfaceFlinger service is used to obtain the layer name of the target Android device;

[0117] Step S704, acquiring touch information and drawing information;

[0118] Here, the getevent-lt command is used to obtain the touch information of the target Android device, and the dumpsysSurfaceFlinger-latency command is used to obtain the drawing information corresponding to the layer name;

[0119] Step S705, two-dimensional data graph interaction;

[0120] Here, the click information in the two-dimensional data graph is obtained, and the selected data interval corresponding to the click information is determined based on a preset rule;

[0121] Step S706, recording data;

[0122] Here, the calculated time from pressing to the first frame, time from lifting to the first frame, time from pressing to the last frame, time from lifting to the last frame, frame rate, maximum freeze time, number of frames and frame interval distribution are recorded;

[0123] Step S707, determine whether all use cases have been used up, if so, go to step S709, if not, go back to step S703;

[0124] Here, determine whether the data corresponding to all use cases are calculated;

[0125] Step S708, determining a calculation result set;

[0126] Here, the time from press to first frame, time from lift to first frame, time from press to last frame, time from lift to last frame, frame rate, maximum freeze time, number of frames and frame interval distribution are taken as the calculation result set corresponding to the selected data interval, and all of them can be displayed at once in the following table: Figure 6 On the calculation result interface shown;

[0127] Step S709, determine whether to export the report; if so, proceed to step S710, if not, directly end step S710 and save the report.

[0128] Figure 8 is a structural diagram of a device for synchronously acquiring response time and frame rate of an Android system provided by an embodiment of the present invention, such as Figure 8 As shown, the device can be applied to intelligent electronic devices such as servers and computers; the device includes: a first determination module 801, a second determination module 802 and an acquisition module 803;

[0129] The first determination module 801 is used to obtain a list of Android devices that are pre-connected to the host computer, and determine the target Android device based on the list of Android devices;

[0130] The second determination module 802 is used to use a preset command line tool to enable the host computer to obtain touch information and drawing information of the target Android device;

[0131] The acquisition module 803 is used to analyze the touch information and the drawing information, generate a corresponding two-dimensional data graph in the host computer, and determine the response time and frame rate of the selected data interval in the two-dimensional data graph.

[0132] In a specific embodiment, the preset connection includes a physical connection and a network connection; wherein,

[0133] When the preset connection is a physical connection, the Android device in the Android device list is connected to the host computer via a data cable;

[0134] When the preset connection is a network connection, the Android devices in the Android device list enable the preset network configuration and connect to the host computer through the same network.

[0135] In a specific embodiment, the second determining module 802 is used to obtain the layer name of the target Android device using a preset Android service tool;

[0136] Using a first preset command line tool, acquiring touch information of a target Android device; the touch information includes at least one of the following: press time, lift time, and system boot time;

[0137] A second preset command line tool is used to obtain drawing information corresponding to the layer names of the target Android device; the drawing information includes at least one of the following: a vertical synchronization interval, a vertical synchronization time, a frame start preparation time, and a frame completion preparation time.

[0138] In a specific embodiment, the drawing information further includes frame preparation time, where the frame preparation time is the difference between the frame completion preparation time and the frame start preparation time.

[0139] In a specific embodiment, the acquisition module 803 is used to enable the host computer to parse the touch information and the drawing information, use the device boot time as the horizontal axis coordinate of the two-dimensional data graph, use the frame preparation time as the left vertical axis coordinate of the two-dimensional data graph, and use the press event and the lift event as the right vertical axis coordinate of the two-dimensional data graph;

[0140] The vertical synchronization interval is used as the first horizontal reference line, and twice the vertical synchronization interval is used as the second horizontal reference line;

[0141] Based on the horizontal axis coordinate, the left vertical axis coordinate, the right vertical axis coordinate, the first horizontal reference line and the second horizontal reference line, construct a two-dimensional data graph corresponding to the touch information and the drawing information, and display the two-dimensional data graph on the host computer;

[0142] The click information in the two-dimensional data graph is obtained, and a selected data interval corresponding to the click information is determined based on a preset rule, and a response time and a frame rate corresponding to the selected data interval are determined.

[0143] In a specific embodiment, the acquisition module 803 is used to, when the click object represented by the click information is a press event or a lift event in the two-dimensional data graph, use the first timestamp corresponding to the press event or the lift event in the two-dimensional data graph as the first start frame, and use the first frame after the start frame where the interval between two consecutive frames is greater than a preset time as the first end frame;

[0144] Using the area between the first start frame and the first end frame as the first selected data interval;

[0145] When the click object represented by the click information is a specific frame in the two-dimensional data graph, the second timestamp of the press event or lift event before the specific frame and closest to the specific frame in the two-dimensional data graph is used as the second start frame, and the last frame of the continuous drawing area after the specific frame is used as the second end frame;

[0146] The area between the second start frame and the second end frame is used as the second selected data interval.

[0147] In a specific embodiment, the acquisition module 803 is used to determine the first frame time and the last frame time corresponding to the selected data interval, and determine the press-to-first frame time and the lift-to-first frame time corresponding to the selected data interval based on the first frame time and the touch information, and determine the press-to-last frame time and the lift-to-last frame time corresponding to the selected data interval based on the last frame time and the touch information;

[0148] Based on the drawing information in the selected data interval, the frame rate, maximum freeze time, number of frames and frame interval distribution corresponding to the selected data interval are determined.

[0149] It should be noted that: the device for synchronously acquiring the response time and frame rate of the Android system provided in the above embodiment only uses the division of the above program modules as an example to illustrate when implementing the corresponding method for synchronously acquiring the response time and frame rate of the Android system. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program modules to complete all or part of the above-described processing. In addition, the device provided in the above embodiment and the corresponding Figure 1 The embodiments of the method shown belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be repeated here.

[0150] The embodiment of the present invention also provides a computer device having the above Figure 8 The Android system response time and frame rate synchronization acquisition device shown.

[0151] See also Fig. 9 , Fig. 9 is a schematic diagram of the structure of another device for synchronously acquiring response time and frame rate of an Android system provided by an embodiment of the present invention, such as Fig. 9 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig. 9 A processor 10 is taken as an example.

[0152] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0153] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0154] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0155] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0156] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Fig. 9 The example of connecting through bus is taken in the following.

[0157] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0158] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0159] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0160] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0161] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for synchronously acquiring response time and frame rate of an Android system, characterized in that: The method comprises: Obtain a list of Android devices that are pre-connected to the host computer, and determine a target Android device based on the list of Android devices; Using a preset command line tool, the host computer obtains touch information and drawing information of the target Android device; The touch information and the drawing information are analyzed, a corresponding two-dimensional data graph is generated in the host computer, and a response time and a frame rate of a selected data interval in the two-dimensional data graph are determined.

2. The method according to claim 1, characterized in that The preset connection includes a physical connection and a network connection; wherein, When the preset connection is the physical connection, the Android device in the Android device list is connected to the host computer via a data cable; When the preset connection is the network connection, the Android devices in the Android device list are enabled with the preset network configuration, and connected to the host computer through the same network.

3. The method according to claim 2, characterized in that The use of a preset command line tool to enable the host computer to obtain the touch information and drawing information of the target Android device includes: Use the preset Android service tool to obtain the layer name of the target Android device; Using a first preset command line tool, acquiring touch information of the target Android device; the touch information includes at least one of the following: press time, lift time and system boot time; A second preset command line tool is used to obtain drawing information corresponding to the layer names of the target Android device; the drawing information includes at least one of the following: a vertical synchronization interval, a vertical synchronization time, a frame start preparation time, and a frame completion preparation time.

4. The method according to claim 3, characterized in that The drawing information also includes frame preparation time, where the frame preparation time is the difference between frame completion preparation time and frame start preparation time.

5. The method according to claim 4, characterized in that Parsing the touch information and the drawing information, generating a corresponding two-dimensional data graph in the host computer, and determining the response time and frame rate of a selected data interval in the two-dimensional data graph is achieved based on the following steps: The host computer is enabled to parse the touch information and the drawing information, and the device startup time is used as the horizontal axis coordinate of the two-dimensional data graph, the frame preparation time is used as the left vertical axis coordinate of the two-dimensional data graph, and the press event and the lift event are used as the right vertical axis coordinate of the two-dimensional data graph; The vertical synchronization interval is used as the first horizontal reference line, and twice the vertical synchronization interval is used as the second horizontal reference line; constructing a two-dimensional data graph corresponding to the touch information and the drawing information based on the horizontal axis coordinate, the left vertical axis coordinate, the right vertical axis coordinate, the first horizontal reference line, and the second horizontal reference line, and displaying the two-dimensional data graph on the host computer; The click information in the two-dimensional data graph is obtained, a selected data interval corresponding to the click information is determined based on a preset rule, and a response time and a frame rate corresponding to the selected data interval are determined.

6. The method according to claim 5, characterized in that The acquiring the click information in the two-dimensional data graph and determining the selected data interval corresponding to the click information based on a preset rule includes: When the click object represented by the click information is a press event or a lift event in a two-dimensional data graph, a first timestamp corresponding to the press event or the lift event in the two-dimensional data graph is used as a first start frame, and a first frame after the start frame where the interval between two consecutive frames is greater than a preset time is used as a first end frame; Using the area between the first start frame and the first end frame as a first selected data interval; When the click object represented by the click information is a specific frame in the two-dimensional data graph, in the two-dimensional data graph, the second timestamp of the press event or lift event before the specific frame and closest to the specific frame is used as the second start frame, and the last frame of the continuous drawing area after the specific frame is used as the second end frame; An area between the second start frame and the second end frame is used as a second selected data interval.

7. The method according to claim 5, characterized in that The determining the response time and frame rate corresponding to the selected data interval includes: Determine the first frame time and the last frame time corresponding to the selected data interval, and determine the press-to-first frame time and the lift-to-first frame time corresponding to the selected data interval based on the first frame time and the touch information, and determine the press-to-last frame time and the lift-to-last frame time corresponding to the selected data interval based on the last frame time and the touch information; Based on the drawing information in the selected data interval, the frame rate, maximum freeze time, number of frames and frame interval distribution corresponding to the selected data interval are determined.

8. A device for synchronously acquiring response time and frame rate of an Android system, characterized in that: The device comprises: A first determination module is used to obtain a list of Android devices that are pre-connected to the host computer, and determine a target Android device based on the list of Android devices; A second determination module is used to use a preset command line tool to enable the host computer to obtain touch information and drawing information of the target Android device; The acquisition module is used to parse the touch information and the drawing information, generate a corresponding two-dimensional data graph in the host computer, and determine the response time and frame rate of the selected data interval in the two-dimensional data graph.

9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for synchronously acquiring the response time and frame rate of the Android system according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for synchronously acquiring the response time and frame rate of the Android system according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Touch screen response performance test platform and method

    CN107346274A

  • Method and device for acquiring frame rate through Android debugging bridge command and computer readable storage medium

    CN115982020A

  • Information processing method and electronic device

    WO2021057830A1

  • Data acquiring method, device, terminal, and storage medium

    WO2021249308A1