A method and device for synchronously obtaining the response time and frame rate of an Android system

By establishing a connection with an Android device through the host computer, using command line tools to obtain and parse touch and draw information to generate two-dimensional data diagrams, solving the problem of inefficiency in the existing technology, and achieving efficient acquisition of the response time and frame rate of Android devices, reducing costs.

CN119311540BActive Publication Date: 2025-07-29镁佳(北京)科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411351557.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-07-29
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 the use of external devices to cause higher equipment costs.

Method used

Establish a preset connection with the Android device through the host computer, use the preset command line tool to obtain the touch information and drawing information of the target Android device, and parse this information to generate a two-dimensional data diagram to determine the response time and frame rate.

Benefits of technology

The response time and frame rate of Android devices can be quickly obtained without the help of external devices, improving performance testing efficiency and reducing device costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119311540B_ABST
    Figure CN119311540B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of performance testing, and discloses a method and device for synchronously obtaining the response time and frame rate of an Android system. The present invention discloses obtaining a list of Android devices preset to be 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 obtain the 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. The present invention uses a preset command-line tool inside the Android system to obtain the touch information and drawing information, thereby determining the response time and frame rate, without relying on an external device to obtain the intermediate parameters of the Android system, thus improving the efficiency of performance testing.
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 particularly relates to a method and device for synchronously obtaining the response time and frame rate of an Android system. Background Art

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

[0003] In related technologies, 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 touch-down and touch-up time points. In this way, the response time and frame rate of the Android device are calculated. 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 obtaining the response time and frame rate of an Android system to solve the problem of low efficiency in obtaining the corresponding time and frame rate for an Android device.

[0005] On the one hand, the present invention provides a method for synchronously obtaining the response time and frame rate of an Android system. The method includes obtaining a list of Android devices presetly 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 obtain 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 obtaining the response time and frame rate of an Android system. The device includes: a first determination module for obtaining a list of Android devices presetly connected to a host computer and determining a target Android device based on the list of Android devices; a second determination module for using a preset command-line tool to enable the host computer to obtain touch information and drawing information of the target Android device; an obtaining module for 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.

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

[0008] On the other hand, the present invention also 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 method for synchronously obtaining the response time and frame rate of an 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 obtaining the response time and frame rate of an Android system according to the first aspect or any corresponding embodiment thereof described above.

[0010] In the method for synchronously obtaining the response time and frame rate of the Android system in this embodiment, the target Android device is preset-connected to the host computer, and the host computer uses a preset command-line tool to internally obtain the touch information and drawing information of the target Android device, and further determine the response time and frame rate of the target Android device, without relying on an external device to obtain the intermediate parameters of the Android system, thereby improving the efficiency of performance testing. Description of the Drawings

[0011] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in related technologies, the following will briefly introduce the drawings required for use in the description of the specific embodiments or related technologies. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

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

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

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

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

[0016] Figure 5 is a schematic diagram of a two-dimensional data graph of a method for synchronously obtaining the 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 the calculation result interface of a method for synchronously obtaining the response time and frame rate of an Android system provided by an embodiment of the present invention;

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

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

[0020] Figure 9 It is a schematic structural diagram of another device for synchronously obtaining the response time and frame rate of an Android system provided by an embodiment of the present invention. Detailed implementation manners

[0021] When performing performance testing on UI interaction in the Android system, it is necessary to quantitatively obtain the response time and the frame rate of the animation effect in order to set standards to promote performance optimization and improve the user experience. The currently commonly used objective acquisition method is to record the screen through a high-frame-rate camera (above 120 frames), and at the same time use an external pressure sensing device to record the touch press and lift time points. Then, by combining frame decomposition and image recognition of the video, the time point when the action is completed is set. Comparing this end time with the start time of the touch (press or lift), the response time is calculated. At the same time, the frame rate of the interactive animation is analyzed through the number of frames in the same picture in the video and the fixed frame rate of the camera. In addition, performance data can also be collected by setting data collection points in the code.

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

[0023] 1. Obtaining intermediate data for performance testing through external methods such as camera recording and external pressure sensing devices results in low efficiency in obtaining performance test results;

[0024] 2. It is necessary to additionally set up devices such as cameras and external pressure sensing devices, and the device cost is relatively high.

[0025] To solve at least one of the above problems, various embodiments of the present invention provide a method for synchronously obtaining the response time and frame rate of an Android system, including: obtaining a list of Android devices that are preset-connected to the host computer, determining a target Android device based on the list of Android devices; using a preset command-line tool to enable the host computer to obtain 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] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

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

[0028] Step S101: Obtain a list of Android devices that are preset-connected to the host computer, and determine a target Android device based on the list of Android devices.

[0029] Step S102: Use a preset command-line tool to enable the host computer to obtain the touch information and drawing information of the target Android device.

[0030] Step S103: Analyze the touch information and 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.

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

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

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

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

[0035] Furthermore, obtaining the list of Android devices that are ADB-connected to the host computer can be queried through an ADB command; for example, all Android devices connected to the computer and their corresponding statuses can be obtained through the command "adb devices".

[0036] Further, the preset command-line tool may refer to the ADB tool.

[0037] In a possible implementation, by using the preset command-line tool, the host computer obtains the touch information and drawing information of the target Android device, including:

[0038] Run the ADB tool in the host computer. Use the first ADB command to enable the host computer to obtain the touch information of the target Android device, and use the second ADB command to enable the host computer to obtain the drawing information of the target Android device.

[0039] Among them, the 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 actions, touch positions, time, number of fingers, etc.; the drawing information may refer to the relevant data when drawing graphics or interfaces on the target Android device.

[0040] In a possible implementation, parse the touch information and 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, including:

[0041] After the host computer obtains the touch information and drawing information, perform formatting processing on the touch information and drawing information, store the formatting processing result in a preset data structure, and construct a two-dimensional data graph by calling the data in the preset data structure to further determine the response time and frame rate of the selected data interval.

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

[0043] Through the above method, the target Android device is connected to the host computer via ADB, and the ADB command is used to obtain the touch information and drawing information of the target Android device, and further determine the response time and frame rate of the target Android device, without relying on 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 detection.

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

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

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

[0047] Specifically, enable the Universal Serial Bus (USB) debugging function of the target Android device and connect to the host computer through a USB data cable. At this time, the connection method 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 a successful connection; place the target Android device and the host computer in the same network, obtain the Internet Protocol (IP) address of the target Android device, and use the "adb connect" instruction in the host computer to connect to the IP address of the target Android device. If the host computer can obtain the target Android device through the command "adb devices", it indicates a successful connection. At this time, the connection method between the target Android device and the host computer is a network connection.

[0048] Among them, USB debugging can refer to a mode that enables communication between a computer and an Android device and realizes data transmission when connecting the computer to the Android device.

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

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

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

[0052] Use a first preset command-line tool to obtain the touch information of the target Android device; the touch information includes at least one of the following: press event, lift event, and device boot time;

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

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

[0055] Use the SurfaceFlinger service of Android to obtain 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 application programs and the system interface, and combine the layers into the final image displayed on the screen.

[0057] Exemplarily, 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, and shell can indicate that the following commands are to be executed in the terminal (shell) of the target Android device; dumpsys can be a tool in the Android system, which can be used to obtain the status information of system services, and SurfaceFlinger is the service we want to obtain; grep "Output Layer" can represent using the grep command to filter the output content of dumpsys and only display the lines containing “Output Layer”. The details of each layer will be included in the output, and the part in parentheses is the layer name.

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

[0062] In a possible implementation, a first preset command - line tool is used to obtain the touch information of the target Android device, including:

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

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

[0065] Exemplarily, the obtained touch information can be as Figure 3 shown, Figure 3 which is a schematic diagram for obtaining the touch information in a method for synchronously obtaining the response time and frame rate of an Android system provided by an embodiment of the present invention, where

[0066] DOWN can represent the obtained press event, and UP can represent the obtained lift event. The content in the square brackets can characterize the time uptime, that is, the boot time of the target Android device. Here, the uptime can be accurate to the microsecond unit.

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

[0068] Based on the layer names of the target Android device, the dumpsysSurfaceFlinger-latency command is used to obtain the drawing information corresponding to the layer names.

[0069] Exemplarily, the obtained drawing information can be as Figure 4 shown, Figure 4 which is a schematic diagram for obtaining drawing information of a method for synchronously obtaining the 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-frame historical data corresponding to the layer names of the target Android device. When there are less than 127 frames, 127 rows of data can be filled with 0; each frame of data in the 127-frame data has 3 columns. Among them, the first column is the time of the next screen hardware vertical synchronization (HW-VSYNC), the second column is the moment when this frame is actually displayed on the screen, and the third column is the moment when this frame is completed 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 frames according to the above interval. The vsync interval can be calculated by dividing 1000000000 by the screen frame rate. 1000000000 is in the form of nanoseconds per 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. After receiving the signal, the system starts image processing; the moment when this frame is actually displayed on the screen can represent the time when the screen refreshes to this frame of image, that is, it means that the image has been completed and rendered and sent to the screen; the moment when this frame is completed and ready to be displayed on the screen means that the image processing of this frame has been completed and is waiting for the next VSYNC signal to display this frame.

[0072] Through the above method, by presetting a command-line tool, the touch information and corresponding drawing information of the target Android device can be quickly obtained, reducing the dependence on manual operations and complex tools and improving the efficiency of data collection; by using the SurfaceFlinger service of the Android system, the layer names and corresponding drawing information can be accurately obtained, making the frame rate statistics in dynamic application scenarios such as videos and games more accurate and hierarchical, and applicable to data analysis in multi-window scenarios; by combining the touch information and layer drawing data, the response time and frame rate performance of the system can be accurately analyzed, especially applicable to UI performance testing and optimization, and helping to locate frame-drop problems.

[0073] In a specific embodiment, the drawing information further includes the frame preparation time, and 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 is completely drawn and ready to be displayed on the screen in the third column above, the frame start preparation time is the HW-VSYNC time in the first column above, and the frame preparation time represents the length of the time period from the start of frame preparation to the completion of frame 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 cycle, resulting in frame drops and affecting visual fluency.

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

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

[0078] Enable the host computer to parse the touch information and 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 lift event as the right vertical axis coordinate of the two-dimensional data graph;

[0079] Use the vertical synchronization interval time as the first horizontal reference line and twice the vertical synchronization interval time 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 drawing information, and display the two-dimensional data graph on the host computer;

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

[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 Figure 5 shown Figure 5 It is a schematic diagram of a two-dimensional data graph of a method for synchronously obtaining the response time and frame rate of an Android system provided by an embodiment of the present invention, where:

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

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

[0086] It should be noted that Figure 5 the form of the two-dimensional data graph in is not the only form, and only one graphical style is proposed as an example, and the detailed content can be specifically set according to requirements.

[0087] As can be seen from Figure 5 when a press event and a lift event are detected, the system will perform dynamic effect drawing of a preset number of frames, which is reflected in the figure as a preset number of bar graphs after the press event and the lift event; when the height of the bar graph (i.e., the frame preparation time of this frame) is higher than the vsync 1 reference line, the dynamic effect of this frame cannot be displayed at the current VSYNC moment and must wait for the next vsync signal (i.e., vsync 2) to arrive, resulting in frame dropping.

[0088] Through the above method, by mapping touch information and drawing information to a two-dimensional data graph, users can intuitively see the association between touch events and frame drawing, facilitating the analysis of the response time of interaction operations and the animation frame rate; by setting the first and second horizontal reference lines, users can more easily discover the situation where the frame preparation time exceeds the vertical synchronization interval, thereby identifying problems such as frame rate drop, screen stuttering, or frame loss; users can click on specific points or regions in the two-dimensional data graph, and automatically select relevant data intervals according to preset rules, which not only improves the efficiency of data analysis but also reduces the errors that may occur when users manually select data.

[0089] In a specific embodiment, obtaining click information in the two-dimensional data graph and determining a selected data interval corresponding to the click information based on preset rules 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 with a consecutive two-frame interval greater than the preset time after the start frame is used as the first end frame;

[0091] The area between the first start frame and the first end frame is used 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 the lift event that is 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 where the specific frame is located 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 the two-dimensional data graph in a highlighted form; the preset time can be 0.5 seconds.

[0095] Furthermore, by determining the first selected data interval or the second selected data interval, it is ensured that the drawn frames within the data interval are valid frames, that is, the above-mentioned drawn frames can be directly observed by the user's eyes. By statistically analyzing the preparation time and display time of these frames, the smoothness of the animation can be evaluated.

[0096] Among them, the determination of valid frames is related to the user's touch information. The first selected data interval or the second selected data interval is always relative to the user's input. Therefore, the frames in the first selected data interval or the second selected data interval can directly reflect the user's interaction behavior;

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

[0098] Through the above method, by restricting the time interval between frames, it is ensured that the frames within the selected area can form a continuous animation process, making the user's visual experience smoother; selecting the area between the start frame and the end frame enables the calculation results to cover the effective drawn frames, which are directly related to the user's actual experience and helps to evaluate the smoothness and responsiveness of the animation effect.

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

[0100] Determining the start frame time and end frame time corresponding to the selected data interval, and based on the start frame time and touch information, determining the time from pressing to the start frame and the time from lifting to the start frame corresponding to the selected data interval. Based on the end frame time and touch information, determining the time from pressing to the end frame and the time from lifting to the end frame corresponding to the selected data interval;

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

[0102] In a possible implementation, the start frame time represents the timestamp of the first frame in the selected data interval, used to represent the starting point of this interval, and the end frame time represents the timestamp of the last frame in the selected data interval, representing the end point of this interval; the time from pressing to the start frame represents the interval between the time when the user touches the screen and presses and the start frame time of this interval, indicating the time when the system starts drawing after the user's operation. The time from lifting to the start frame represents the interval between the time when the user releases the screen and the start frame time of this interval, indicating the drawing delay after releasing. The time from pressing to the end frame represents the interval between the time when the user touches the screen and presses and the end frame time of this interval, indicating the time from the user's operation to the completion of the last frame of this interval. The time from lifting to the end frame represents the interval between the time when the user releases the screen and the end frame time, indicating the completion of the drawing of this interval after releasing.

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

[0104] Further, the frame rate can be the total number of frames divided by the total time difference, and the total time difference can be the time of the last frame - the time of the first frame; the maximum stutter time can represent the maximum time interval between two adjacent frames within the selected data range; the frame interval distribution can represent the distribution of the time intervals between adjacent frames.

[0105] Exemplarily, the intervals of the frame interval distribution can 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 100 ms, [50, 100) can represent the case where the frame interval is between 50 ms and 100 ms, and [40, 50) can represent the case where the frame interval is between 40 ms and 50 ms.

[0107] In a possible implementation, the time from pressing to the first frame, the time from lifting to the first frame, the time from pressing to the last frame, the time from lifting to the last frame, the frame rate, the maximum stutter time, the number of frames, and the frame interval distribution as the calculation result set corresponding to the selected data range can be all displayed at once on the Figure 6 calculation result interface as shown.

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

[0109] Through the above method, for the same use case, there is no need to take the average value multiple times. After continuous operations, data calculation and statistical records can be performed; the response time and animation frame rate are calculated at once, and data is recorded as needed. While paying attention to the response time, the smoothness and stutter are also concerned; the data graph interaction completes the statistical calculation of the response time, frame rate, and frame interval distribution for a single operation, and completes the multi-dimensional calculation of the same group of data, thereby improving the efficiency of obtaining performance data results.

[0110] Exemplarily, Figure 7 is a schematic flowchart of another method for synchronously obtaining the response time and frame rate of an Android system provided by an embodiment of the present invention, as shown in Figure 7 shown, and the figure includes the following steps:

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

[0112] Here, all Android devices connected to the computer and their corresponding states are obtained through the command "adb devices";

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

[0114] Here, determine the target Android device from the list of Android devices;

[0115] Step S703, obtain the layer name;

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

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

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

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

[0120] Here, obtain the click information in the two - dimensional data graph, and determine the selected data range corresponding to the click information based on a preset rule;

[0121] Step S706, record data;

[0122] Here, record the calculated 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 stutter time, number of frames, and frame interval distribution;

[0123] Step S707, determine whether all use cases are 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 has been calculated;

[0125] Step S708, determine the calculation result set;

[0126] Here, use 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 stutter time, number of frames, and frame interval distribution as the calculation result set corresponding to the selected data range, which can be displayed all at once on the calculation result interface as shown in Figure 6 shown;

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

[0128] Figure 8 It is a schematic structural diagram of a device for synchronously obtaining the response time and frame rate of an Android system provided by an embodiment of the present invention, as shown inFigure 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] Among them, the first determination module 801 is used to obtain a list of Android devices for preset connection with the host computer, and determine a 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 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.

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

[0133] When the preset connection is a physical connection, the Android devices in the list of Android devices are connected to the host computer through a data cable;

[0134] When the preset connection is a network connection, the Android devices in the list of Android devices are enabled to turn on a preset network configuration and connect to the host computer through the same network.

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

[0136] Use a first preset command-line tool to obtain touch information of the target Android device; the touch information includes at least one of the following: press event, lift event, and device boot time;

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

[0138] In a specific embodiment, the drawing information further includes the frame preparation time, and 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 analyze the touch information and 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 lift event as the right vertical axis coordinate of the two-dimensional data graph;

[0140] Take the vertical synchronization interval time as the first horizontal reference line and twice the vertical synchronization interval time 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] Obtain the click information in the two-dimensional data graph, determine the selected data interval corresponding to the click information based on a preset rule, and determine the response time and frame rate corresponding to the selected data interval.

[0143] In a specific embodiment, the obtaining module 803 is configured 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 with a continuous two-frame interval greater than the preset time after the start frame as the first end frame;

[0144] Take 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, use the second timestamp of the press event or the lift event that is before the specific frame and closest to the specific frame in the two-dimensional data graph as the second start frame, and use the last frame of the continuous drawing area after the specific frame as the second end frame;

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

[0147] In a specific embodiment, the obtaining module 803 is configured to determine the start frame time and the end frame time corresponding to the selected data interval, determine the time from press to start frame and the time from lift to start frame corresponding to the selected data interval based on the start frame time and the touch information, and determine the time from press to end frame and the time from lift to end frame corresponding to the selected data interval based on the end frame time and the touch information;

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

[0149] It should be noted that: when the above-mentioned device for synchronously obtaining the Android system response time and frame rate implements the corresponding method for synchronously obtaining the Android system response time and frame rate, only the above-mentioned division of each program module is used for illustration. In actual applications, the above-mentioned processing can be allocated to different program modules according to needs, that is, the internal structure of the device is divided into different program modules to complete all or part of the above-described processing. In addition, the device provided in the above-mentioned embodiment and the correspondingFigure 1 Embodiments of the method described above belong to the same inventive concept. For the specific implementation process, please refer to the method embodiments and will not be elaborated here.

[0150] An embodiment of the present invention further provides a computer device having the above-mentioned Figure 8 device for synchronously obtaining the Android system response time and frame rate as shown.

[0151] Please refer to Figure 9 , Figure 9 which is a schematic structural diagram of another device for synchronously obtaining the Android system response time and frame rate provided by an embodiment of the present invention. As shown in Figure 9 , the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including a high-speed interface and a low-speed interface. Each component communicates with each other using different buses and can be installed on a common main board or installed in other ways as needed. The processor can process instructions executed within the computer device, including instructions stored in the memory or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some alternative 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 (such as an array of servers, a set of blade servers, or a multi-processor system). Figure 9 In

[0152] , one processor 10 is taken as an example.

[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 embodiments.

[0154] The memory 20 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created according to the use of the computer device, etc. In addition, the memory 20 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some alternative embodiments, the memory 20 may optionally include a memory remotely provided with respect to the processor 10, and these remote memories may be connected to the computer device through 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 volatile memory, such as random access memory; the memory may also include non-volatile memory, such as 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 further 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 through a bus or other means, Figure 9 taking connection through a bus as an example.

[0157] The input device 30 can receive input digital or character information, and generate key signal inputs related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a trackpad, a touchpad, a pointing stick, 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 alternative embodiments, the display device may be a touch screen.

[0158] The computer device further includes a communication interface for the computer device to communicate with other devices or communication networks.

[0159] Embodiments of the present invention also provide a computer-readable storage medium. The method according to the embodiments of the present invention can be implemented in hardware, firmware, or be implemented as computer code that can be recorded on a storage medium, or be implemented as computer code that is originally stored in a remote storage medium or a non-transitory machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, 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 memory, a random access memory, a flash memory, a hard disk, or a solid-state drive, 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, and when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the method shown in the above embodiments is implemented.

[0160] A part of the present invention can be applied as a computer program product, for example, computer program instructions, 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 be able to understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are 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. Herein, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible by the computer.

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

Claims

1. A method for synchronously obtaining the response time and frame rate of an Android system, characterized in that, The method includes: Obtain a list of Android devices that are preset-connected to the host computer, and determine a target Android device based on the list of Android devices; Use a preset command-line tool to enable the host computer to obtain the touch information and drawing information of the target Android device; 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 a selected data interval in the two-dimensional data graph; Among them, the 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 a selected data interval in the two-dimensional data graph includes: after the host computer obtains the touch information and the drawing information, performing formatting processing on the touch information and the drawing information, storing the formatting processing result in a preset data structure, constructing the two-dimensional data graph by calling the data in the preset data structure, and determining the response time and frame rate of the selected data interval; Among them, the 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 a selected data interval in the two-dimensional data graph is implemented based on the following steps: Enable the host computer to analyze 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 time and the lift time as the right vertical axis coordinate of the two-dimensional data graph; Use the vertical synchronization interval time as the first horizontal reference line and use twice the vertical synchronization interval time as the second horizontal reference line; 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 the two-dimensional data graph corresponding to the touch information and the drawing information, and display the two-dimensional data graph in the host computer; Obtain the click information in the two-dimensional data graph, determine the selected data interval corresponding to the click information based on a preset rule, and determine the response time and frame rate corresponding to the selected data interval.

2. The method according to claim 1, characterized in that, The preset connection includes a physical connection and a network connection; among them, When the preset connection is the physical connection, enable the Android devices in the list of Android devices to be connected to the host computer through a data cable; When the preset connection is the network connection, enable the Android devices in the list of Android devices to enable a preset network configuration and be connected to the host computer through the same network.

3. The method according to claim 2, characterized in that, The using 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 a preset Android service tool to obtain the layer name of the target Android device; Use a first preset command-line tool to obtain the touch information of the target Android device; the touch information includes at least one of the following: press time, lift time, and device boot time; Use a second preset command-line tool to obtain the drawing information corresponding to the layer names of the target Android device respectively; the drawing information includes at least one of the following: vertical synchronization interval, vertical synchronization time, frame start preparation time, and frame completion preparation time.

4. The method according to claim 3, wherein The drawing information further includes a frame preparation time, which is the difference between the frame completion preparation time and the frame start preparation time.

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

6. The method according to claim 1, characterized in that 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, determine the time from press to the first frame and the time from lift 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 press to the last frame and the time from lift to the last frame 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, determine the frame rate, the maximum stutter time, the number of frames, and the frame interval distribution corresponding to the selected data interval.

7. A device for synchronously obtaining the response time and frame rate of an Android system, characterized in that, The device includes: A first determination module, configured to obtain a list of Android devices presetly connected to the host computer, and determine a target Android device based on the list of Android devices; A second determination module, configured to use a preset command-line tool to cause the host computer to obtain the touch information and drawing information of the target Android device; An acquisition module, configured 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; Among them, the acquisition module is specifically configured to, after the host computer obtains the touch information and the drawing information, perform formatting processing on the touch information and the drawing information, store the formatting processing result in a preset data structure, construct the two-dimensional data graph by calling the data in the preset data structure, and determine the response time and frame rate of the selected data interval; Among them, the acquisition module is specifically configured to cause 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 time and the lift time as the right vertical axis coordinate of the two-dimensional data graph; Use the vertical synchronization interval time as the first horizontal reference line and use twice the vertical synchronization interval time as the second horizontal reference line; Construct 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 display the two-dimensional data graph on the host computer; Obtain the click information in the two-dimensional data graph, determine the selected data interval corresponding to the click information based on a preset rule, and determine the response time and frame rate corresponding to the selected data interval.

8. A computer device, characterized in that, including: A memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to execute the method for synchronously obtaining the response time and frame rate of the Android system according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, Computer instructions are stored on the computer-readable storage medium, and the computer instructions are used to cause the computer to execute the method for synchronously obtaining the response time and frame rate of the Android system according to any one of claims 1 to 6.