A Performance Testing Method, Device, Testing Equipment and Medium for an Application Program
By collecting image frames and calculating the difference in the application performance test, the test end time is automatically determined, and the interference problem of existing testing methods on the application is solved, and simplified operation and automated testing are achieved.
Patent Information
- Application Number
- CN202111314900.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-08
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2041-11-08
AI Technical Summary
Existing application performance testing methods such as screen recording and external device shooting testing methods have interference effects on the normal operation of the application, and it is impossible to achieve complete automated testing, and the testing process is complicated.
By sending test start instructions to the device under test at the test start time, multiple image frames of the display interface are collected, the image frame difference is calculated, the target image frame is automatically determined as the test end time, and the delay and fluency of the target application are calculated.
Without affecting the normal operation of the application, manual operation of performance testing is simplified, automated testing is realized, and testing efficiency is improved.
Smart Images

Figure CN113886273B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of application program testing, and particularly to a performance testing method, device, testing equipment and medium for an application program. Background Art
[0002] Before an application program is put into operation and after it is put into operation, performance testing needs to be performed on it. For example, latency testing and fluency testing can be performed on the application program, etc., so as to timely understand the corresponding performance of the application program and avoid the user experience being affected due to performance problems of the application program.
[0003] Taking the latency testing of an application program as an example, the current latency testing methods for application programs mainly include: a screen recording testing method and an external device shooting testing method. Among them, the screen recording testing method is to record the screen of the application program under test to generate a video, and then perform frame-by-frame analysis on the video to obtain latency data. The external device shooting testing method is to shoot a video of the application program under test through an external device (such as a high-speed camera), and then perform frame-by-frame analysis on the shot video to obtain latency data.
[0004] However, since the screen recording testing method is that the device installing the application program under test records the screen of the application program under test, the screen recording operation will interfere with the normal operation of the application program under test, and the testing process is complicated; for the external device shooting testing method, since it is to shoot a video of the application program under test, this method requires manual judgment to find out the test start image frame and the test end image frame frame by frame from multiple frames of images in the shot video, and cannot fully realize automated testing and the testing process is complicated. Summary of the Invention
[0005] The purpose of the embodiments of the present invention is to provide a performance testing method, device, testing equipment and medium for an application program, so as to simplify the manual operation of the performance testing of the application program and realize automated testing on the premise of not affecting the normal operation of the application program. The specific technical solutions are as follows:
[0006] To achieve the above purpose, the embodiments of the present invention provide a performance testing method for an application program, which is applied to a testing device in a testing system, and the testing system further includes a device under test. The method includes:
[0007] Sending a test start instruction to the device under test at the test start moment, and collecting multiple image frames of the display interface of the device under test starting from the test start moment; the test start instruction is used to instruct the target application program installed on the device under test to perform a target operation;
[0008] For each image frame other than the first frame, calculating the image difference degree of this image frame compared with the previous image frame as the difference degree corresponding to this image frame;
[0009] Based on the difference degree, determine a target image frame from each of the image frames, and use the acquisition time of the target image frame as the test end time; the target image frame is: the first image frame among the multiple image frames that identifies that the target application has executed the target operation;
[0010] Determine the duration between the test start time and the test end time as the latency of the target application.
[0011] Further, after calculating, for each image frame other than the first frame, the image difference degree between this image frame and the previous image frame as the difference degree corresponding to this image frame, the method further includes:
[0012] Determine the image frame with a difference degree exceeding the first preset difference degree threshold and the closest acquisition time to the test start time as the start image frame;
[0013] Determine the candidate image frame with the closest acquisition time to the acquisition time of the start image frame among the candidate image frames as the end image frame, where the candidate image frames are the first preset number of consecutive image frames after the start image frame whose corresponding difference degrees are not greater than the second preset difference degree threshold;
[0014] Determine the ratio of the number of image frame changes to the fluency test duration as the fluency of the target application, where the number of image frame changes is the number of image frames with a difference degree greater than or equal to the second preset difference degree threshold among the image frames from the start image frame to the end image frame; the fluency test duration is the duration between the acquisition time of the start image frame and the acquisition time of the end image frame.
[0015] Further, the calculating the image difference degree between this image frame and the previous image frame as the difference degree corresponding to this image frame includes:
[0016] For each pixel point in a preset area of this image frame, determine the difference value between the pixel value of this pixel point and the pixel value of the corresponding pixel point in the previous image frame of this image frame;
[0017] Determine the ratio of the number of pixel points in this image frame with a corresponding difference value greater than the preset pixel difference threshold to the number of pixel points in the preset area as the difference degree corresponding to this image frame.
[0018] Further, the based on the difference degree, determining a target image frame from each of the image frames includes:
[0019] Determine the image frames with a difference degree exceeding the third preset difference degree threshold as candidate image frames; take the candidate image frame with the closest acquisition time to the test start time as the current candidate image frame; determine whether the current candidate image frame meets the preset target condition. If it meets, determine the current candidate image frame as the target image frame. If it does not meet, take the candidate image frame that is adjacent to the current candidate image frame and has an acquisition time after the current candidate image frame as the new current candidate image frame, and return to execute the step of determining whether the current candidate image frame meets the preset target condition; wherein, the current candidate image frame meets the preset target condition as follows: the number of image frames between the candidate image frame that is adjacent to the current candidate image frame and has an acquisition time before the current candidate image frame and the current candidate image frame exceeds the second preset number; or, the number of image frames between the candidate image frame that is adjacent to the current candidate image frame and has an acquisition time before the current candidate image frame and the current candidate image frame is less than the second preset number and not less than the third preset number, and the average value of the difference degrees corresponding to the image frames between the candidate image frame that is adjacent to the current candidate image frame and has an acquisition time before the current candidate image frame and the current candidate image frame is greater than the preset average value threshold; or, the number of image frames between the candidate image frame that is adjacent to the current candidate image frame and has an acquisition time after the current candidate image frame and the current candidate image frame is less than the second preset number and not less than the third preset number, and the average value of the difference degrees corresponding to the image frames between the candidate image frame that is adjacent to the current candidate image frame and has an acquisition time after the current candidate image frame and the current candidate image frame is not greater than the preset average value threshold;
[0020] Or,
[0021] Determine the image frame with a difference degree exceeding the third preset difference degree threshold and the closest acquisition time to the test start time as the target image frame.
[0022] Further, the test system further includes an image acquisition card; the image acquisition card is respectively connected to the test device and the device under test;
[0023] The step of collecting multiple image frames of the display interface of the device under test starting from the test start time includes:
[0024] Obtain multiple image frames of the display interface of the device under test collected by the image acquisition card starting from the test start time.
[0025] Further, the test system further includes a video recording device, and the video recording device is connected to the test device;
[0026] The step of collecting multiple image frames of the display interface of the device under test starting from the test start time includes:
[0027] Receive the video under test sent by the video recording device; the video under test is: a video of the display interface of the device under test recorded by the video recording device.
[0028] Perform frame splitting on the video under test to obtain a plurality of image frames.
[0029] Further, before receiving the video under test sent by the video recording device, the method further includes:
[0030] Obtain the actual duration of the video under test and the recording end time when the video recording device actually records the video under test;
[0031] Calculate the sum of the difference between the test start time and the recording end time and the actual duration as the calibrated test start time.
[0032] The step of determining the duration between the test start time and the test end time as the latency of the target application includes:
[0033] Determine the duration between the calibrated test start time and the test end time as the latency of the target application.
[0034] To achieve the above object, an embodiment of the present invention further provides a performance test system for an application, including: a test device and a device under test;
[0035] The test device is configured to send a test start instruction to the device under test at the test start time, and start collecting a plurality of image frames of the display interface of the device under test from the test start time; for each image frame other than the first frame, calculate the image difference degree of this image frame compared with the previous image frame as the difference degree corresponding to this image frame; based on the difference degree, determine a target image frame from each of the image frames, and use the acquisition time of the target image frame as the test end time; determine the duration between the test start time and the test end time as the latency of the target application; wherein, the target image frame is: the first image frame in the plurality of image frames that identifies that the target application has executed the target operation; the test start instruction is used to instruct the target application installed on the device under test to execute the target operation.
[0036] The device under test is configured to receive the test start instruction sent by the test device at the test start time, and instruct the installed target application to execute the target operation based on the test start instruction.
[0037] Further, the test system further includes an image acquisition card; the image acquisition card is respectively connected to the test device and the device under test;
[0038] The image acquisition card is configured to acquire multiple image frames of the display interface of the device under test starting from the test start time;
[0039] The test device is configured to obtain multiple image frames of the display interface of the device under test acquired by the image acquisition card starting from the test start time.
[0040] Further, the test system further includes a video recording device, and the video recording device is connected to the test device;
[0041] The video recording device is configured to record a video of the display interface of the device under test as the video under test;
[0042] The test device is configured to receive the video under test sent by the video recording device; perform frame division processing on the video under test to obtain multiple image frames.
[0043] To achieve the above object, an embodiment of the present invention further provides a performance testing device for an application program, which is applied to a test device in a test system. The test system further includes a device under test. The device includes:
[0044] An image acquisition module, configured to send a test start instruction to the device under test at the test start time, and acquire multiple image frames of the display interface of the device under test starting from the test start time; the test start instruction is used to instruct the target application program installed in the device under test to perform a target operation;
[0045] A difference calculation module, configured to calculate the image difference between each non-first image frame and the previous image frame as the difference corresponding to the image frame;
[0046] A target image determination module, configured to determine a target image frame from each of the image frames based on the difference, and use the acquisition time of the target image frame as the test end time; the target image frame is: the first image frame in the multiple image frames that identifies that the target application program has performed the target operation;
[0047] A time delay determination module, configured to determine the duration between the test start time and the test end time as the time delay of the target application program.
[0048] An embodiment of the present invention further provides a test device. The test device includes a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus;
[0049] A memory for storing computer programs;
[0050] A processor, when executing the programs stored in the memory, implements the steps of the performance testing method of any of the above-mentioned application programs.
[0051] An embodiment of the present invention also provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of the performance testing method of any of the above-mentioned application programs are implemented.
[0052] An embodiment of the present invention also provides a computer program product containing instructions, which when running on a computer, causes the computer to execute the steps of the performance testing method of any of the above-mentioned application programs.
[0053] Using the method provided by the embodiment of the present invention, a test start instruction is sent to the device under test at the test start moment, and a plurality of image frames of the display interface of the device under test are collected starting from the test start moment; for each image frame other than the first frame, calculate the image difference degree of this image frame compared with the previous image frame as the difference degree corresponding to this image frame; based on the difference degree, determine the target image frame from each image frame, and use the acquisition moment of the target image frame as the test end moment; determine the duration between the test start moment and the test end moment as the latency of the target application program. That is, by sending a test start instruction to the device under test at the test start moment, instructing the target application program to perform the target operation, and collecting a plurality of image frames of the display interface of the device under test starting from the test start moment, and determining the test end moment corresponding to the target image frame by analyzing the difference degree of the image frames, and obtaining the duration between the test start moment and the test end moment as the latency of the target application program, the manual operation of the performance testing of the application program is simplified and automated testing is achieved without affecting the normal operation of the application program.
[0054] Of course, when implementing any product or method of the present invention, it is not necessarily required to achieve all the above-mentioned advantages at the same time. Description of the Drawings
[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art.
[0056] Figure 1 It is a flowchart of a performance testing method for an application program provided by an embodiment of the present invention;
[0057] Figure 2 It is a schematic diagram of pixel points of two consecutive image frames;
[0058] Figure 3 Another flowchart of the performance testing method for the application program provided by the embodiment of the present invention;
[0059] Figure 4 Yet another flowchart of the performance testing method for the application program provided by the embodiment of the present invention;
[0060] Figure 5 A structural schematic diagram of the performance testing system for the application program provided by the embodiment of the present invention;
[0061] Figure 6 Another structural schematic diagram of the performance testing system for the application program provided by the embodiment of the present invention;
[0062] Figure 7 A structural schematic diagram of the testing system provided by the embodiment of the present invention;
[0063] Figure 8 Yet another structural schematic diagram of the performance testing system for the application program provided by the embodiment of the present invention;
[0064] Figure 9 A structural schematic diagram of the performance testing device for the application program provided by the embodiment of the present invention;
[0065] Figure 10 Another structural schematic diagram of the performance testing device for the application program provided by the embodiment of the present invention;
[0066] Figure 11 A structural schematic diagram of a testing device provided by the embodiment of the present invention. Detailed implementation manners
[0067] Next, the technical solutions in the embodiments of the present invention will be described in conjunction with the accompanying drawings in the embodiments of the present invention.
[0068] Figure 1 A flowchart of the performance testing method for the application program provided by the embodiment of the present invention. This method can be applied to the testing device in the testing system, and the testing system further includes the device under test. Refer to Figure 1 , and the method includes the following steps:
[0069] Step 101, send a test start instruction to the device under test at the test start moment, and collect multiple image frames of the display interface of the device under test starting from the test start moment; the test start instruction is used to instruct the target application program installed on the device under test to perform a target operation.
[0070] In the embodiments of the present invention, the target application can be any APP (Application, mobile software) and web page with a display interface. For example, the target application can be a video APP, a web page, and so on. The device under test can be a device installed with various application programs (including the target application). For example, the device under test can be a television connected to a set-top box, a set-top box, a computer, and other devices. The test device can be an electronic device such as a mobile phone, a computer, or a tablet computer.
[0071] In the embodiments of the present invention, the target operation can be an operation to start the target application, or other operations to run the target application, etc. For example, if the target application can be a video APP, the target operation can be to open the video APP, or the target operation can also be to play a certain video file in the video APP.
[0072] In the embodiments of the present invention, the test device can emit a test start instruction through an infrared learning transmitter at the test start moment. Among them, the infrared learning transmitter can pre-learn different test start instructions corresponding to different infrared signals. For example, it can be learned that: the test start instruction A is used to instruct the target application A installed on the device under test to perform a start operation, and the test start instruction B is used to instruct the target application B installed on the device under test to perform a run operation. In the embodiments of the present invention, the target application whose performance needs to be tested can be determined in advance, and the infrared learning transmitter can emit the corresponding test start instruction according to the type of the target application to be tested determined in advance.
[0073] In the embodiments of the present invention, the test device can also send a test start instruction to the device under test through adb (android debug bridge, an Android debugging bridge, that is, the connection channel between the test device and the device under test) at the test start moment.
[0074] In the embodiments of the present invention, multiple image frames of the display interface of the device under test can be collected at a collection frequency of 60 frames per second. In the embodiments of the present invention, the image frames of the display interface of the device under test can also be collected at a collection frequency of 240 frames per second, and then the image frames collected per second are equally divided into 60 groups, and each group includes 4 image frames; for each group of image frames in the 60 groups per second, the nth image frame in each group can be selected according to the change node; then the 60 image frames selected per second are used as the multiple image frames of the display interface of the device under test finally collected in that second. Among them, 1 ≤ n ≤ 4.
[0075] Step 102, for each image frame other than the first frame, calculate the image difference degree of this image frame compared with the previous image frame as the difference degree corresponding to this image frame.
[0076] In an embodiment of the present invention, before determining the difference degree corresponding to an image frame, each image frame can be first converted into a format that can be processed by a test device.
[0077] In this step, for each image frame other than the first frame, determining the difference degree corresponding to this image frame can specifically include steps A1 - A2:
[0078] Step A1: For each pixel point in a preset area of this image frame, determine the difference value between the pixel value of this pixel point and the pixel value of the corresponding pixel point in the previous image frame of this image frame.
[0079] Step A2: Based on the number of pixel points in this image frame whose corresponding difference values are greater than a preset pixel difference threshold and the number of pixel points in the preset area, determine it as the difference degree corresponding to this image frame.
[0080] Among them, the preset area in the image frame can be specifically determined according to the actual application situation. For example, the preset area can be a partial area of the image frame or the entire area of the image frame, and this preset area is the area where pixel comparison is actually required. The preset pixel difference threshold can also be specifically determined according to the actual application situation, and no specific limitation is made here. For example, Figure 2 is a schematic diagram of pixel points of two consecutive image frames. See Figure 2 , image frame B is the previous frame image of image frame A. The preset area actually required for pixel comparison determined in image frame A is preset area Z A , the preset area Z in image frame A A The corresponding area in image frame B is preset area Z B . Preset area Z A includes pixel points a, b, c, and d; preset area Z B includes pixel points a1, b1, c1, and d1. For each pixel point in the preset area Z A in image frame A and each pixel point in the preset area Z B in image frame B, the following formula can be used to calculate the average pixel value corresponding to this pixel point:
[0081] Among them, P is the average pixel value corresponding to this pixel point, x is the original pixel value of this pixel point, α is the weight corresponding to this pixel point, i is the number of adjacent pixel points of this pixel point, is the original pixel value of the i-th adjacent pixel point of this pixel point, β is the weight corresponding to the adjacent pixel point of this pixel point, and α is greater than β. Specifically, the values of α and β can be: α is equal to 2, and β is equal to 1.
[0082] The average pixel values corresponding to pixel points a, b, c, d, as well as pixel points a1, b1, c1, and d1 can be calculated using the above formula.
[0083] The difference between the average pixel value of pixel point a in image frame A and the average pixel value of the corresponding pixel point a1 in image frame B can be calculated respectively as the difference value of pixel point a; in the same way, the difference values of pixel points b, c, and d can be calculated respectively.
[0084] Furthermore, among pixel points a, b, c, and d, the ratio of the number of pixel points whose difference values are greater than the preset pixel difference threshold to the number of pixel points in the preset area Z in image frame A A can be determined as the difference degree corresponding to image frame A. For example, if the difference values of pixel points c and d are both greater than the preset pixel difference threshold, the difference degree of image frame A can be calculated as: 2 / 4 = 0.5.
[0085] Step 103: Based on the difference degree, determine the target image frame from each image frame, and use the acquisition time of the target image frame as the test end time.
[0086] Among them, the target image frame is the first image frame in multiple image frames that indicates that the target application has executed the target operation.
[0087] In the embodiments of the present invention, when the target application executes the target operation and there are interferences of scene changes in the display interface of the device under test, such as continuous video playback, video cut, or dragging the video playback bar on the device under test, the determination of the target image frame in these cases can be in the following manner including steps B1 - B4:
[0088] Take the alternative image frame with the closest acquisition time to the test start time as the current alternative image frame; determine whether the current alternative image frame meets the preset target condition. If it meets, determine the current alternative image frame as the target image frame. If it does not meet, take the alternative image frame that is adjacent to the current alternative image frame and has an acquisition time after the current alternative image frame as the new current alternative image frame, and return to execute the step of determining whether the current alternative image frame meets the preset target condition; wherein, the current alternative image frame meets the preset target condition as follows: the number of image frames between the alternative image frame that is adjacent to the current alternative image frame and has an acquisition time before the current alternative image frame and the current alternative image frame exceeds the second preset number; or, the number of image frames between the alternative image frame that is adjacent to the current alternative image frame and has an acquisition time before the current alternative image frame and the current alternative image frame is less than the second preset number and not less than the third preset number, and the average value of the difference degrees corresponding to the image frames between the alternative image frame that is adjacent to the current alternative image frame and has an acquisition time before the current alternative image frame and the current alternative image frame is greater than the preset average value threshold; or, the number of image frames between the alternative image frame that is adjacent to the current alternative image frame and has an acquisition time after the current alternative image frame and the current alternative image frame is less than the second preset number and not less than the third preset number, and the average value of the difference degrees corresponding to the image frames between the alternative image frame that is adjacent to the current alternative image frame and has an acquisition time after the current alternative image frame and the current alternative image frame is not greater than the preset average value threshold;
[0089] Step B1: Determine the image frames with a difference degree exceeding the third preset difference degree threshold as alternative image frames;
[0090] Step B2: Determine whether the current alternative image frame meets the preset target condition. If it meets, execute Step B3. If it does not meet, execute Step B4;
[0091] Step B3: Determine the current alternative image frame as the target image frame;
[0092] Step B4: Take the alternative image frame that is adjacent to the current alternative image frame and has an acquisition time after the current alternative image frame as the new current alternative image frame, and return to execute Step B2.
[0093] In an embodiment of the present invention, the condition that the current candidate image frame meets the preset target condition is as follows: the number of image frames between the candidate image frame whose acquisition time is before the current candidate image frame and adjacent to the current candidate image frame and the current candidate image frame exceeds a second preset number; or, the number of image frames between the candidate image frame whose acquisition time is before the current candidate image frame and adjacent to the current candidate image frame and the current candidate image frame is less than the second preset number and not less than a third preset number, and the average value of the difference degrees corresponding to the image frames between the candidate image frame whose acquisition time is before the current candidate image frame and adjacent to the current candidate image frame and the current candidate image frame is greater than a preset average value threshold; or, the number of image frames between the candidate image frame whose acquisition time is after the current candidate image frame and adjacent to the current candidate image frame and the current candidate image frame is less than the second preset number and not less than a third preset number, and the average value of the difference degrees corresponding to the image frames between the candidate image frame whose acquisition time is after the current candidate image frame and adjacent to the current candidate image frame and the current candidate image frame is not greater than a preset average value threshold.
[0094] Among them, the third preset difference threshold can be specifically set according to the actual application situation, and no specific limitation is made here. The second preset number can be set to 70 or 80, etc. according to the actual application situation, the second preset number can be set to 42 or 45, etc. according to the actual application situation, and the preset average value threshold can be set to 0.012 or 0.013, etc. according to the actual application situation.
[0095] In an embodiment of the present invention, the image frame with a difference degree exceeding the third preset difference threshold and the closest acquisition time to the test start time can be determined as the target image frame.
[0096] In an embodiment of the present invention, for each image frame, if the difference degree of the image frame is greater than or equal to a fourth preset difference threshold, and the sum of the difference degrees of the adjacent image frame (the adjacent image frame in the front or the adjacent image frame in the back) of the image frame and the difference degree of the image frame is greater than or equal to a fifth preset difference threshold, then the image frame can also be determined as the target image frame. Among them, the fifth preset difference threshold is greater than the third preset difference threshold, and the third preset difference threshold is greater than the fourth preset difference threshold. And the third preset difference threshold, the fourth preset difference threshold, and the fifth preset difference threshold can be specifically set according to the actual application situation, and no specific limitation is made here.
[0097] In an embodiment of the present invention, for the case where the difference degree of the image frames shows a fixed change rule, the nth image frame with a difference degree greater than the third preset difference threshold selected in sequence or in reverse order can also be specified as the target image frame. Among them, n can be set to 2 or 3, etc. according to the actual application situation.
[0098] In the embodiments of the present invention, each image frame may carry a timestamp, and the timestamp of each image frame represents the moment when the image frame is captured, that is, the capture moment of each image frame.
[0099] Step 104: Determine the duration between the test start moment and the test end moment as the latency of the target application.
[0100] In the embodiments of the present invention, the latency of the target application can be used to reflect the reaction performance of the target application when performing the target operation. The smaller the latency of the target application, the faster the target application reacts when performing the target operation, and the better the user experience of using the target application.
[0101] Using the method provided in the embodiments of the present invention, send a test start instruction to the device under test at the test start moment, and start collecting multiple image frames of the display interface of the device under test from the test start moment; for each image frame other than the first frame, calculate the image difference degree of this image frame compared to the previous image frame as the difference degree corresponding to this image frame; based on the difference degree, determine the target image frame from each image frame, and use the capture moment of the target image frame as the test end moment; determine the duration between the test start moment and the test end moment as the latency of the target application. That is, by sending a test start instruction to the device under test at the test start moment, instructing the target application to perform the target operation, and starting to collect multiple image frames of the display interface of the device under test from the test start moment, determining the test end moment corresponding to the target image frame by analyzing the difference degree of the image frames, and obtaining the duration between the test start moment and the test end moment as the latency of the target application, the manual operation of the performance test of the application is simplified and automated testing is achieved without affecting the normal operation of the application.
[0102] Figure 3 Another flowchart of the performance test method for the application provided in the embodiments of the present invention. This method can be applied to the test device in the test system. The test system also includes the device under test. Refer to Figure 3 This method includes the following steps:
[0103] Steps 301 - 304 correspond to Steps 101 - 104 respectively and are the same, so they will not be elaborated here.
[0104] Step 305: Determine the image frame with a difference degree exceeding the first preset difference degree threshold and the closest capture moment to the test start moment as the starting image frame.
[0105] A Among them, the first preset difference degree threshold can be specifically set according to the actual application situation and will not be specifically limited here.
[0106] Step 306: Determine the terminal image frame as the candidate image frame in which the acquisition time is closest to the acquisition time of the starting image frame among the candidate image frames.
[0107] Among them, the candidate image frames are the first preset number of consecutive image frames after the starting image frame, and the difference degrees corresponding to each of them are not greater than the second preset difference degree threshold. The second preset difference degree threshold can be specifically set according to the actual application situation and is not specifically limited here. The first preset number can also be specifically set according to the actual application situation. For example, it can be set to 7 and is not specifically limited here.
[0108] Step 307: Determine the ratio of the number of changed image frames to the fluency test duration as the fluency of the target application program. Among them, the number of changed image frames is the number of image frames in which the difference degree is greater than or equal to the second preset difference degree threshold among the image frames from the starting image frame to the terminal image frame; the fluency test duration is the duration between the acquisition time of the starting image frame and the acquisition time of the terminal image frame.
[0109] Among them, the fluency of the target application program reflects the reaction fluency of the target application program. Moreover, the greater the fluency of the target application program, the better the reaction fluency of the target application program and the better the user experience of the target application program.
[0110] By using the method provided in the embodiment of the present invention, the duration between the test start time and the test end time can be directly determined as the latency of the target application program, and the ratio of the number of changed image frames to the fluency test duration can be determined as the fluency of the target application program. It realizes the simplification of the performance test process of the latency and fluency of the application software without affecting the normal operation of the application software.
[0111] In an embodiment of the present invention, in a possible implementation manner, the test system includes a test device, a device under test, and an image acquisition card. The image acquisition card is respectively connected to the test device and the device under test. For a device under test with an HDMI (High-Definition Multimedia Interface) output, such as a set-top box, etc., an image acquisition card with an HDMI interface can be used to collect multiple image frames of the display interface of the device under test starting from the test start time. The device under test can obtain multiple image frames of the display interface of the device under test collected by the image acquisition card starting from the test start time from the image acquisition card.
[0112] In the above steps 301-307, for the target application software in the device under test, the smoothness test and the latency test are integrated into one test process. In the embodiments of the present invention, for the target application software in the device under test, the smoothness and latency of the target application software can also be tested separately. For example, the test process composed of the above steps 301, 302, 305, 306, and 307 can be used as the test process for the smoothness of the target application software alone.
[0113] In another possible implementation, the test system includes a test device, a device under test, and a video recording device, and the video recording device is connected to the test device. For a device under test that only has an HDMI input but no HDMI output (such as a smart TV), and a device under test that neither has an HDMI input nor an HDMI output, the video of the display interface of the device under test can be recorded by the video recording device. Figure 4 Another flowchart of the performance test method for the application program provided by the embodiments of the present invention. This method can be applied to the test device in the test system. The test system further includes a device under test and a video recording device, and the video recording device is connected to the test device. Refer to Figure 4 , and the method includes the following steps:
[0114] Step 401, obtain the actual duration of the video under test and the recording end time when the video recording device actually records the video under test.
[0115] In the embodiments of the present invention, the recording end time when the video recording device actually records the video under test and the recording start time when the video recording device actually records the video under test are stored in the log file of the video recording device. The actual duration of the video under test is usually less than the duration between the recording start time and the recording end time.
[0116] Step 402, calculate the sum of the difference between the test start time and the recording end time and the actual duration as the calibrated test start time.
[0117] Since there may be differences in the clocks configured for devices such as the test device and the device under test, in the embodiments of the present invention, the clocks configured for devices such as the test device and the device under test can also be periodically calibrated to ensure that the times of all devices are unified. Specifically, the time of the clock configured for any one device (such as the test device or the device under test) can be used as the standard time. At the initial stage and during the test stage of the test (such as every hour), calculate the difference between the times of other devices and the standard time of this device, and calibrate the times of the clocks configured for other devices so that the times of the clocks configured for all devices are unified.
[0118] Step 403: Receive the video under test sent by the video recording device; the video under test is a video of the display interface of the device under test recorded by the video recording device starting from the test start time.
[0119] Step 404: Perform frame splitting on the video under test to obtain multiple image frames.
[0120] In this step, a computer program (ffmpeg) can be used to extract the image frames in the video under test one by one to obtain multiple image frames, and each image frame is accompanied by a timestamp, which represents the moment when each image frame is recorded by the video recording device.
[0121] Step 405: For each image frame other than the first frame, calculate the image difference degree of this image frame compared with the previous image frame as the difference degree corresponding to this image frame.
[0122] In this step, for each image frame other than the first frame, before determining the image difference degree of this image frame compared with the previous image frame, interference removal processing and denoising processing can be performed on each image frame. Specifically, any existing image denoising processing method can be used for the denoising processing of each image frame, and no specific limitation is made here.
[0123] In this step, for each image frame other than the first frame, the image difference degree of this image frame compared with the previous image frame can be determined based on dhash (image difference hashing algorithm) as the difference degree corresponding to this image frame. Specifically, it can be illustrated by an example:
[0124] Each image frame can be grayscale processed to obtain each grayscale processed image frame; then, each grayscale processed image frame can be scaled, and each grayscale processed image frame can be scaled to a size of 9×8 pixels; for each scaled image frame of 9×8 pixels, it can be calculated whether the latter pixel in each row is greater than the previous pixel. If it is greater, it is recorded as 1, otherwise it is recorded as 0, to obtain an array of 1×8 corresponding to this row; for each row, an array of 1×8 can be obtained, then for each image frame, a two-dimensional array of 8×8 can be obtained; then, the two-dimensional array of 8×8 corresponding to each image frame can be spliced by rows and converted into a one-dimensional array of 64 elements; for each image frame, calculate the number of different elements between the one-dimensional array of 64 elements corresponding to this image frame and the one-dimensional array of 64 elements corresponding to the image frame before this image frame, and determine the ratio of this number to the size of the one-dimensional array corresponding to this image frame (i.e., 64) as the difference degree corresponding to this image frame.
[0125] In the embodiments of the present invention, other methods for calculating the image difference degree (for example: perceptual hashing algorithm or average hashing algorithm) can also be used to calculate the image difference degree of each image frame compared with the previous image frame. The embodiments of the present invention do not specifically limit the method for calculating the image difference degree.
[0126] Step 406: Based on the difference degree, determine the target image frame from each image frame, and use the acquisition moment of the target image frame as the test end moment; the target image frame is: the first image frame in multiple image frames that identifies that the target application has executed the target operation.
[0127] In the embodiments of the present invention, the log file of the device under test can also be collected during the test process. The log file of the device under test includes the buried point reference time point, and the buried point reference time point is the time point predicted in advance by the staff when the target image frame appears. Then, the image frame corresponding to the buried point reference time point can be obtained from multiple image frames as the buried point image frame, and the image frames with a difference degree greater than the sixth preset difference threshold are searched for as the target image frames within the time range before and after the buried point image frame; wherein, the sixth preset difference threshold is less than or equal to the third preset difference threshold. If the target image frame cannot be found, the other method for determining the target image frame provided by the embodiments of the present invention is used to search for the target image frame. Among them, the time range before and after the buried point image frame can be set according to the actual test situation. For example, it can be set as: the time range from 3 seconds before the buried point reference time point to 3 seconds after the buried point reference time point, and no specific limitation is made here.
[0128] In the embodiments of the present invention, the image frame with a difference degree greater than the third preset difference threshold in each image frame and the recording moment closest to the test start moment can also be determined as the target image frame.
[0129] Step 407: Determine the duration between the calibrated test start moment and the test end moment as the time delay of the target application.
[0130] By adopting the method provided by the embodiments of the present invention, the video under test is obtained; the video under test is frame-divided to obtain multiple image frames; for each image frame, the image difference degree of the image frame compared with the previous image frame is determined as the difference degree corresponding to the image frame; based on the difference degrees corresponding to each image frame, the target image frame is determined from each image frame; based on the test start moment and the recording moment corresponding to the target image frame in the video under test, the time delay of the target application is determined, which simplifies the performance test process of the application software without affecting the normal operation of the application software. Moreover, the test process does not require manual attendance, improving the test efficiency.
[0131] In the embodiments of the present invention, for the case where the difference degree of image frames is relatively small, the specific values of each preset difference degree threshold can usually be set to be relatively small. For the mobile phone recording mode, if recording interference occurs when calculating the difference degree of image frames, after determining the target image frame, the first determined target image frame can be used as the first target image frame, and then the difference degrees of multiple (such as 5 or 8) image frames before and after the first target image frame are calculated to further determine the second target image frame as the final target image frame.
[0132] Figure 5 FIG. is a schematic structural diagram of a performance testing system for an application program provided by an embodiment of the present invention, as Figure 5 shown, the testing system includes: a testing device 510 and a device under test 520;
[0133] The testing device 510 is configured to send a test start instruction to the device under test 520 at the test start moment, and start collecting multiple image frames of the display interface of the device under test from the test start moment; for each image frame other than the first frame, calculate the image difference degree of this image frame compared with the previous image frame as the difference degree corresponding to this image frame; based on the difference degree, determine a target image frame from each of the image frames, and use the acquisition moment of the target image frame as the test end moment; determine the duration between the test start moment and the test end moment as the latency of the target application program; wherein, the target image frame is: the first frame image frame in the multiple image frames that identifies that the target application program has executed the target operation; the test start instruction is used to instruct the target application program installed in the device under test to execute the target operation;
[0134] The device under test 520 is configured to receive the test start instruction sent by the testing device 510 at the test start moment, and instruct the installed target application program to execute the target operation based on the test start instruction.
[0135] By using the system provided by the embodiments of the present invention, a test start instruction can be sent to the device under test at the test start moment to instruct the target application program to execute the target operation, and multiple image frames of the display interface of the device under test can be collected from the test start moment. By analyzing the difference degree of the image frames, the test end moment corresponding to the target image frame is determined, and the duration between the test start moment and the test end moment is obtained as the latency of the target application program, which simplifies the manual operation of the performance test of the application program and realizes automated testing without affecting the normal operation of the application program.
[0136] In a possible implementation manner, Figure 6 FIG. is another schematic structural diagram of a performance testing system for an application program provided by an embodiment of the present invention, asFigure 6 As shown, the test system further includes an image acquisition card 610; the image acquisition card 610 is respectively connected to the test device 510 and the device under test 520;
[0137] The image acquisition card 610 is used to acquire multiple image frames of the display interface of the device under test starting from the test start time;
[0138] The test device 510 is used to obtain multiple image frames of the display interface of the device under test acquired by the image acquisition card starting from the test start time.
[0139] For example, Figure 7 is a schematic structural diagram of a test system provided by an embodiment of the present invention. As Figure 7 shown, the device under test in the test system may include: a TV box (such as a set-top box), a splitter, and a display. The splitter can copy the HDMI signal data into multiple copies, input one copy of the HDMI signal data into the display for display, which is convenient for testers to observe; input the other copy of the HDMI signal data into the acquisition card for testing; the test device may specifically be a PC, such as a client of TVBenchmark (a standard inspection program for TVs). When the acquisition card starts to acquire the image frames of the device under test at the test start time, a test start instruction can be sent through the infrared learning transmitter at the test start time to instruct the target application installed on the device under test to perform a target operation. In the embodiment of the present invention, the target application whose performance needs to be tested can be determined in advance, and the infrared learning transmitter can send a corresponding test start instruction according to the type of the target application that needs to be tested determined in advance.
[0140] In the embodiment of the present invention, by sending a test start instruction through the infrared learning transmitter to instruct the target application installed on the device under test to perform a target operation, the operation of the user using an infrared remote control to send an infrared instruction can be more completely simulated, which is close to the user experience.
[0141] In another possible implementation manner, Figure 8 is another schematic structural diagram of the performance test system of the application program provided by the embodiment of the present invention. As Figure 8 shown, the test system further includes a video recording device 810; the video recording device 810 is connected to the test device 510;
[0142] The video recording device 810 is used to record a video of the display interface of the device under test starting from the test start time as the video under test;
[0143] The test device 510 is used to receive the video under test sent by the video recording device; perform frame division processing on the video under test to obtain multiple image frames.
[0144] Among them, the test device is connected to the device under test, and the test device can send a test start instruction to the device under test through adb at the test start moment.
[0145] In the test device 510 in the test system provided by the embodiments of the present invention, it can also be used to determine the starting image frame by determining the image frame with a difference degree exceeding the first preset difference degree threshold and the closest acquisition moment to the test start moment; determine the ending image frame as the candidate image frame with the closest acquisition moment to the acquisition moment of the starting image frame among the candidate image frames, where the candidate image frames are the first preset number of consecutive image frames after the starting image frame with a difference degree not greater than the second preset difference degree threshold; determine the ratio of the number of changed image frames to the smoothness test duration as the smoothness of the target application program, where the number of changed image frames is the number of image frames with a difference degree greater than or equal to the second preset difference degree threshold among the image frames included from the starting image frame to the ending image frame, and the smoothness test duration is the duration between the acquisition moment of the starting image frame and the acquisition moment of the ending image frame.
[0146] In the embodiments of the present invention, the tools for performance testing of application programs can include hardware and software. Among them, the hardware can include: HDMI capture card, infrared learning transmitter, video recording device (such as a mobile phone capable of recording at 60fps), and the electronic device on which the tool runs; the software can include: SDK module and GUI (Graphical User Interface) interface. The SDK can be developed in C++ language, and the GUI interface can be developed in Python language. The GUI interface can include: capture card mode and video recording mode. Among them, the capture card mode is the test method in the test system including a capture card, and the video recording mode is the test method in the test system including a video recording device. In the embodiments of the present invention, corresponding different GUI interfaces can also be designed for the capture card mode and the video recording mode respectively. The GUI interface is provided with: test script option, test app option, test round option, test time option, test start option, test stop option, test result display option, and test result save option. Among them, the test app option is used to select the target application program in the test device; the test script option is used to select the corresponding test method process for the target application program; the test round option is used to select the number of tests; the test time option is used to select the duration of a single test; the test start option is used to determine the start of the test; the test stop option is used to determine the end of the test; the test result display option is used to display the test result on the GUI interface; the test result save option is used to save the test result.
[0147] In the embodiments of the present invention, different test scripts can be set for different application scenarios. The test script includes keywords for each test step (including process keywords and operation keywords). The process keywords include: before, test, lastcode, and after; before, test, lastcode, and after divide the entire test process into a pre-test stage, an operation stage before the starting point of sending the test start instruction, a test operation stage after the starting point of sending the test start instruction, and a post-test stage; the operation keywords can include: install app, start app, close app, clear cache, call shell, sleep, turn on the camera, start recording, etc. Multiple test script options can be configured in the GUI interface to select different test scripts.
[0148] For example, in the GUI interface, first click the test start option; then determine whether the test device is connected to the device under test and the video recording device respectively. If the judgment result is yes, select the video recording device and the device under test. If the judgment result is no, prompt that the device connection is incorrect and wait for the connection of the two devices, then select the video recording device and the device under test; then select the test script, and determine whether the test script is written correctly. If there is an error, prompt that there is a problem with the test script. If it is correct, the test scenario is displayed on the GUI interface; configure the test data, and then start the test; control the video recording device to record the video under test according to the test process written in the test script; then save the video under test, analyze the video under test to obtain the test result, and save the test result. In the embodiments of the present invention, the test results of previous tests can be saved, and the analysis and comparison of the historical tests can be performed.
[0149] By using the system provided in the embodiments of the present invention, the time duration between the test start moment and the test end moment can be directly determined as the latency of the target application, and the ratio of the number of image frame changes to the smoothness test duration can be determined as the smoothness of the target application. The performance test process of the latency and smoothness of the application software is simplified without affecting the normal operation of the application software.
[0150] In the embodiments of the present invention, when using the capture card to test indicators such as latency and smoothness, the capture card can be directly connected to the set-top box and the test device through the HDMI interface, and the test start instruction is sent in combination with the infrared learning transmitter or adb. The latency test and smoothness test of the application software are realized through the capture card, the set-top box, and the test device; if the TV also has an HDMI interface, the capture card can also be directly connected to the test device and the TV with an HDMI interface, and the test start instruction is sent in combination with the infrared learning transmitter or adb. The latency test and smoothness test of the application software are realized through the capture card, the TV, and the test device.
[0151] In the embodiments of the present invention, when using a video recording device to test metrics such as latency and smoothness, the video recording device can be connected to the test device. By recording the display screen of the TV using the video recording device, video frame information of the TV can be obtained. Then, in combination with an infrared learning transmitter or an adb to send a test start instruction, the latency test and smoothness test of the application software can be directly implemented through the TV, the video recording device, and the test device. If a set-top box is connected to the TV, the video recording device can also obtain the data of the set-top box by recording the display screen of the TV, and implement the latency test and smoothness test of the corresponding application software of the set-top box.
[0152] Based on the same inventive concept, according to the method for testing the performance of an application program provided by the embodiments of the present invention, the embodiments of the present invention further provide an apparatus for testing the performance of an application program, which is applied to a test device in a test system. The test system further includes a device under test. Refer to Figure 9 , the apparatus includes:
[0153] An image acquisition module 901, configured to send a test start instruction to the device under test at a test start moment, and start collecting multiple image frames of the display interface of the device under test from the test start moment; the test start instruction is used to instruct a target application program installed in the device under test to perform a target operation;
[0154] A difference calculation module 902, configured to calculate, for each image frame other than the first frame, the image difference between the image frame and the previous image frame as the difference corresponding to the image frame;
[0155] A target image determination module 903, configured to determine a target image frame from each of the image frames based on the difference, and use the acquisition moment of the target image frame as the test end moment; the target image frame is: the first image frame in the multiple image frames that identifies that the target application program has performed the target operation;
[0156] A latency determination module 904, configured to determine the duration between the test start moment and the test end moment as the latency of the target application program.
[0157] Using the device provided by the embodiment of the present invention, a test start instruction is sent to the device under test at the test start moment, and multiple image frames of the display interface of the device under test are collected starting from the test start moment; for each image frame other than the first frame, the image difference degree of this image frame compared with the previous image frame is calculated as the difference degree corresponding to this image frame; based on the difference degree, the target image frame is determined from each image frame, and the acquisition moment of the target image frame is used as the test end moment; the duration between the test start moment and the test end moment is determined as the latency of the target application. That is, by sending a test start instruction to the device under test at the test start moment to instruct the target application to perform the target operation, and collecting multiple image frames of the display interface of the device under test starting from the test start moment, the test end moment corresponding to the target image frame is determined by analyzing the difference degree of the image frames, and the duration between the test start moment and the test end moment is obtained as the latency of the target application, which simplifies the manual operation of the performance test of the application and realizes the automated test without affecting the normal operation of the application.
[0158] Further, referring to Figure 10 , the device further includes: a fluency test module 1001, configured to determine the starting image frame as the image frame with a difference degree exceeding the first preset difference degree threshold and the closest acquisition moment to the test start moment; determine the ending image frame as the candidate image frame with the closest acquisition moment to the acquisition moment of the starting image frame among the candidate image frames, where the candidate image frames are the first preset number of consecutive image frames after the starting image frame whose corresponding difference degrees are not greater than the second preset difference degree threshold; determine the ratio of the number of image frame changes to the fluency test duration as the fluency of the target application, where the number of image frame changes is the number of image frames with a difference degree greater than or equal to the second preset difference degree threshold among the image frames included from the starting image frame to the ending image frame; the fluency test duration is the duration between the acquisition moment of the starting image frame and the acquisition moment of the ending image frame.
[0159] Further, the difference degree calculation module 902 is specifically configured to, for each pixel point in the preset area of this image frame, determine the difference value between the pixel value of this pixel point and the pixel value of the corresponding pixel point in the previous image frame of this image frame; determine the ratio of the number of pixel points with a corresponding difference value greater than the preset pixel difference threshold in this image frame to the number of pixel points in the preset area as the difference degree corresponding to this image frame.
[0160] Further, the target image determination module 903 is specifically configured to determine an image frame with a difference degree exceeding a third preset difference degree threshold as an alternative image frame; use the alternative image frame with the closest acquisition time to the test start time as the current alternative image frame; determine whether the current alternative image frame meets a preset target condition. If it meets the condition, determine the current alternative image frame as the target image frame. If it does not meet the condition, use the alternative image frame that is adjacent to the current alternative image frame and has an acquisition time after the current alternative image frame as the new current alternative image frame, and return to execute the step of determining whether the current alternative image frame meets the preset target condition; wherein, the current alternative image frame meets the preset target condition as follows: the number of image frames between the alternative image frame that is adjacent to the current alternative image frame and has an acquisition time before the current alternative image frame and the current alternative image frame exceeds a second preset number; or, the number of image frames between the alternative image frame that is adjacent to the current alternative image frame and has an acquisition time before the current alternative image frame and the current alternative image frame is less than the second preset number and not less than a third preset number, and the average value of the difference degrees corresponding to the image frames between the alternative image frame that is adjacent to the current alternative image frame and has an acquisition time before the current alternative image frame and the current alternative image frame is greater than a preset average value threshold; or, the number of image frames between the alternative image frame that is adjacent to the current alternative image frame and has an acquisition time after the current alternative image frame and the current alternative image frame is less than the second preset number and not less than a third preset number, and the average value of the difference degrees corresponding to the image frames between the alternative image frame that is adjacent to the current alternative image frame and has an acquisition time after the current alternative image frame and the current alternative image frame is not greater than a preset average value threshold.
[0161] Or, determine the image frame with a difference degree exceeding the third preset difference degree threshold and the closest acquisition time to the test start time as the target image frame.
[0162] Further, the test system further includes an image acquisition card; the image acquisition card is respectively connected to the test device and the device under test; the image acquisition module 901 is specifically configured to obtain multiple image frames of the display interface of the device under test collected by the image acquisition card starting from the test start time.
[0163] Further, the test system further includes a video recording device, and the video recording device is connected to the test device; the image acquisition module 901 is specifically configured to receive the test video sent by the video recording device; the test video is a video of the display interface of the device under test recorded by the video recording device; perform frame splitting on the test video to obtain multiple image frames.
[0164] Further, refer to Figure 10, the device further includes: a compensation duration determination module 1002, configured to obtain the actual duration of the measured video and the recording end time when the video recording device actually records the measured video; calculate the sum of the difference between the test start time and the recording end time and the actual duration as the calibrated test start time;
[0165] a time delay determination module 904, specifically configured to determine the time delay of the target application as the duration between the calibrated test start time and the test end time.
[0166] By using the device provided in the embodiment of the present invention, a measured video is obtained; the measured video is frame-processed to obtain a plurality of image frames; for each image frame, the image difference degree of the image frame compared with the previous image frame is determined as the difference degree corresponding to the image frame; based on the difference degrees corresponding to the respective image frames, a target image frame is determined from the respective image frames; based on the test start time and the recorded time corresponding to the target image frame in the measured video, the time delay of the target application is determined, which simplifies the performance test process of the application software without affecting the normal operation of the application software. Moreover, it can more completely simulate user operations and is close to the user experience. In addition, the test process does not require manual attendance, improving the test efficiency.
[0167] The embodiment of the present invention further provides a test device, as Figure 11 shown, including a processor 1101, a communication interface 1102, a memory 1103, and a communication bus 1104. Among them, the processor 1101, the communication interface 1102, and the memory 1103 communicate with each other through the communication bus 1104.
[0168] The memory 1103 is used to store a computer program;
[0169] When the processor 1101 executes the program stored in the memory 1103, it implements the steps executed by the terminal in the above method embodiment:
[0170] Sending a test start instruction to the device under test at the test start time, and collecting a plurality of image frames of the display interface of the device under test from the test start time; the test start instruction is used to instruct the target application installed on the device under test to perform a target operation;
[0171] For each non-first image frame, calculating the image difference degree of the image frame compared with the previous image frame as the difference degree corresponding to the image frame;
[0172] Based on the difference degree, a target image frame is determined from each of the image frames, and the acquisition moment of the target image frame is used as the test end moment; the target image frame is: the first frame image in the multiple image frames that identifies that the target application has executed the target operation.
[0173] The duration between the test start moment and the test end moment is determined as the time delay of the target application.
[0174] The communication bus mentioned in the above test device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, only a thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0175] The communication interface is used for communication between the above test device and other devices.
[0176] The memory may include a Random Access Memory (RAM), and may also include a Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor.
[0177] The above-mentioned processor may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0178] In another embodiment provided by the present invention, a computer-readable storage medium is also provided. A computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the performance test method of any of the above application programs are implemented.
[0179] In another embodiment provided by the present invention, there is also provided a computer program product containing instructions, which, when running on a computer, causes the computer to execute the performance testing method of any application program in the above embodiments.
[0180] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that the computer can access or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)).
[0181] It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including", or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article, or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article, or device including the element.
[0182] Each embodiment in this specification is described in a related manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and reference can be made to the relevant parts of the method embodiments for the relevant content.
[0183] The above description is only for the preferred embodiments of the present invention and is not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention are all included in the protection scope of the present invention.
Claims
1. A performance testing method for an application program, characterized in that, A test device applied to a test system, the test system further including a device under test, the device under test being a device installed with various application programs, the method including: Sending a test start instruction to the device under test at the test start moment, and collecting multiple image frames of the display interface of the device under test starting from the test start moment; the test start instruction is used to instruct a target application program installed in the device under test to perform a target operation; For each image frame other than the first frame, calculating an image difference degree of this image frame compared with the previous image frame as the difference degree corresponding to this image frame; Determining an image frame with a difference degree exceeding a third preset difference degree threshold as an alternative image frame; taking the alternative image frame with the closest acquisition moment to the test start moment as the current alternative image frame; judging whether the current alternative image frame meets a preset target condition, if it meets, determining the current alternative image frame as a target image frame, if it does not meet, taking the alternative image frame after the current alternative image frame and adjacent to the current alternative image frame as the new current alternative image frame, and returning to execute the step of judging whether the current alternative image frame meets the preset target condition; wherein, the current alternative image frame meets the preset target condition as: the number of image frames between the alternative image frame before the current alternative image frame and adjacent to the current alternative image frame and the current alternative image frame exceeds a second preset number; or, the number of image frames between the alternative image frame before the current alternative image frame and adjacent to the current alternative image frame and the current alternative image frame is less than the second preset number and not less than a third preset number, and the average value of the difference degrees corresponding to the image frames between the alternative image frame before the current alternative image frame and adjacent to the current alternative image frame and the current alternative image frame is greater than a preset average value threshold; or, the number of image frames between the alternative image frame after the current alternative image frame and adjacent to the current alternative image frame and the current alternative image frame is less than the second preset number and not less than a third preset number, and the average value of the difference degrees corresponding to the image frames between the alternative image frame after the current alternative image frame and adjacent to the current alternative image frame and the current alternative image frame is not greater than a preset average value threshold; Taking the acquisition moment of the target image frame as the test end moment; the target image frame is: the first frame image frame in the multiple image frames that indicates that the target application program has performed the target operation; Determining the duration between the test start moment and the test end moment as the time delay of the target application program.
2. The method according to claim 1, wherein After calculating an image difference degree of each image frame other than the first frame compared with the previous image frame as the difference degree corresponding to this image frame, the method further includes: Determining an image frame with a difference degree exceeding a first preset difference degree threshold and having the closest acquisition moment to the test start moment as a start image frame; Determine the termination image frame as the candidate image frame in the candidate image frames whose acquisition time is closest to the acquisition time of the starting image frame, where the candidate image frames are consecutive first preset number of image frames after the starting image frame and the corresponding difference degrees of all of them are not greater than the second preset difference degree threshold; Determine the ratio of the number of changed image frames to the smoothness test duration as the smoothness of the target application program, where the number of changed image frames is the number of image frames with a difference degree greater than or equal to the second preset difference degree threshold among the image frames included from the starting image frame to the termination image frame; the smoothness test duration is the duration between the acquisition time of the starting image frame and the acquisition time of the termination image frame.
3. The method according to claim 1, wherein The calculating the image difference degree of this image frame compared with the previous image frame as the corresponding difference degree of this image frame includes: For each pixel point in the preset area of this image frame, determine the difference value between the pixel value of this pixel point and the pixel value of the corresponding pixel point in the previous image frame of this image frame; Determine the ratio of the number of pixel points in this image frame with a corresponding difference value greater than the preset pixel difference threshold to the number of pixel points in the preset area as the corresponding difference degree of this image frame.
4. The method according to claim 1, wherein The test system further includes an image acquisition card; the image acquisition card is respectively connected to the test device and the device under test; The acquiring a plurality of image frames of the display interface of the device under test starting from the test start time includes: Obtain a plurality of image frames of the display interface of the device under test acquired by the image acquisition card starting from the test start time.
5. The method according to claim 1, characterized in that, The test system further includes a video recording device, and the video recording device is connected to the test device; The acquiring a plurality of image frames of the display interface of the device under test starting from the test start time includes: Receive the device-under-test video sent by the video recording device; the device-under-test video is a video of the display interface of the device under test recorded by the video recording device; Perform frame splitting on the device-under-test video to obtain a plurality of image frames.
6. The method according to claim 5, wherein Before the receiving the device-under-test video sent by the video recording device, the method further includes: Obtain the actual duration of the device-under-test video and the recording end time when the video recording device actually records the device-under-test video; Calculate the sum of the difference between the test start time and the recording end time and the actual duration as the calibrated test start time; The determining the duration between the test start time and the test end time as the latency of the target application program includes: Determine the duration between the calibrated test start time and the test end time as the latency of the target application program.
7. A performance testing system for an application program, characterized in that Includes: A test device and a device under test, where the device under test is a device installed with various application programs; The test device is used to send a test start instruction to the device under test at the test start moment, and start collecting multiple image frames of the display interface of the device under test from the test start moment; for each image frame other than the first frame, calculate the image difference degree of this image frame compared with the previous image frame as the difference degree corresponding to this image frame; Determine the image frames with the difference degree exceeding the third preset difference degree threshold as candidate image frames; use the candidate image frame with the closest acquisition moment to the test start moment as the current candidate image frame; determine whether the current candidate image frame meets the preset target condition. If it meets, determine the current candidate image frame as the target image frame. If it does not meet, use the candidate image frame that is adjacent to the current candidate image frame and has an acquisition moment after the current candidate image frame as the new current candidate image frame, and return to execute the step of determining whether the current candidate image frame meets the preset target condition; Use the acquisition moment of the target image frame as the test end moment; determine the duration between the test start moment and the test end moment as the latency of the target application; wherein, the current candidate image frame meets the preset target condition as follows: the number of image frames between the candidate image frame that is adjacent to the current candidate image frame and has an acquisition moment before the current candidate image frame and the current candidate image frame exceeds the second preset number; or, the number of image frames between the candidate image frame that is adjacent to the current candidate image frame and has an acquisition moment before the current candidate image frame and the current candidate image frame is less than the second preset number and not less than the third preset number, and the average value of the difference degrees corresponding to the image frames between the candidate image frame that is adjacent to the current candidate image frame and has an acquisition moment before the current candidate image frame and the current candidate image frame is greater than the preset average value threshold; or, the number of image frames between the candidate image frame that is adjacent to the current candidate image frame and has an acquisition moment after the current candidate image frame and the current candidate image frame is less than the second preset number and not less than the third preset number, and the average value of the difference degrees corresponding to the image frames between the candidate image frame that is adjacent to the current candidate image frame and has an acquisition moment after the current candidate image frame and the current candidate image frame is not greater than the preset average value threshold; the target image frame is: the first frame image frame in the multiple image frames that identifies that the target application has executed the target operation; the test start instruction is used to instruct the target application installed on the device under test to execute the target operation; The device under test is used to receive the test start instruction sent by the test device at the test start moment, and instruct the installed target application to execute the target operation based on the test start instruction.
8. The system according to claim 7, characterized in that, The test system further includes an image acquisition card; the image acquisition card is respectively connected to the test device and the device under test; The image acquisition card is used to start collecting multiple image frames of the display interface of the device under test from the test start moment; The test device is used to obtain multiple image frames of the display interface of the device under test collected by the image capture card starting from the test start time.
9. The system according to claim 7, wherein The test system further includes a video recording device, and the video recording device is connected to the test device; The video recording device is used to record a video of the display interface of the device under test starting from the test start time as the video under test; The test device is used to receive the video under test sent by the video recording device; Perform frame splitting on the video under test to obtain multiple image frames.
10. A performance testing device for an application program, characterized in that, A test device applied to a test system, the test system further includes a device under test, and the device under test is a device installed with various application programs. The device includes: An image capture module, configured to send a test start instruction to the device under test at the test start time, and capture multiple image frames of the display interface of the device under test starting from the test start time; the test start instruction is used to instruct the target application program installed in the device under test to perform a target operation; A difference degree calculation module, configured to calculate the image difference degree of each image frame compared to the previous image frame as the corresponding difference degree of the image frame for each image frame other than the first frame; A target image determination module, configured to determine a target image frame from each of the image frames based on the difference degree, and use the capture time of the target image frame as the test end time; the target image frame is: the first image frame in the multiple image frames that indicates that the target application program has performed the target operation; A time delay determination module, configured to determine the duration between the test start time and the test end time as the time delay of the target application program; The target image determination module is specifically configured to determine an image frame with a difference degree exceeding a third preset difference degree threshold as an alternative image frame; use the alternative image frame with the closest acquisition time to the test start time as the current alternative image frame; determine whether the current alternative image frame meets a preset target condition. If it meets the condition, determine the current alternative image frame as the target image frame. If it does not meet the condition, use the alternative image frame that is adjacent to the current alternative image frame and has an acquisition time after the current alternative image frame as the new current alternative image frame, and return to execute the step of determining whether the current alternative image frame meets the preset target condition; wherein, the current alternative image frame meets the preset target condition when: the number of image frames between the alternative image frame that is adjacent to the current alternative image frame and has an acquisition time before the current alternative image frame and the current alternative image frame exceeds a second preset number; or, the number of image frames between the alternative image frame that is adjacent to the current alternative image frame and has an acquisition time before the current alternative image frame and the current alternative image frame is less than the second preset number and not less than a third preset number, and the average value of the difference degrees corresponding to the image frames between the alternative image frame that is adjacent to the current alternative image frame and has an acquisition time before the current alternative image frame and the current alternative image frame is greater than a preset average value threshold; or, the number of image frames between the alternative image frame that is adjacent to the current alternative image frame and has an acquisition time after the current alternative image frame and the current alternative image frame is less than the second preset number and not less than a third preset number, and the average value of the difference degrees corresponding to the image frames between the alternative image frame that is adjacent to the current alternative image frame and has an acquisition time after the current alternative image frame and the current alternative image frame is not greater than a preset average value threshold.
11. A testing device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete mutual communication through the communication bus; The memory is used for storing a computer program; The processor is configured to implement the method steps described in any one of claims 1-6 when executing the program stored on the memory.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, it implements the method steps described in any one of claims 1-6.
Citation Information
Patent Citations
Application program start-up time consumption test method and device, and storage medium
CN108984395A