Method and device for testing and improving page response performance and terminal equipment
Technical Field
The present invention relates to computer technology, and more particularly, to a method for testing page response performance, a method for improving page response performance, an apparatus for testing page response performance, and a terminal device.
Background
With the rapid development of mobile internet and the rapid popularization of smart devices worldwide, users have become more and more accustomed to implementing communication, shopping, payment and entertainment functions through various Applications (APPs).
The response speed of the application page is related to the network environment of the intelligent device, the performance of the intelligent device and the design of the application. Generally, a processor, a memory, and an operating system of the smart device directly affect the response speed of an application page, and the starting mode of the application, the rendering complexity of the page, the interface control level, and the like may also affect the response speed of the application page.
The basic expectation of the user for the application is that the application is smooth to use, and if the response speed of the application is slow and the user expectation is not met, the user is not highly rated for the intelligent device or the application, and the user may even be caused to replace the intelligent device or uninstall the application.
Therefore, the response speed of the application page is a very important evaluation index, and a scheme for efficiently testing the page response performance is needed.
Disclosure of Invention
An object of the present invention is to provide an efficient solution for testing page response performance.
According to a first aspect of the present invention, there is provided a method for testing page response performance, comprising the steps of:
acquiring a screen recording of a page response, wherein the page response is caused by an event for operating a first control, and the screen recording comprises a process from the event for operating the first control to the end of the page response;
extracting page features from a frame page of the last frame or a plurality of frames of the frame sequence of the screen recording;
determining a response frame page from the frame sequence according to the page characteristics;
and calculating the time consumed by page response according to the time of the event of operating the first control and the time of the response frame page.
Optionally or optionally, the determining a response frame page from the sequence of frames according to the page feature includes:
determining a comparison mode according to the page features;
and performing contrast analysis on the frame pages of the frame sequence according to the comparison mode to determine the response frame page.
Optionally or optionally, the method further comprises: acquiring equipment information of equipment where the page response is located, and determining whether the server or the equipment performs the comparison analysis according to the equipment information and the comparison mode;
the device information includes any one or any combination of the following: the system comprises a system operation memory, a system load, an available memory, a CPU core number, a CPU frequency, a GPU performance parameter, electric quantity and an equipment model.
Optionally or optionally, the page feature includes any one or any combination of the following: pure color degree, dynamic area, control distribution.
Optionally or more optionally, the page feature comprises a dynamic region;
the determining a response frame page from the sequence of frames according to the page feature includes:
determining a first portion of a frame page of the sequence of frames, the first portion of the frame page being a portion corresponding to the dynamic region;
a response frame page is determined by comparing other portions of frame pages of the sequence of frames.
Optionally or additionally, the page feature comprises a solid color level;
the determining a response frame page from the sequence of frames according to the page feature includes:
and if the pure color degree is larger than a preset threshold value, determining a response frame page by comparing pixels of frame pages of the frame sequence.
Optionally or more optionally, the page feature comprises a control distribution;
the determining a response frame page from the sequence of frames according to the page feature includes:
determining a response frame page by comparing control distributions of frame pages of the sequence of frames.
Optionally or optionally, the acquiring the screen recording of the page response includes:
monitoring whether the first control is operated or not, and starting screen recording if the first control is operated; or, in response to an instruction for starting screen recording, starting screen recording;
and in response to the instruction of finishing screen recording, terminating screen recording.
Optionally or optionally, the method further comprises:
timing the screen recording, and triggering the instruction for finishing the screen recording when the screen recording time reaches a preset first time threshold; or,
monitoring a system log of the equipment where the page response is located, determining whether screen recording is finished according to the system log, and triggering the instruction of finishing screen recording if screen recording is determined to be finished; or,
and monitoring whether a second control appears, and if the second control appears, triggering the instruction of finishing screen recording.
According to a second aspect of the present invention, there is provided a method for improving page response performance, including the method for testing page response performance according to any one of the preceding claims, further including:
if the time consumed by the page response is greater than a preset second time threshold, executing any one or any combination of the following operations:
prompting a user to check the network environment;
prompting a user to clean equipment garbage;
prompting a user to close the inactive application or directly closing the inactive application;
and prompting a user to set the application to which the page response belongs to a minimalist page mode or directly setting the application to which the page response belongs to the minimalist page mode.
According to a third aspect of the present invention, there is provided an apparatus for testing page response performance, comprising:
the acquisition module is used for acquiring a screen recording of a page response, wherein the page response is caused by an event of operating a first control, and the screen recording comprises a process from the event of operating the first control to the end of the page response;
the extraction module is used for extracting page characteristics from a frame page of the last frame or a plurality of frames of the frame sequence of the screen recording;
a determining module, configured to determine a response frame page from the frame sequence according to the page feature;
and the calculating module is used for calculating the time consumed by page response according to the time of the event of operating the first control and the time of the response frame page.
Optionally or preferably, the determining a response frame page from the sequence of frames according to the page feature comprises:
determining a comparison mode according to the page features;
and performing contrast analysis on the frame pages of the frame sequence according to the comparison mode to determine the response frame page.
Optionally or preferably, the page characteristics include any one or any combination of the following: pure color degree, dynamic area, control distribution.
Optionally or preferably, the page feature comprises a dynamic region;
the determining a response frame page from the sequence of frames according to the page feature includes:
determining a first portion of a frame page of the sequence of frames, the first portion of the frame page being a portion corresponding to the dynamic region;
a response frame page is determined by comparing other portions of frame pages of the sequence of frames.
Optionally or preferably, the page characteristic comprises a degree of solid color;
the determining a response frame page from the sequence of frames according to the page feature includes:
and if the pure color degree is larger than a preset threshold value, determining a response frame page by comparing pixels of frame pages of the frame sequence.
Optionally or preferably, the page feature comprises a control distribution;
the determining a response frame page from the sequence of frames according to the page feature includes:
determining a response frame page by comparing control distributions of frame pages of the sequence of frames.
Optionally or preferably, the obtaining module comprises:
the screen recording starting module is used for monitoring whether the first control is operated or not, and starting screen recording if the first control is operated; or, the screen recording device is used for responding to an instruction for starting screen recording and starting screen recording;
and the screen recording ending module is used for responding to the instruction of ending screen recording and ending screen recording.
Optionally or preferably, the acquiring module further comprises a triggering module;
the trigger module is used for timing the screen recording and triggering the instruction for finishing the screen recording when the screen recording time reaches a preset first time threshold; or,
the trigger module is used for monitoring a system log of the equipment where the page response is located, determining whether to finish screen recording according to the system log, and if so, triggering the instruction of finishing screen recording; or,
and the triggering module is used for monitoring whether a second control appears or not, and triggering the instruction for finishing screen recording if the second control appears.
According to a fourth aspect of the present invention, there is provided a terminal device, including any one of the foregoing apparatuses for testing page response performance, further including:
a performance promotion module, configured to, if the time consumed by the page response is greater than a preset second time threshold, perform any one or any combination of the following operations:
prompting a user to check the network environment;
prompting a user to clean equipment garbage;
prompting a user to close the inactive application or directly closing the inactive application;
and prompting a user to set the application to which the page response belongs to a minimalist page mode or directly setting the application to which the page response belongs to the minimalist page mode.
According to a fifth aspect of the present invention, there is provided an apparatus for testing page response performance, comprising a memory and a processor;
the memory stores a computer program which, when executed by the processor, implements the method of testing page response performance of any preceding claim.
According to a sixth aspect of the present invention, there is provided a terminal device comprising a memory, a processor, and a display screen;
the memory stores a computer program which, when executed by the processor, implements the method of testing page response performance of any preceding claim, and implements the method of:
if the time consumed by the page response is greater than a preset second time threshold, executing any one or any combination of the following operations:
prompting a user to check the network environment;
prompting a user to clean equipment garbage;
prompting a user to close the inactive application or directly closing the inactive application;
and prompting a user to set the application to which the page response belongs to a minimalist page mode or directly setting the application to which the page response belongs to the minimalist page mode.
Based on the scheme for testing the page response performance provided by the embodiment of the invention, the time when the page of the response frame appears can be automatically confirmed according to the page characteristics of the last frames of the page response, so that the time consumed by the page response is further determined. The scheme for testing the page response performance provided by the embodiment of the invention can automatically confirm the time when the response frame page appears, thereby improving the testing efficiency.
Other features of the present invention and advantages thereof will become apparent from the following detailed description of exemplary embodiments thereof, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a block diagram of an application system provided by an embodiment of the invention;
FIG. 2 is a flowchart of a method for testing page response performance according to an embodiment of the present invention;
FIG. 3 is a diagram of a final state frame page provided by an embodiment of the invention;
FIG. 4 is a diagram of a final state frame page provided by an embodiment of the invention;
FIG. 5 is a diagram of a final state frame page provided by an embodiment of the invention;
FIG. 6 is a flowchart of a method for improving page response performance according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a testing apparatus provided in an embodiment of the present invention;
FIG. 8 is a schematic diagram of an acquisition module provided by an embodiment of the present invention;
fig. 9 is a schematic diagram of a terminal device provided in an embodiment of the present invention;
FIG. 10 is a schematic diagram of a testing apparatus provided in an embodiment of the present invention;
fig. 11 is a schematic diagram of a terminal device according to an embodiment of the present invention.
Detailed Description
Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any particular value should be construed as merely illustrative, and not limiting. Thus, other examples of the exemplary embodiments may have different values.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
< application System >
Fig. 1 is a block diagram of an application system provided in an embodiment of the present invention. As shown in fig. 1, the system includes an application server 101, a network 102, and a terminal device 103. The application server 101 and the terminal device 103 are communicatively connected via a network 102. The number of the terminal devices 103 may be one or more, and a plurality of terminal devices 103 are shown in the figure. Of course, the application server 101 may also be directly connected to the terminal device 103.
The configuration of the application server 101 may include, but is not limited to, a processor 1011, a memory 1012, an interface device 1013, a communication device 1014, an input device 1015, an output device 1016. The processor 1011 may include, but is not limited to, a central processing unit CPU, a microprocessor MCU, or the like. The memory 1012 may include, but is not limited to, a ROM (read only memory), a RAM (random access memory), a nonvolatile memory such as a hard disk, and the like. Interface device 1013 may include, but is not limited to, a USB interface, a serial interface, a parallel interface, and the like. The communication device 1014 is capable of wired or wireless communication, for example, and may specifically include WiFi communication, bluetooth communication, 2G/3G/4G/5G communication, and the like. Input devices 1015 include, but are not limited to, a keyboard, a mouse, a touch screen, a microphone, and the like. Output devices 1016 include, but are not limited to, a display screen, speakers, and the like. The configuration of the application server 101 may include only some of the above devices.
The terminal device 103 may be, for example, an electronic device installed with an intelligent operating system (e.g., android, IOS, Windows, Linux, etc.) including, but not limited to, a laptop, a desktop computer, a mobile phone, a tablet computer, etc. Configurations of terminal equipment 103 include, but are not limited to, processor 1031, memory 1032, interface device 1033, communication device 1034, GPU 1035, display device 1036, input device 1037, speaker 1038, microphone 1039, and camera 1030. The processor 1031 includes, but is not limited to, a central processing unit CPU, a microprocessor MCU, and the like. The memory 1032 includes, but is not limited to, a ROM (read only memory), a RAM (random access memory), a nonvolatile memory such as a hard disk, and the like. Interface device 1033 includes, but is not limited to, a USB interface, a serial interface, a parallel interface, and the like. The communication device 1034 is capable of wired or wireless communication, for example, and specifically may include WiFi communication, bluetooth communication, 2G/3G/4G/5G communication, and the like. The GPU 1035 is used to process the image. The display device 1036 includes, but is not limited to, a liquid crystal screen, a touch screen, and the like. Input devices 1037 include, but are not limited to, a keyboard, a mouse, a touch screen, and the like. The configuration of the terminal device 103 may include only some of the above-described apparatuses.
In the embodiment of the present invention, a user may operate an Application (APP) loaded on the terminal device 103, and the terminal device 103 runs the APP to implement a function required by the user. The application server 101 provides background support for the application, and the terminal device 103 may need to interact with the application server 101 during the process of running the application.
The user can operate the application loaded on the terminal device 103 through the control. A control here refers to an object into which a user can input instructions or data. Controls may be physical or virtual. The physical controls may be, for example, physical buttons, a keyboard, a mouse, a microphone, a joystick, etc., and the virtual controls may be, for example, application icons, virtual buttons, a virtual keyboard, a virtual mouse, a text box, an input window, a progress bar, a scroll bar, etc., presented on a display screen of the terminal device 103. The operation of the control by the user may cause a change in the displayed page of the terminal device 103, which may be referred to as a page response.
The terminal device 103 may have a screen recording function, that is, the terminal device 103 may record the content displayed on its screen.
The application system shown in fig. 1 is merely illustrative and is in no way meant to limit the invention, its application, or uses. It should be understood by those skilled in the art that although a plurality of apparatuses of the application server 101 and the terminal device 103 are described in the foregoing, the present invention may relate to only a part of the apparatuses thereof. For example, the application server 101 may relate only to a processor, a memory and a communication means, and the terminal device 103 may relate only to a processor, a memory, a communication means, a display screen and a speaker. Those skilled in the art can design instructions in accordance with the disclosed aspects. How the instructions control the operation of the processor is well known in the art and will not be described in detail herein.
< method for testing Page response Performance >
Fig. 2 is a flowchart of a method for testing page response performance according to an embodiment of the present invention. The method for testing page response performance provided in the embodiment of the present invention may be a test on page response performance of an application loaded on the terminal device 103, or a test on page response performance of software loaded on other electronic devices, which is not limited in the embodiment of the present invention.
Taking the terminal device 103 as an example, the following describes a method for testing page response performance of the terminal device 103, including the following steps:
202. acquiring a screen recording of a page response, wherein the page response is caused by an event for operating the first control, and the screen recording comprises a process from the event for operating the first control to the end of the page response.
204. The page features are extracted from the frame page of the last frame or frames of the sequence of frames of the screen recording.
206. And determining a response frame page from the frame sequence of the screen recording according to the extracted page features.
208. And calculating the time consumed by the page response according to the time when the event for operating the first control occurs and the time when the response frame page appears.
Any one of step 202, step 204, step 206, and step 208 may be executed by the terminal device 103, or may be executed by a test apparatus (for example, the application server 101 or another cloud server as the test apparatus) separate from the terminal device 103.
The method for testing the page response performance provided by the embodiment of the invention can automatically confirm the time when the response frame page appears according to the page characteristics of the last frames of the page response, thereby determining the time consumed by the page response. The method for testing the page response performance provided by the embodiment of the invention can automatically confirm the time when the response frame page appears, and improves the testing efficiency. According to the method for testing the page response performance, provided by the embodiment of the invention, the page of the response frame is confirmed according to the page characteristics of the last frames of the page response, so that the test result can reflect the intuitive feeling of the user on the page response.
The following is a detailed description of the steps:
202. acquiring a screen recording of a page response, wherein the page response is caused by an event for operating the first control, and the screen recording comprises a process from the event for operating the first control to the end of the page response.
In a specific example, the action of starting screen recording can be implemented by step 2022 or step 2024:
2022. starting screen recording in response to an instruction for starting screen recording; the event of operating the first control occurs after the screen recording begins.
In step 2022, a user may operate the terminal device 103 to issue an instruction to start screen recording. For example, a "screen recording" button is provided on the interface of the terminal device 103, and a user may send an instruction to start screen recording by clicking the "screen recording" button on the touch screen of the terminal device 103, so as to start screen recording. Or, a test program is preset, and the test program sends out a screen recording starting instruction to start screen recording.
The screen recording is started before the event of operating the first control occurs, the screen recording record can be ensured at the moment when the event of operating the first control occurs, and the screen recording process is further ensured to include the process from the event of operating the first control to the page response ending.
2024. And monitoring whether the first control is operated, and starting screen recording if the first control is operated.
In step 2024, a first control of terminal device 103 may be operated by the user. For example, the first control is an application icon, and the user clicks the application icon on the touch screen of the terminal device 103 to open the home page of the application. And monitoring the application icon, and starting a screen recording screen when the application icon is clicked. Or, a test program is preset, and the test program operates the first control to start screen recording.
It should be noted that the test program mentioned in the foregoing step 2022 or step 2024, and the test program mentioned later may be provided in the terminal device 103, or may be provided in a test apparatus separate from the terminal device 103. If provided in a test apparatus separate from the terminal device 103, communication between the test apparatus and the terminal device 103 is possible. The testing device may be, for example, the application server 101 or other cloud server.
The screen recording in the embodiment of the present invention may be obtained by the terminal device 103 recording its own screen. The screen of the terminal device 103 may be photographed by an image pickup device separate from the terminal device 103 under the control of the test program. The camera device may be integrated in the test device, for example. The recording codec, resolution, bit rate, and frame number used for the recording screen may be set in advance.
In a specific example, ending the screen recording can be implemented by step 2026:
2026. and in response to the instruction of finishing screen recording, terminating screen recording.
In step 2026, the terminal device 103 may be operated by the user to issue an instruction to end screen recording, thereby terminating screen recording.
Or, the screen recording is timed by the test program when the screen recording starts, and after the screen recording time reaches a preset first time threshold value, an instruction for finishing the screen recording is triggered. The user may set the first time threshold empirically, for example, the user may estimate the time required for the page response according to the history of the page response, and set the first time threshold according to the time. The first time threshold is to be able to cover the process of the end of the response.
Or, monitoring a system log of the terminal device 103 by the test program, determining whether to finish screen recording according to the system log, and if determining to finish screen recording, triggering an instruction of finishing screen recording. When the page response is finished, the system of the terminal device 103 generates a system log corresponding to the page response, and after the system log corresponding to the page response is monitored by the test program, it is determined that screen recording can be finished, and an instruction for finishing screen recording is triggered.
Or, monitoring whether the second control appears by the test program, and if the second control appears, triggering an instruction for ending screen recording. The second control is a control on the page presented by the terminal device 103 after the page response is completed. When the second control appears, the page response is completed, and an instruction for ending screen recording is triggered.
Or the mechanical arm simulates the operation of a user to realize the operation of the first control, the operation of starting screen recording and the operation of finishing screen recording.
204. The page features are extracted from the frame page of the last frame or frames of the sequence of frames of the screen recording.
After the screen recording is acquired, the frame sequence is analyzed from the screen recording. In a specific example, the screen recording may be uniformly framed at a preset frame rate to obtain a frame sequence.
In one embodiment, the page features are extracted from the frame pages of the last N frames of the sequence of frames of the screen recording, N being a positive integer. Or extracting page features from a frame page of the last M frames of the frame sequence of the screen recording, wherein the proportion of the M frames to the total frame number of the frame sequence of the screen recording is a preset proportion, and M is a positive integer. In a specific example, the proportion of M frames to the total number of frames of the frame sequence of the recording screen is around 10%.
When the page features are extracted from the frame pages of the last multiframe of the frame sequence of the screen recording, the extracted page features may be page features of all frames or a majority of frames in the multiframe.
The page characteristics may include any one or any combination of the following: pure color degree, dynamic area, control distribution.
For convenience of description, the "frame page of the last frame or frames of the frame sequence of the screen recording" of step 204 is hereinafter referred to as "final state frame page".
The dynamic region of a page refers to the region of the page that changes over time. The page characteristic of "dynamic zone" is illustrated with reference to FIG. 3: the final state frame page includes a frame page 501, a frame page 502, and a frame page 503 in time order. As can be seen from fig. 3, in the frame page 501, the area 11 is used for showing the advertisement 1, and the area 12 is used for showing the advertisement 2. In the following frame page 502, area 11 is used to show advertisement 3 and area 13 is used to show advertisement 4. In the further following frame page 503, area 11 is used for presenting advertisement 5 and area 13 is used for presenting advertisement 6. Advertisement 1, advertisement 3, and advertisement 5 are different advertisements, and advertisement 2, advertisement 4, and advertisement 6 are different advertisements. This means that the regions 11 and 12 are dynamic regions, and the content presented by them changes with time.
In one embodiment, the dynamic region may include a carousel region. For any dynamic area, if the dynamic area displays a plurality of preset contents in turn, the dynamic area is a carousel area.
The solid degree of a page refers to the concentration of colors in the page. The page characteristic "degree of solid color" is illustrated with reference to fig. 4: the final frame page 504 includes color blocks 21 and 22, the frame page 504 except the color blocks 21 and 22 is of another color and occupies most of the area, and the pure color degree of the frame page 504 can be obtained by calculating the ratio of the area of the part except the color blocks 21 and 22 to the total area of the frame page 504. In another embodiment, the final frame page may be converted into a gray scale map, so as to obtain the gray scale value of each pixel, and calculate the concentration degree of the gray scale values of the pixels as the pure color degree of the final frame page. One skilled in the art may calculate the solid degree of the page in many ways, and the embodiment of the present invention is not limited thereto.
The control distribution of the page may include one or more of the position, shape, size, number of control elements. The page feature "control distribution" is illustrated with reference to FIG. 5: the final frame page 505 includes 4 controls, namely a rectangular control 31, a special-shaped control 32, a circular control 33, and a circular control 34.
206. And determining a response frame page from the frame sequence of the screen recording according to the extracted page features.
In one embodiment, determining a response frame page from the sequence of screen-shot frames based on the extracted page features comprises:
2062. and determining a comparison mode according to the extracted page features.
2064. And comparing and analyzing the frame pages of the frame sequence according to the determined comparison mode to determine response frame pages.
In step 2062 and step 2064, a suitable comparison method is selected according to the page features of the last frames of the page response, and obviously, the comparison method selected in this way is more suitable for the page response, so that the test result can reflect the intuitive feeling of the user for the page response.
In step 2064, the frame pages of the frame sequence are analyzed by comparison to determine the response frame pages, which may be performed by clustering. For example, frame pages are clustered along the time sequence of the frame pages in a clustering manner, so that the frame sequence is divided into at least two subsequences according to the front-back sequence, frames in the same subsequence are more similar, and the first frame of the last subsequence is used as a response frame page.
In step 2064, the frame pages of the frame sequence are analyzed in comparison to determine the response frame pages, which may be determined according to the similarity between the frame pages. For example, a frame is selected whose similarity to the page of the final frame reaches a first similarity threshold and whose similarity to the page of the frame preceding it is less than a second similarity threshold. When the selected frames are multiple, selecting a first frame in the multiple frames as a response frame page; when one frame is selected, the frame is a response frame page. In one specific example, the first similarity threshold may be 60% and the second similarity threshold may be 90%.
In another specific example, in step 2064, the frame sequence may be decimated before the response frame page is determined. For example, every D frames in the frame sequence are extracted, the extracted frames form a new frame sequence, and the frame pages of the new frame sequence are subjected to the above-mentioned contrast analysis to obtain the suspected response frames. And D frames before the suspected response frame of the original frame sequence to D frames after the suspected response frame form another frame sequence, and the another frame sequence is subjected to the contrastive analysis again to determine a response frame page from the another frame sequence. The mode of firstly extracting the frame and then determining the response frame can reduce the calculation amount and accelerate the processing speed.
In step 2064, the comparison element (e.g., the element according to which the clustering is performed, e.g., the element according to which the similarity comparison is performed) according to which the comparison analysis is performed on the frame page of the frame sequence is set according to the page feature of the final-state frame page. The following will further describe step 206, step 2062 and step 2064 by taking the final state frame page shown in fig. 3-5 as an example.
Referring to FIG. 3, the final state frame page includes a dynamic region. Determining a response frame page from the frame sequence of the screen recording according to the extracted page features comprises the following steps: determining a first portion of a frame page of a sequence of frames, the first portion of the frame page being a portion corresponding to the dynamic region; the response frame page is determined by comparing other portions of the frame pages of the sequence of frames.
That is, when the dynamic region is included in the final frame page, a portion of the frame page corresponding to the dynamic region may be cut, and the remaining page portion after cutting may be used to determine the response frame page.
Corresponding to the comparison method selected in step 2062 and step 2064, the step of intercepting the dynamic region is performed first, and then the remaining page portion after interception is used for comparison analysis to determine the response frame page.
Referring to fig. 4, if the solid level of the final frame page is greater than the set solid level threshold, it is determined that the final frame page belongs to the solid page. If the final state frame page belongs to a solid color page, a response frame page is determined by comparing pixels of frame pages of the sequence of frames. The pure chroma threshold is for example 70%.
In one example, comparing pixels of frame pages of a sequence of frames to determine a response frame page may be converting the frame pages into grayscale pages and comparing grayscale values of the pixels to determine the response frame page.
In one example, a response frame page is determined by comparing pixels of frame pages of a sequence of frames, and the response frame page may be determined by comparing color components of the pixels.
Corresponding to the comparison method selected in step 2062 and step 2064, the response frame page is determined by comparing and analyzing the gray-scale values or color components of the pixels of the frame page.
Referring to FIG. 5, the page characteristics of the final frame page include a control distribution. Determining a response frame page from the frame sequence of the screen recording according to the extracted page features comprises the following steps: the response frame page is determined by comparing the control distributions of the frame pages of the sequence of frames.
Specifically, when one or more controls are included in the final frame page, the response frame page may be determined by comparing the distribution of the controls of the frame page, for example, comparing the position, shape, size, and number of the controls of the frame page.
Corresponding to the comparison method selected in step 2062 and step 2064, the response frame page is determined by comparing and analyzing the control distribution of the frame page.
In another specific example, the page characteristics of the final frame page may include a plurality of page characteristics. For example: the page characteristics of the final frame page include both dynamic regions and control distributions. In determining the response frame page, a portion of the frame page corresponding to the dynamic region is first truncated. And then, determining a response frame page by comparing the control distribution conditions of the rest part of the intercepted frame page.
In another specific example, the page characteristics of the final frame page include both the dynamic region and the degree of solid color. In determining the response frame page, a portion of the frame page corresponding to the dynamic region is first truncated. Then, if the final frame page belongs to the solid color page, the response frame page is determined by comparing the pixels of the remaining portion of the frame page after the frame page truncation.
In another specific example, the page characteristics of the final state frame page include both the dynamic region, the degree of solid color, and the control distribution. In determining the response frame page, a portion of the frame page corresponding to the dynamic region is first truncated. Then, if the final frame page belongs to the solid color page, the response frame page is determined by comparing the pixels of the remaining portion of the frame page after the frame page truncation. And if the final state frame page does not belong to the pure color page and has the control, determining a response frame page by comparing the distribution condition of the control in the residual part of the intercepted frame page. Or, if the number of the controls on the final state frame page is greater than a certain number, whether the final state frame page is pure color or not is not considered, and the response frame page is determined by directly comparing the control distribution conditions of the rest part of the intercepted frame page.
In addition, it may be determined whether step 2064 is executed by the device where the page response is located or is executed by a testing apparatus (e.g., the application server 101 or other cloud server) separate from the device where the page response is located according to the device information of the device where the page response is located and the comparison manner determined in step 2062. If the cloud server executes step 2064, the screen recording or the frame sequence and the version number of the determined comparison mode need to be uploaded to the cloud server. If the page responds to the device in which the page is located to execute step 2064, the comparison method needs to be configured in the device, for example, the cloud server issues the algorithm corresponding to the comparison method to the device.
In a specific example, device information of the terminal device 103 is acquired. The device information includes any one or any combination of the following: the system comprises a system operation memory, a system load, an available memory, a CPU core number, a CPU frequency, a GPU performance parameter, electric quantity and an equipment model. Such information of the terminal device 103 has an influence on the page response speed.
And determining whether to execute the step 2064 by the terminal device 103 or execute the step 2064 by the application server 101 according to the device information of the terminal device 103 and the comparison mode determined in the step 2062.
The poorer the capability of the terminal device 103 itself to respond to the page, the more complex the determined comparison manner, the more the cloud server tends to perform step 2064. And vice versa. The stronger the capability of the terminal device 103 itself to respond to the page, the simpler the determined comparison manner, and step 2064 may be executed by the terminal device 103.
208. And calculating the time consumed by the page response according to the time when the event for operating the first control occurs and the time when the response frame page appears. Specifically, the time consumed by the page response is obtained by subtracting the time of the event of operating the first control from the time of the response frame page.
In the embodiment of the invention, the time when the event of the first control occurs can be acquired in various ways. For example, the first control may be monitored, and the time when the event for operating the first control occurs is acquired after the first control is operated. For example, the test program may obtain, from an application interface corresponding to the first control, a time at which an event operating the first control occurred. For example, the test program may determine the time when the event of the first control occurs by means of a system layer callback, monitoring a hardware layer log, monitoring a system log, and the like. And will not be described in excessive detail herein.
< method for improving Page response Performance >
Referring to fig. 6, a method for improving page response performance according to an embodiment of the present invention is described, which includes the following steps:
202. acquiring a screen recording of a page response, wherein the page response is caused by an event for operating the first control, and the screen recording comprises a process from the event for operating the first control to the end of the page response.
204. The page features are extracted from the frame page of the last frame or frames of the sequence of frames of the screen recording.
206. And determining a response frame page from the frame sequence of the screen recording according to the extracted page features.
208. And calculating the time consumed by the page response according to the time when the event for operating the first control occurs and the time when the response frame page appears.
210. If the time consumed by the page response is greater than the preset second time threshold, which indicates that the time consumed by the page response is too much and may exceed the user-allowable range, an operation for improving the page response performance needs to be performed. The operations include any one or any combination of the following:
prompting a user to check the network environment;
prompting a user to clean equipment garbage;
prompting a user to close the inactive application or directly closing the inactive application;
and prompting a user to set the application to which the page response belongs to a minimalist page mode or directly setting the application to which the page response belongs to the minimalist page mode.
By using the method, the page response performance of the terminal device 103 can be improved.
< means for testing Page response Performance >
Fig. 7 is a schematic diagram of a test apparatus 600 according to an embodiment of the present invention, where the test apparatus 600 is used for testing page response performance, and the test apparatus 600 includes the following modules:
the obtaining module 601 is configured to obtain a screen recording of a page response, where the page response is caused by an event of operating a first control, and the screen recording includes a process from occurrence of the event of operating the first control to end of the page response.
An extracting module 602, configured to extract a page feature from a frame page of a last frame or multiple frames of the frame sequence of the screen recording.
A determining module 603, configured to determine a response frame page from the frame sequence recorded on the screen according to the extracted page feature.
The calculating module 604 is configured to calculate time consumed by the page response according to a time when the event for operating the first control occurs and a time when the response frame page occurs. .
The device for testing the page response performance provided by the embodiment of the invention can automatically confirm the time when the response frame page appears according to the page characteristics of the last frames of the page response, thereby determining the time consumed by the page response. The device for testing the page response performance provided by the embodiment of the invention can automatically confirm the time when the response frame page appears, thereby improving the testing efficiency. According to the device for testing the page response performance, provided by the embodiment of the invention, the page of the response frame is confirmed according to the page characteristics of the last frames of the page response, so that the test result can reflect the intuitive feeling of the user on the page response.
Fig. 8 is a schematic diagram of an acquisition module 601 according to an embodiment of the present invention, where the acquisition module 601 includes a recording screen starting module 6011, a triggering module 6013, and a recording screen ending module 6012.
A screen recording starting module 6011, configured to monitor whether the first control is operated, and start screen recording if the first control is operated. Or, the screen recording starting module 6011 is configured to start screen recording in response to an instruction to start screen recording.
A screen recording ending module 6012, configured to end screen recording in response to the instruction to end screen recording.
The triggering module 6013 is configured to time the screen recording, and trigger an instruction to end the screen recording when the screen recording time reaches a preset first time threshold. Or,
a triggering module 6013, configured to monitor a system log of the device where the page response is located, determine whether to end screen recording according to the system log, and trigger an instruction to end screen recording if it is determined that screen recording is ended. Or,
and the triggering module 6013 is configured to monitor whether the second control appears, and if the second control appears, trigger an instruction to end screen recording.
< terminal device >
Referring to fig. 9, a terminal device 700 according to an embodiment of the present invention is illustrated, where the terminal device 700 includes the following modules:
the obtaining module 601 is configured to obtain a screen recording of a page response, where the page response is caused by an event of operating a first control, and the screen recording includes a process from occurrence of the event of operating the first control to end of the page response.
An extracting module 602, configured to extract a page feature from a frame page of a last frame or multiple frames of the frame sequence of the screen recording.
A determining module 603, configured to determine a response frame page from the frame sequence recorded on the screen according to the extracted page feature.
The calculating module 604 is configured to calculate time consumed by the page response according to a time when the event for operating the first control occurs and a time when the response frame page occurs.
And the performance improving module 605 is configured to, if the time consumed by the page response is greater than the preset second time threshold, perform an operation that is usable for improving the performance of the page response. The operations include any one or any combination of the following:
prompting a user to check the network environment;
prompting a user to clean equipment garbage;
prompting a user to close the inactive application or directly closing the inactive application;
and prompting a user to set the application to which the page response belongs to a minimalist page mode or directly setting the application to which the page response belongs to the minimalist page mode.
By using the above manner, the page response performance of the terminal device 700 can be improved.
< means for testing Page response Performance >
Fig. 10 is a schematic diagram of a test apparatus 800 according to an embodiment of the present invention, where the test apparatus 800 is used for testing page response performance, and the test apparatus 800 includes a memory 802 and a processor 801.
The memory 802 stores a computer program which, when executed by the processor 801, implements the method of testing page response performance as described above.
The device for testing the page response performance provided by the embodiment of the invention can automatically confirm the time when the response frame page appears according to the page characteristics of the last frames of the page response, thereby determining the time consumed by the page response. The device for testing the page response performance provided by the embodiment of the invention can automatically confirm the time when the response frame page appears, thereby improving the testing efficiency. According to the device for testing the page response performance, provided by the embodiment of the invention, the page of the response frame is confirmed according to the page characteristics of the last frames of the page response, so that the test result can reflect the intuitive feeling of the user on the page response.
< terminal device >
Fig. 11 is a schematic diagram of a terminal device 900 according to an embodiment of the present invention, where the terminal device 900 includes a memory 902, a processor 901, and a display 903.
The memory 902 stores a computer program which, when executed by the processor 901, implements the method of testing page response performance as described above.
Further, the computer program, when executed by the processor 901, further implements the following method:
if the time consumed by the page response is greater than a preset second time threshold, executing any one or any combination of the following operations:
prompting a user to check the network environment;
prompting a user to clean equipment garbage;
prompting a user to close the inactive application or directly closing the inactive application;
and prompting a user to set the application to which the page response belongs to a minimalist page mode or directly setting the application to which the page response belongs to the minimalist page mode.
By using the above manner, the page response performance of the terminal device 900 can be improved.
Embodiments of the present invention further provide a computer readable medium, on which a computer program is stored, and when the computer program is executed by a processor, the method for testing page response performance in the foregoing embodiments or the method for improving page response performance in the foregoing embodiments is implemented.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the device and apparatus embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for relevant points.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The present invention may be a system, method and/or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied therewith for causing a processor to implement various aspects of the present invention.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present invention may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, aspects of the present invention are implemented by personalizing an electronic circuit, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA), with state information of computer-readable program instructions, which can execute the computer-readable program instructions.
Aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, by software, and by a combination of software and hardware are equivalent.
Having described embodiments of the present invention, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope of the described embodiments. The terms used herein were chosen in order to best explain the principles of the embodiments, the practical application, or technical improvements to the techniques in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the invention is defined by the appended claims.