A performance testing method, system, device and testing equipment for an application program
By using target split screen and image segmentation technology in the test system, the problem of difficulty in testing the performance of multiple devices under test simultaneously in the prior art is solved, and efficient multi-device application performance testing is achieved.
Patent Information
- Application Number
- CN202111314897.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-08
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2041-11-08
AI Technical Summary
The prior art is difficult to test the application performance of multiple devices under test simultaneously, resulting in low testing efficiency.
By using the target split screen device in the test system, the display interface images of multiple devices under test are pooled into the display interface of the target split screen device, and the simultaneous testing of the application performance of multiple devices under test is achieved through steps such as image segmentation, difference calculation and target image determination.
The efficiency of testing the application performance of multiple devices under test is improved, and the delay of testing target programs in multiple devices under test is achieved simultaneously and parallel.
Smart Images

Figure CN113886272B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of application program testing, and in particular to a performance testing method, system, device and testing equipment for an application program. Background Art
[0002] At present, it is usually necessary to perform performance testing on applications. For example, latency testing and fluency testing can be performed on applications in set-top boxes to timely understand the corresponding performance of the applications and avoid affecting the user experience due to performance problems of the applications.
[0003] When multiple applications of devices under test need to be tested, it is usually hoped that the performance of the applications of multiple devices under test can be tested simultaneously to improve the test efficiency. However, there is currently no effective method for testing the performance of applications of multiple devices under test simultaneously, and the efficiency of testing the applications of multiple devices under test is low. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide a performance testing method, system, device and testing equipment for an application program to improve the efficiency of testing the application programs of multiple devices under test. The specific technical solution is as follows:
[0005] In order to achieve the above object, an embodiment of the present invention provides a performance testing method for an application program, which is applied to a test device in a test system, wherein the test system further includes a plurality of devices under test and a target screen splitter, wherein the target screen splitter is connected to each of the devices under test, and the method includes:
[0006] When the number of threads of the device under test reaches the preset total number of threads, a test start instruction is sent to each of the devices under test at the start of the test, and multiple image frames of the display interface of the target screen splitter are collected from the start of the test; the test start instruction is used to instruct the target application installed on the corresponding device under test to perform a target operation; the image frame is formed by stitching images of multiple split-screen display interfaces of the target screen splitter, and the image of each split-screen display interface is the display interface image of its corresponding device under test;
[0007] Dividing each of the image frames into a plurality of images, and taking the images corresponding to the same device under test as an image group of the device under test;
[0008] For each image other than the first frame in each image group, calculating the image difference between the image and the previous image as the difference corresponding to the image;
[0009] Based on the difference degree corresponding to each image in the image group, a target image is determined from each image, and the acquisition time of the target image is used as the test end time of the device under test; the target image is: the first frame image in the multiple images that indicates that the target application of the device under test has executed the target operation;
[0010] For each device under test, the duration between the test start time and the test end time of the device under test is determined as the latency of the target application program of the device under test.
[0011] Furthermore, after calculating the image difference between each image other than the first frame in each image group and the previous image as the difference corresponding to the image, the method further includes:
[0012] For each image group of the device under test, an image in the image group whose difference exceeds a first preset difference threshold and whose acquisition time is closest to the test start time is determined as a start image;
[0013] Among the candidate images of the image group, the candidate image whose acquisition time is closest to the acquisition time of the starting image is determined as the ending image, wherein the candidate images of the image group are images whose corresponding differences of a first preset number of consecutive images after the starting image are not greater than a second preset difference threshold;
[0014] The ratio of the number of image changes to the fluency test duration is determined as the fluency of the target application of the device under test, wherein the number of image changes is the number of images from the starting image to the ending image whose difference is greater than or equal to the second preset difference threshold; and the fluency test duration is the duration between the time when the starting image is captured and the time when the ending image is captured.
[0015] Furthermore, dividing each of the image frames into a plurality of images, and taking the images corresponding to the same device under test as the image group of the device under test, includes:
[0016] dividing each of the image frames into a plurality of images;
[0017] For each image, according to the split-screen sequence number of the split-screen where the image is located, the size of the image is restored to the size of the display interface image of the device under test having the split-screen sequence number;
[0018] According to the split screen sequence number of the split screen where each image is located, each image with the same split screen sequence number is used as the image group of the device under test with the split screen sequence number.
[0019] Furthermore, the calculating of the image difference between the image and the previous image as the difference corresponding to the image includes:
[0020] For each pixel point in a preset area in the image, determining a difference value between a pixel value of the pixel point and a pixel value of a corresponding pixel point in a previous image of the image;
[0021] The ratio of the number of pixel points in the image whose corresponding difference values are greater than the preset pixel difference threshold to the number of pixel points in the preset area is determined as the difference degree corresponding to the image.
[0022] Furthermore, determining the target image from each image based on the difference corresponding to each image in the image group includes:
[0023] An image in the image group whose difference exceeds a third preset difference threshold is determined as an alternative image; for each adjacent two alternative images in the alternative images, if the number of images between the two alternative images exceeds a second preset number, the alternative image whose acquisition time is farther from the test start time among the two alternative images is determined as a candidate target image, and the candidate target image whose acquisition time is closest to the test start time among the candidate target images is determined as a target image; if the number of images between each adjacent two alternative images in the alternative images does not exceed the second preset number, then the corresponding image between each adjacent two alternative images in the alternative images is calculated. The average value of the difference degree is determined, and two adjacent candidate images whose corresponding average values of the difference degree exceed the preset average value threshold are determined as candidate target images, and the candidate target image whose acquisition time is closest to the test start time among the candidate target images is determined as the target image; if the number of images between each adjacent two candidate images in the candidate images does not exceed the second preset number, and the average value of the difference degree corresponding to each image between each adjacent two candidate images in the candidate images does not exceed the preset average value threshold, the candidate image whose acquisition time is closest to the test start time among the two candidate images with the largest corresponding average value of the difference degree is determined as the target image; or,
[0024] The image in the image group whose difference exceeds the third preset difference threshold and whose acquisition time is closest to the test start time is determined as the target image.
[0025] Furthermore, the test system further comprises an image acquisition card; the image acquisition card is connected to the test device and the target screen splitter respectively;
[0026] The collecting of multiple image frames of the display interface of the target screen splitter from the test start time includes:
[0027] Acquire multiple image frames of the display interface of the target screen splitter acquired by the image acquisition card from the start time of the test.
[0028] Furthermore, the test system also includes an infrared transmitter;
[0029] The sending of a test start instruction to each of the devices under test at the test start time includes:
[0030] At the test start time, a test start instruction is sent to each of the devices under test according to the infrared serial number corresponding to each of the devices under test.
[0031] In order to achieve the above object, an embodiment of the present invention further provides a performance testing system for an application program, comprising: a testing device, a target screen splitter and a plurality of devices under test; the target screen splitter is connected to each of the devices under test;
[0032] The test device is used to send a test start instruction to each device under test at the test start time when the number of threads of the device under test reaches a preset total number of threads, and to collect multiple image frames of the display interface of the target screen splitter from the test start time; the test start instruction is used to instruct the target application installed on the corresponding device under test to perform a target operation; the image frame is formed by splicing images of multiple split-screen display interfaces of the target screen splitter, and the image of each split-screen display interface is the display interface image of the corresponding device under test; each of the image frames is divided into multiple images, and each image frame corresponding to the same device under test is divided into multiple images as the image group of the device under test; for each image other than the first frame in each image group, calculate the image difference between the image and the previous image as the difference corresponding to the image; based on the difference corresponding to each image in the image group, determine the target image from each image, and use the acquisition time of the target image as the test end time of the device under test; the target image is: the first frame image in multiple images that identifies that the target application of the device under test has executed the target operation; for each device under test, the duration between the test start time and the test end time of the device under test is determined as the delay of the target application of the device under test;
[0033] The device under test is used to receive a test start instruction sent by the test device at the test start time, and instruct the installed target application to perform a target operation based on the received test start instruction;
[0034] The target screen splitter is used to receive the image of the display interface of each device under test sent by the device under test; and then send multiple image frames of the display interface to the test device.
[0035] Furthermore, the test system further comprises an image acquisition card; the image acquisition card is connected to the test device and the target screen splitter respectively;
[0036] The image acquisition card is used to acquire multiple image frames of the display interface of the target screen splitter starting from the start time of the test;
[0037] The test device is used to obtain multiple image frames of the display interface of the target screen splitter acquired by the image acquisition card from the start time of the test.
[0038] The embodiment of the present invention further provides a performance testing device for an application program, which is applied to a testing device in a testing system, wherein the testing system further comprises a plurality of devices under test and a target screen splitter, wherein the target screen splitter is connected to each of the devices under test, and the device comprises:
[0039] An image frame acquisition module is used to send a test start instruction to each device under test at the test start time when the number of threads of the device under test reaches a preset total number of threads, and to collect multiple image frames of the display interface of the target screen splitter from the test start time; the test start instruction is used to instruct the target application installed on the corresponding device under test to perform a target operation; the image frame is formed by stitching images of multiple split-screen display interfaces of the target screen splitter, and the image of each split-screen display interface is the display interface image of its corresponding device under test;
[0040] An image frame segmentation module, used to segment each of the image frames into multiple images, and use the images corresponding to the same device under test as an image group of the device under test;
[0041] A difference calculation module, used for calculating, for each image other than the first frame in each image group, an image difference between the image and the previous image as the difference corresponding to the image;
[0042] A target image determination module is used to determine a target image from each image based on the difference corresponding to each image in the image group, and use the acquisition time of the target image as the test end time of the device under test; the target image is: the first frame image in multiple images that indicates that the target application of the device under test has executed the target operation;
[0043] The delay determination module is used to determine, for each device under test, the duration between the test start time and the test end time of the device under test as the delay of the target application program of the device under test.
[0044] The embodiment of the present invention further provides a test device, the test device comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0045] Memory, used to store computer programs;
[0046] The processor is used to implement any of the above-mentioned application performance testing method steps when executing the program stored in the memory.
[0047] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the performance testing method steps of any of the above-mentioned applications are implemented.
[0048] An embodiment of the present invention also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute any of the above-mentioned steps of the performance testing method for the application program.
[0049] According to the method provided by the embodiment of the present invention, when the number of threads of a device under test reaches a preset total number of threads, a test start instruction is sent to each device under test at the start time of the test, and multiple image frames of the display interface of the target screen splitter are collected from the start time of the test; each image frame is divided into multiple images, and each image corresponding to the same device under test is used as an image group of the device under test; for each image other than the first frame in each image group, the image difference between the image and the previous image is calculated as the difference corresponding to the image; based on the difference corresponding to each image in the image group, a target image is determined from each image, and the collection time of the target image is used as the test end time of the device under test; the target image is: the first frame of the image in the multiple images that indicates that the target application of the device under test has executed the target operation; for each device under test, the duration between the test start time and the test end time of the device under test is determined as the delay of the target application of the device under test. That is, the target screen splitter can be used to aggregate the images of the display interfaces of multiple devices under test through the various split screens of the target screen splitter in the display interface of the target screen splitter, and the images corresponding to multiple devices under test can be obtained by segmenting each image frame, and the difference of the image is calculated to determine the target image, and then the test end time corresponding to each device under test is obtained, and the time length between the test start time and the test end time corresponding to each device under test is calculated as the delay of the target application of each device under test. The target screen splitter is used to achieve the delay of the target program in multiple devices under test in parallel, thereby improving the efficiency of testing the applications of multiple devices under test.
[0050] Of course, it is not necessary to achieve all of the advantages described above at the same time to implement any product or method of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.
[0052] Figure 1 A flow chart of a performance testing method for an application provided by an embodiment of the present invention;
[0053] Figure 2 It is a schematic diagram of pixels of two consecutive frames of images;
[0054] Figure 3 Another flow chart of the performance testing method of an application provided by an embodiment of the present invention;
[0055] Figure 4 A schematic diagram of a structure of a performance testing system for an application provided by an embodiment of the present invention;
[0056] Figure 5 Another structural schematic diagram of a performance testing system for an application provided by an embodiment of the present invention;
[0057] Figure 6 A schematic diagram of the structure of a test system provided by an embodiment of the present invention;
[0058] Figure 7 A schematic diagram of a structure of a performance testing device for an application provided by an embodiment of the present invention;
[0059] Figure 8 Another structural schematic diagram of a performance testing device for an application provided by an embodiment of the present invention;
[0060] Fig. 9 A schematic diagram of the structure of a testing device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0061] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0062] Figure 1 A flow chart of a performance testing method for an application provided in an embodiment of the present invention. The method can be applied to a test device in a test system. The test system also includes multiple devices under test and a target screen splitter. The target screen splitter is connected to each device under test. Figure 1 , the method comprises the following steps:
[0063] Step 101, when the number of threads of the device under test reaches a preset total number of threads, a test start instruction is sent to each device under test at the test start time, and multiple image frames of the display interface of the target screen splitter are collected from the test start time.
[0064] The test start instruction is used to instruct the target application installed on the corresponding device under test to perform the target operation; the image frame is formed by stitching together the images of multiple split-screen display interfaces of the target splitter, and the image of each split-screen display interface is the display interface image of its corresponding device under test.
[0065] In the embodiment 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, etc. The device under test can be a device installed with various applications (including the target application), for example, the device under test can be a TV 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.
[0066] In the embodiment of the present invention, the target operation may be an operation of starting the target application, or other operations of running the target application, etc. For example, if the target application may be a video APP, the target operation may be opening the video APP, or the target operation may be playing a video file in the video APP.
[0067] In an embodiment of the present invention, the test device can transmit a test start instruction through an infrared transmitter at the start of the test. The infrared transmitter can pre-learn different test start instructions corresponding to different infrared signals, for example, it can learn that: the test start instruction A is used to instruct the target application A installed on the device under test to perform a startup 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 an embodiment of the present invention, the target application whose performance needs to be tested can be pre-determined, and the infrared transmitter can transmit the corresponding test start instruction according to the type of the pre-determined target application that needs to be tested.
[0068] In an embodiment of the present invention, the test device may also send a test start instruction to the device under test through adb (android debugbridge) (i.e., a connection channel between the test device and the device under test) at the start of the test. If the test start instruction is sent to the device under test through adb, it is necessary to calibrate the test device before the performance test starts, calculate the calibration time difference between the test device and the device under test, and then calibrate and update the test device regularly during the performance test. The time calibration method can adopt a general adb time calibration method, which is not specifically limited here. After the test is completed, each thread of the device under test searches for the corresponding adb instruction acceptance time from the corresponding log file and stores it in the record file of the device folder.
[0069] The starting time of sending the test start command through the infrared transmitter is equal to the test start time; the test start time through the adb command is the calibrated test start time, and the calibrated test start time = adb command acceptance time + calibration time difference - recorded first frame time + first frame timestamp.
[0070] In the embodiment of the present invention, the target screen splitter can be an HDMI (High Definition Multimedia Interface) screen splitter, and specifically, an 8-in-1 screen splitter, a 6-in-1 screen splitter, or a 4-in-1 screen splitter, etc., that is, the display interface of the target screen splitter can be divided into 8 split screens, 6 split screens, or 4 split screens, etc., and the target screen splitter can support an infrared switching split screen mode. Specifically, in the embodiment of the present invention, the target screen splitter can be split in equal proportion, that is, each split screen of the target screen splitter has the same size.
[0071] In an embodiment of the present invention, the test device can determine whether the number of threads reaches the preset total number of threads through the information of the device under test that is passed in, and only when it reaches the preset total number of threads can a test start instruction be sent to each device under test at the start of the test; wherein the preset total number of threads is usually set to the number of devices under test that need to be tested simultaneously in the current test round. Specifically, a common variable count and a common thread Event can be set. Each thread of the test device can first run each operation step in the test script before starting the test operation, add 1 to the variable count of each step in the test script before starting the test operation, and protect it with a lock; if the variable count does not reach the preset total number of threads, it means that there are still test threads that have not been executed to the current position, then the event waits; if the variable count reaches the preset total number of threads, a test start instruction is sent to each device under test at the start of the test, and multiple image frames of the display interface of the target screen splitter are collected from the start of the test.
[0072] Step 102: divide each image frame into multiple images, and use the images corresponding to the same device under test as an image group of the device under test.
[0073] In this step, each image frame may be segmented according to the boundary lines between the split screens of the target screen splitter to obtain multiple images, and the images corresponding to the same device under test may be used as the image group of the device under test.
[0074] In a possible implementation, dividing each image frame into multiple images and using the images corresponding to the same device under test as the image group of the device under test may include steps A1-A3:
[0075] Step A1, dividing each image frame into multiple images;
[0076] Step A2, for each image, according to the split screen sequence number of the split screen where the image is located, restoring the size of the image to the size of the display interface image of the device under test having the split screen sequence number;
[0077] Step A3, according to the split screen sequence number of the split screen where each image is located, each image with the same split screen sequence number is used as the image group of the device under test with the split screen sequence number.
[0078] In the embodiment of the present invention, the split screen sequence numbers of each split screen of the target split screen can be arranged from left to right and from top to bottom. For example, if the four split screens of the 4 and 1 split screen target split screen are arranged in two rows and two columns, the split screen sequence numbers of the upper left, upper right, lower left and lower right split screens can be 1, 2, 3 and 4 respectively. The split screen sequence number corresponding to the device under test needs to be filled in before the test. If the split screen sequence number corresponding to the device under test is not filled in, the device under test will not be tested, and the split screen sequence number cannot be repeated.
[0079] Step 103 : for each image other than the first frame in each image group, the image difference between the image and the previous image is calculated as the difference corresponding to the image.
[0080] In the embodiment of the present invention, before determining the degree of difference corresponding to the images, each image may be converted into a format that can be processed by the test device.
[0081] In this step, for each image other than the first frame, determining the difference degree corresponding to the image may specifically include step B1-step B2:
[0082] Step B1: for each pixel point in a preset area in the image, determining a difference value between a pixel value of the pixel point and a pixel value of a corresponding pixel point in a previous image of the image;
[0083] Step B2: Based on the ratio of the number of pixels in the image whose corresponding difference values are greater than a preset pixel difference threshold and the number of pixels in a preset area, the difference degree corresponding to the image is determined.
[0084] The preset area in the image can be specifically determined according to the actual application situation. For example, the preset area can be a partial area in the image or the entire area of the image, and the 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 is not specifically limited here. For example, Figure 2 is a schematic diagram of the pixels of two consecutive frames of images. Figure 2 , image B is the previous frame of image A. The preset area actually required to perform pixel comparison in image A is preset area Z A , the preset area Z in image A A The corresponding area in image B is the preset area Z B . Preset Zone Z A The pixel point a, pixel point b, pixel point c and pixel point d are included; the preset area Z B The pixel a1, pixel b1, pixel c1 and pixel d1 are included in the image A. A Each pixel in the image and the preset area Z in the image B B For each pixel in , the average pixel value corresponding to the pixel can be calculated using the following formula:
[0085]
[0086] Among them, P is the average pixel value corresponding to the pixel, x is the original pixel value of the pixel, α is the weight corresponding to the pixel, i is the number of pixels adjacent to the pixel, and y is the average pixel value corresponding to the pixel. i is the original pixel value of the i-th adjacent pixel to the pixel, β is the weight corresponding to the adjacent pixel to the pixel, and α is greater than β. Specifically, the values of α and β can be: α is equal to 2, and β is equal to 1.
[0087] The above formula can be used to calculate pixel point a, pixel point b, pixel point c and pixel point d, as well as the average pixel values corresponding to pixel point a1, pixel point b1, pixel point c1 and pixel point d1 respectively.
[0088] The average pixel value of pixel point a in image A and the difference between the average pixel value of the corresponding pixel point a1 in image B can be calculated as the difference value of pixel point a; the same method can be used to calculate the difference values of pixel point b, pixel point c and pixel point d.
[0089] Furthermore, the number of pixels whose difference values among pixel a, pixel b, pixel c, and pixel d are greater than a preset pixel difference threshold value may be compared with the preset area Z in image A. A The ratio of the number of inner pixels is determined as the difference degree corresponding to image A. For example, if the difference values of pixel c and pixel d are both greater than the preset pixel difference threshold, the difference degree of image A can be calculated as: 2 / 4=0.5.
[0090] In a possible implementation, for each image other than the first frame in each image group, a PSNR (Peak Signal to Noise Ratio) comparison method can also be used to determine the image difference between the image and the previous image as the difference corresponding to the image. The specific PSNR comparison method can refer to the existing PSNR comparison technology, which will not be described here.
[0091] In this step, in a possible implementation, for each image other than the first frame in each image group, the image difference between the image and the previous image can also be determined based on dhash (image difference hash algorithm) as the difference corresponding to the image. Specifically, the Hamming distance of each image compared to the previous image can be calculated based on the image difference hash algorithm, and then the ratio of the calculated Hamming distance to the square of the hash value of the previous image is used as the difference corresponding to each image. The embodiment of the present invention does not specifically limit the method for calculating the image difference.
[0092] Step 104 : Based on the difference degree corresponding to each image in the image group, determine the target image from each image, and use the acquisition time of the target image as the test end time of the device under test.
[0093] The target image is: the first frame image among multiple images that indicates that the target application of the device under test has executed the target operation.
[0094] In the embodiment of the present invention, the target image may be determined in the following manner including steps C1 to C4:
[0095] Step C1: determining an image in the image group whose difference exceeds a third preset difference threshold as a candidate image;
[0096] Step C2: for every two adjacent candidate images among the candidate images, if the number of images between the two candidate images exceeds a second preset number, the candidate image whose acquisition time is farther away from the test start time among the two candidate images is determined as the candidate target image, and the candidate target image whose acquisition time is closest to the test start time among the candidate target images is determined as the target image;
[0097] Step C3: if the number of images between each two adjacent candidate images in the candidate images does not exceed the second preset number, then the average value of the difference between each two adjacent candidate images in the candidate images is calculated, and two adjacent candidate images whose corresponding average values of the difference exceed the preset average value threshold are determined as candidate target images, and the candidate target image whose acquisition time is closest to the test start time among the candidate target images is determined as the target image;
[0098] Step C4: If the number of images between each two adjacent alternative images in the alternative images does not exceed the second preset number, and the average values of the differences corresponding to the images between each two adjacent alternative images in the alternative images do not exceed the preset average value threshold, the alternative image whose corresponding average value of the difference is the largest among the two alternative images whose acquisition time is closest to the test start time is determined as the target image.
[0099] The third preset difference threshold can be set according to the actual application situation, and is not specifically limited here. The second preset number can be set to 70 or 80 according to the actual application situation, and the preset average value threshold can be set to 0.012 or 0.013 according to the actual application situation.
[0100] In the embodiment of the present invention, the image whose difference exceeds the third preset difference threshold and whose acquisition time is closest to the test start time may also be determined as the target image.
[0101] In the embodiment of the present invention, each image may have a timestamp, and the timestamp of each image indicates the time when the image is captured, that is, the time when each image is captured.
[0102] Step 105 : for each device under test, determine the duration between the test start time and the test end time of the device under test as the latency of the target application program of the device under test.
[0103] In an embodiment of the present invention, the latency of the target application can be used to reflect the responsiveness of the target application in executing the target operation. The smaller the latency of the target application, the faster the response of the target application in executing the target operation, and the better the user experience of the target application.
[0104] According to the method provided by the embodiment of the present invention, when the number of threads of a device under test reaches a preset total number of threads, a test start instruction is sent to each device under test at the start time of the test, and multiple image frames of the display interface of the target screen splitter are collected from the start time of the test; each image frame is divided into multiple images, and each image corresponding to the same device under test is used as an image group of the device under test; for each image other than the first frame in each image group, the image difference between the image and the previous image is calculated as the difference corresponding to the image; based on the difference corresponding to each image in the image group, a target image is determined from each image, and the collection time of the target image is used as the test end time of the device under test; the target image is: the first frame of the image in the multiple images that indicates that the target application of the device under test has executed the target operation; for each device under test, the duration between the test start time and the test end time of the device under test is determined as the delay of the target application of the device under test. That is, the target screen splitter can be used to aggregate the images of the display interfaces of multiple devices under test through the various split screens of the target screen splitter in the display interface of the target screen splitter, and the images corresponding to multiple devices under test can be obtained by segmenting each image frame, and the difference of the image is calculated to determine the target image, and then the test end time corresponding to each device under test is obtained, and the time length between the test start time and the test end time corresponding to each device under test is calculated as the delay of the target application of each device under test. The target screen splitter is used to achieve the delay of the target program in multiple devices under test in parallel, thereby improving the efficiency of testing the applications of multiple devices under test.
[0105] Figure 3 Another flow chart of the performance testing method of an application provided by an embodiment of the present invention is applied to a test device in a test system, wherein the test system further comprises a plurality of devices under test and a target screen splitter, wherein the target screen splitter is connected to each device under test, see Figure 3 , the method comprises the following steps:
[0106] Steps 301 to 305 correspond to steps 101 to 105 respectively and are the same, and are not repeated here.
[0107] Step 306: for each image group of the device under test, an image in the image group whose difference exceeds a first preset difference threshold and whose acquisition time is closest to the test start time is determined as a start image.
[0108] The first preset difference threshold can be specifically set according to actual application conditions and is not specifically limited here.
[0109] Step 307: among the candidate images of the image group, the candidate image whose acquisition time is closest to the acquisition time of the starting image is determined as the ending image, wherein the candidate images of the image group are images whose corresponding differences for a first preset number of consecutive times after the starting image are not greater than a second preset difference threshold.
[0110] The image to be selected is an image whose corresponding differences of the first preset number of consecutive images after the starting image are not greater than the second preset difference threshold. The second preset difference 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, set to 20 or 30, etc., and is not specifically limited here.
[0111] Step 308, the ratio of the number of image changes to the fluency test duration is determined as the fluency of the target application of the device under test, wherein the number of image changes is the number of images from the starting image to the ending image whose difference is greater than or equal to a second preset difference threshold; the fluency test duration is the time between the time when the starting image is captured and the time when the ending image is captured.
[0112] The fluency of the target application reflects the response fluency of the target application, and the greater the fluency of the target application, the better the response fluency of the target application, and the better the user experience of the target application.
[0113] By adopting the method provided by the embodiment of the present invention, the images of the display interfaces of multiple devices under test can be gathered in the display interface of the target screen splitter through each split screen of the target screen splitter, and the images corresponding to multiple devices under test can be obtained by segmenting each image frame, and the difference of the image is calculated to determine the target image, and then the test end time corresponding to each device under test is obtained, and the time length between the test start time and the test end time corresponding to each device under test is calculated as the delay of the target application of each device under test. The target screen splitter is used to achieve the delay of the target program in multiple devices under test in parallel, thereby improving the efficiency of testing the applications of multiple devices under test. The time length between the test start time and the test end time can be directly determined as the delay of the target application, and the ratio of the number of image changes to the fluency test time can be determined as the fluency of the target application, thereby achieving the performance of simultaneously testing the delay and fluency of multiple devices under test.
[0114] In an embodiment of the present invention, in a possible implementation, the test system includes a test device, a plurality of devices under test, a target screen splitter and an image acquisition card, and the image acquisition card is connected to the test device and the target screen splitter, respectively. For a device under test having an HDMI (High Definition Multimedia Interface) input and an HDMI output, such as a set-top box, etc., a target screen splitter having an HDMI interface can be used to capture images of display interfaces of each device under test from the start of the test, and displayed on each split screen of the target screen splitter, and an image acquisition card having an HDMI interface can be used to capture multiple image frames of the display interface of the target screen splitter from the start of the test. The device under test can obtain multiple image frames of the display interface of the target screen splitter that it has captured from the start of the test from the image acquisition card.
[0115] Figure 4 A schematic diagram of a structure of a performance testing system for an application provided by an embodiment of the present invention is shown in FIG. Figure 4 As shown, the test system includes: a test device 410, a target screen splitter 420 and a plurality of devices under test 430; the target screen splitter 420 is connected to each device under test 430;
[0116] The test device 410 is used to send a test start instruction to each device under test at the start of the test when the number of threads of the device under test reaches a preset total number of threads, and to collect multiple image frames of the display interface of the target screen splitter from the start of the test; the test start instruction is used to instruct the target application installed on the corresponding device under test to perform a target operation; the image frame is formed by stitching together the images of the multiple split-screen display interfaces of the target screen splitter, and the image of each split-screen display interface is the display interface image of the corresponding device under test; each of the image frames is divided into multiple images, and each image frame corresponding to the same device under test is spliced into multiple images. as the image group of the device under test; for each image other than the first frame in each image group, calculate the image difference between the image and the previous image as the difference corresponding to the image; based on the difference corresponding to each image in the image group, determine the target image from each image, and use the acquisition time of the target image as the test end time of the device under test; the target image is: the first frame image in multiple images that identifies that the target application of the device under test has executed the target operation; for each device under test, the duration between the test start time and the test end time of the device under test is determined as the delay of the target application of the device under test;
[0117] The device under test 430 is used to receive the test start instruction sent by the test device at the test start time, and instruct the installed target application to perform the target operation based on the received test start instruction;
[0118] The target screen splitter 420 is used to receive the image of the display interface of each device under test sent by the device under test, and then send multiple image frames of the display interface to the test device.
[0119] Further, such as Figure 5 As shown, the test system further includes an image acquisition card 510; the image acquisition card 510 is connected to the test device 410 and the target screen splitter 420 respectively;
[0120] The image acquisition card 510 is used to acquire multiple image frames of the display interface of the target screen splitter from the start time of the test;
[0121] The test device 410 is used to obtain multiple image frames of the display interface of the target screen splitter acquired by the image acquisition card from the start time of the test.
[0122] By using the system provided by the embodiment of the present invention, the images of the display interfaces of multiple devices under test can be collected in the display interface of the target screen splitter through each split screen of the target screen splitter, and the images corresponding to multiple devices under test can be obtained by segmenting each image frame, and the difference of the image is calculated to determine the target image, and then the test end time corresponding to each device under test is obtained, and the time length between the test start time and the test end time corresponding to each device under test is calculated as the delay of the target application program of each device under test. The target screen splitter is used to realize the delay of the target program in multiple devices under test in parallel, thereby improving the efficiency of testing the application programs of multiple devices under test.
[0123] For example, Figure 6 A schematic diagram of a structure of a test system provided by an embodiment of the present invention, such as Figure 6As shown, the device under test in the test system may include multiple TV devices (TV devices 1-4), and the test system also includes: an 8-in-1 screen splitter, an HDMI one-to-two screen splitter, a display, an infrared transmitter (or an adb command), an image acquisition card, and a test device. The test device may specifically be a PC, such as a client of TVBenchmark (a standard inspection program for television). The HDMI one-to-two screen splitter may copy the HDMI signal data into two copies, input one of the HDMI signal data into the display for display, which is convenient for the tester to observe; and input the other HDMI signal data into the image acquisition card for testing. When the image acquisition card starts to collect image frames of the display interface of the target screen splitter at the start of the test, a test start instruction may be transmitted through an infrared transmitter at the start of the test to instruct the target application installed in each device under test to perform the target operation. In an embodiment of the present invention, the target application that needs to be tested for performance in each device under test may be predetermined, and the infrared transmitter may transmit the corresponding test start instruction according to the predetermined type of the target application that needs to be tested.
[0124] In an embodiment of the present invention, a tool for performance testing of an application may include hardware and software. Among them, the hardware may include: an HDMI image acquisition card, an infrared transmitter, and an electronic device on which the tool runs; the software may include: an SDK module and a GUI (Graphical User Interface) interface, the SDK may be developed in C++ language, and the GUI interface may be developed in python language. The GUI interface is provided with: a test script option, a test app option, a test round option, a test time option, a test start option, a test stop option, a test result display option, and a test result save option. Among them, the test app option is used to select the target application in the test device; the test script option is used to select the corresponding test method flow for the target application; the test round option is used to select the number of tests; the test time option is used to select the test time period; 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 results in the GUI interface; the test result save option is used to save the test results.
[0125] The current number of split screens, infrared serial number and split screen serial number of the target split screen device, as well as the mapping relationship between the split screen serial number and the device under test can be configured in the GUI interface; if different test scripts are used for each device under test, the mapping relationship between the test script and the device under test can also be configured. The starting point operation supports the starting instructions and adb instructions sent by the infrared transmitter, and each device thread can execute the operation script independently. If the adb mode is used, the acquisition thread is started in advance, and then each device thread sends an adb instruction; if the starting instruction sent by the infrared transmitter is used, since only one infrared transmitter can be started at the same time, it is necessary to configure the mapping relationship between the starting instruction sent by the infrared transmitter and the device under test. When the script is executed, according to the mapping relationship between the starting instruction sent by the infrared transmitter and the device under test, the infrared starting instruction is sent and the time is recorded respectively. Specifically, each device thread can be assembled before the test starting point, and then the last device thread to arrive is collected, and the time when the infrared transmitter sends the starting instruction or the acquisition time of the first frame of the image is recorded, and then the image frame is segmented, and the difference corresponding to the segmented image is calculated, and the test start time and test end time are further determined.
[0126] The specific performance test process can be as follows: first configure the parameters of each device under test, then pass it back to the main thread, and when the script is selected to execute the test, each device thread creates a unique result folder to store the corresponding files (such as image groups). Each device thread parses the script separately and assembles before the trigger starting point in each test cycle. When the device thread reaches the preset total number of threads, each device thread executes the SDK method to start collecting image frames of the display interface of the target splitter, and performs image segmentation on the image frame, and stores the images of the same device under test obtained after segmentation to the corresponding same device folder (if it is adb mode, it is a child thread call), and resumes the execution of each thread after the acquisition is completed. If it is adb mode, each device thread sends an adb command. When the device thread reaches the preset total number of threads, each device thread collects the image frame of the display interface of the target splitter, and performs image segmentation on the image frame, and stores the images of the same device under test obtained after segmentation to the corresponding same device folder, and then each device thread performs image comparison on the images in its own folder.
[0127] By adopting the system provided by the embodiment of the present invention, the display interface images of multiple devices under test are gathered on the same screen through a target screen splitter, and then multiple devices under test can be tested through one acquisition through image segmentation; and the multi-device mode is expanded by thread waiting and notification, while being compatible with the original mode; the operation of parallel testing of multiple devices under test greatly improves the test efficiency, and also enables the performance test process to be executed at the same time, which can more accurately compare the performance differences of the same indicator on different test devices.
[0128] Based on the same inventive concept, according to the performance testing method of the application provided by the embodiment of the present invention, the embodiment of the present invention also provides a performance testing device of the application, which is applied to a testing device in a testing system, wherein the testing system further comprises a plurality of tested devices and a target screen splitter, wherein the target screen splitter is connected to each of the tested devices, see Figure 7 , the device comprises:
[0129] The image frame acquisition module 701 is used to send a test start instruction to each device under test at the test start time when the number of threads of the device under test reaches a preset total number of threads, and to collect multiple image frames of the display interface of the target screen splitter from the test start time; the test start instruction is used to instruct the target application installed on the corresponding device under test to perform a target operation; the image frame is formed by stitching images of multiple split-screen display interfaces of the target screen splitter, and the image of each split-screen display interface is the display interface image of its corresponding device under test;
[0130] An image frame segmentation module 702 is used to segment each of the image frames into multiple images, and use the images corresponding to the same device under test as an image group of the device under test;
[0131] The difference calculation module 703 is used to calculate the image difference between each image other than the first frame in each image group and the previous image as the difference corresponding to the image;
[0132] The target image determination module 704 is used to determine the target image from each image based on the difference degree corresponding to each image in the image group, and use the acquisition time of the target image as the test end time of the device under test; the target image is: the first frame image in the multiple images that indicates that the target application of the device under test has executed the target operation;
[0133] The delay determination module 705 is used to determine, for each device under test, the duration between the test start time and the test end time of the device under test as the delay of the target application program of the device under test.
[0134] By using the device provided by the embodiment of the present invention, when the number of threads of the device under test reaches a preset total number of threads, a test start instruction is sent to each device under test at the test start time, and multiple image frames of the display interface of the target screen splitter are collected from the test start time; each image frame is divided into multiple images, and each image corresponding to the same device under test is used as the image group of the device under test; for each image other than the first frame in each image group, the image difference between the image and the previous image is calculated as the difference corresponding to the image; based on the difference corresponding to each image in the image group, a target image is determined from each image, and the collection time of the target image is used as the test end time of the device under test; the target image is: the first frame of the image in the multiple images that indicates that the target application of the device under test has executed the target operation; for each device under test, the duration between the test start time and the test end time of the device under test is determined as the delay of the target application of the device under test. That is, the target screen splitter can be used to aggregate the images of the display interfaces of multiple devices under test through the various split screens of the target screen splitter in the display interface of the target screen splitter, and the images corresponding to multiple devices under test can be obtained by segmenting each image frame, and the difference of the image is calculated to determine the target image, and then the test end time corresponding to each device under test is obtained, and the time length between the test start time and the test end time corresponding to each device under test is calculated as the delay of the target application of each device under test. The target screen splitter is used to achieve the delay of the target program in multiple devices under test in parallel, thereby improving the efficiency of testing the applications of multiple devices under test.
[0135] For further information, see Figure 8 The device further includes: a fluency test module 801, which is used to, for each image group of the device under test, determine, as a starting image, an image in the image group whose difference exceeds a first preset difference threshold and whose acquisition time is closest to the test start time; determine, among the candidate images of the image group, an image whose acquisition time is closest to the acquisition time of the starting image as a termination image, wherein the candidate images of the image group are images whose corresponding differences for a first preset number of consecutive times after the starting image are not greater than a second preset difference threshold; determine the fluency of the target application of the device under test as a ratio of the number of image changes to the fluency test duration, wherein the number of image changes is the number of images from the starting image to the termination image whose difference is greater than or equal to the second preset difference threshold; and the fluency test duration is the duration between the acquisition time of the starting image and the acquisition time of the termination image.
[0136] Furthermore, the image frame segmentation module 702 is specifically used to segment each of the image frames into multiple images; for each image, according to the split-screen sequence number of the split screen where the image is located, the size of the image is restored to the size of the display interface image of the device under test with the split-screen sequence number; according to the split-screen sequence number of the split screen where each image is located, each image with the same split-screen sequence number is used as an image group of the device under test with the split-screen sequence number.
[0137] Furthermore, the difference calculation module 703 is specifically used to determine, for each pixel point in a preset area in the image, the difference value between the pixel value of the pixel point and the pixel value of the corresponding pixel point in the previous image of the image; and determine the ratio of the number of pixel points in the image whose corresponding difference value is greater than the preset pixel difference threshold to the number of pixel points in the preset area as the difference degree corresponding to the image.
[0138] Furthermore, the target image determination module 704 is specifically used to determine an image in the image group whose difference exceeds a third preset difference threshold as an alternative image; for each adjacent two of the alternative images, if the number of images between the two alternative images exceeds a second preset number, the alternative image whose acquisition time is farther from the test start time among the two alternative images is determined as the target image to be selected, and the target image whose acquisition time is closest to the test start time among the alternative target images is determined as the target image; if the number of images between each adjacent two of the alternative images does not exceed the second preset number, then calculate the number of images between each adjacent two of the alternative images. The method comprises the following steps: determining the average value of the differences between the images between the two adjacent candidate images, determining two adjacent candidate images whose corresponding average values of the differences exceed a preset average value threshold as candidate target images, and determining the candidate target image whose acquisition time is closest to the test start time among the candidate target images as the target image; if the number of images between each adjacent two of the candidate images does not exceed the second preset number, and the average value of the differences between the images between each adjacent two of the candidate images does not exceed the preset average value threshold, determining the candidate image whose acquisition time is closest to the test start time among the two candidate images with the largest corresponding average values of the differences as the target image; or,
[0139] The image in the image group whose difference exceeds the third preset difference threshold and whose acquisition time is closest to the test start time is determined as the target image.
[0140] Furthermore, the test system further comprises an image acquisition card; the image acquisition card is connected to the test device and the target screen splitter respectively;
[0141] The image frame acquisition module 701 is used to acquire multiple image frames of the display interface of the target screen splitter acquired by the image acquisition card from the start time of the test.
[0142] Furthermore, the test system further comprises an infrared transmitter; an image frame acquisition module 701, which is used to send a test start instruction to each of the devices under test according to the infrared serial number corresponding to each of the devices under test at the start of the test.
[0143] By using the device provided by the embodiment of the present invention, the images of the display interfaces of multiple devices under test can be collected in the display interface of the target screen splitter through each split screen of the target screen splitter, and the images corresponding to multiple devices under test are obtained by segmenting each image frame, and the difference of the image is calculated to determine the target image, and then the test end time corresponding to each device under test is obtained, and the time length between the test start time and the test end time corresponding to each device under test is calculated as the delay of the target application program of each device under test. The target screen splitter is used to realize the delay of the target program in multiple devices under test in parallel, thereby improving the efficiency of testing the application programs of multiple devices under test.
[0144] The embodiment of the present invention also provides a testing device, such as Fig. 9 As shown, it includes a processor 901, a communication interface 902, a memory 903 and a communication bus 904, wherein the processor 901, the communication interface 902, and the memory 903 communicate with each other through the communication bus 904.
[0145] Memory 903, used for storing computer programs;
[0146] The processor 901 is configured to implement the steps performed by the terminal in the above method embodiment when executing the program stored in the memory 903:
[0147] When the number of threads of the device under test reaches the preset total number of threads, a test start instruction is sent to each of the devices under test at the start of the test, and multiple image frames of the display interface of the target screen splitter are collected from the start of the test; the test start instruction is used to instruct the target application installed on the corresponding device under test to perform a target operation; the image frame is formed by stitching images of multiple split-screen display interfaces of the target screen splitter, and the image of each split-screen display interface is the display interface image of its corresponding device under test;
[0148] Dividing each of the image frames into a plurality of images, and taking the images corresponding to the same device under test as an image group of the device under test;
[0149] For each image other than the first frame in each image group, calculating the image difference between the image and the previous image as the difference corresponding to the image;
[0150] Based on the difference degree corresponding to each image in the image group, a target image is determined from each image, and the acquisition time of the target image is used as the test end time of the device under test; the target image is: the first frame image in the multiple images that indicates that the target application of the device under test has executed the target operation;
[0151] For each device under test, the duration between the test start time and the test end time of the device under test is determined as the latency of the target application program of the device under test.
[0152] The communication bus mentioned in the above test equipment can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0153] The communication interface is used for communication between the above test equipment and other equipment.
[0154] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0155] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can 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.
[0156] In another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of the performance testing method of any of the above-mentioned applications are implemented.
[0157] In another embodiment of the present invention, a computer program product including instructions is provided, which, when executed on a computer, enables the computer to execute the performance testing method of any application program in the above embodiments.
[0158] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by 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 process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
[0159] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0160] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0161] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A performance testing method for an application program, It is characterized in that A test device applied to a test system, wherein the test system further comprises a plurality of devices under test and a target screen splitter, wherein the target screen splitter is connected to each of the devices under test, and the method comprises: When the number of threads of the device under test reaches the preset total number of threads, a test start instruction is sent to each of the devices under test at the start of the test, and multiple image frames of the display interface of the target screen splitter are collected from the start of the test; the test start instruction is used to instruct the target application installed on the corresponding device under test to perform a target operation; the image frame is formed by stitching images of multiple split-screen display interfaces of the target screen splitter, and the image of each split-screen display interface is the display interface image of its corresponding device under test; Dividing each of the image frames into a plurality of images, and taking the images corresponding to the same device under test as an image group of the device under test; For each image other than the first frame in each image group, calculating the image difference between the image and the previous image as the difference corresponding to the image; Based on the difference degree corresponding to each image in the image group, a target image is determined from each image, and the acquisition time of the target image is used as the test end time of the device under test; the target image is: the first frame image in the multiple images that indicates that the target application of the device under test has executed the target operation; For each device under test, the duration between the test start time and the test end time of the device under test is determined as the latency of the target application of the device under test; The step of determining a target image from each image based on the difference corresponding to each image in the image group includes: An image in the image group whose difference exceeds a third preset difference threshold is determined as an alternative image; for each adjacent two alternative images in the alternative images, if the number of images between the two alternative images exceeds a second preset number, the alternative image whose acquisition time is farther from the test start time among the two alternative images is determined as a candidate target image, and the candidate target image whose acquisition time is closest to the test start time among the candidate target images is determined as a target image; if the number of images between each adjacent two alternative images in the alternative images does not exceed the second preset number, then the corresponding image between each adjacent two alternative images in the alternative images is calculated. The average value of the difference degree is determined, and two adjacent candidate images whose corresponding average values of the difference degree exceed the preset average value threshold are determined as candidate target images, and the candidate target image whose acquisition time is closest to the test start time among the candidate target images is determined as the target image; if the number of images between each adjacent two candidate images in the candidate images does not exceed the second preset number, and the average value of the difference degree corresponding to each image between each adjacent two candidate images in the candidate images does not exceed the preset average value threshold, the candidate image whose acquisition time is closest to the test start time among the two candidate images with the largest corresponding average value of the difference degree is determined as the target image; or, The image in the image group whose difference exceeds the third preset difference threshold and whose acquisition time is closest to the test start time is determined as the target image.
2. The method according to claim 1, It is characterized in that After calculating the image difference between each image other than the first frame in each image group and the previous image as the difference corresponding to the image, the method further includes: For each image group of the device under test, an image in the image group whose difference exceeds a first preset difference threshold and whose acquisition time is closest to the test start time is determined as a start image; Among the candidate images of the image group, the candidate image whose acquisition time is closest to the acquisition time of the starting image is determined as the ending image, wherein the candidate images of the image group are images whose corresponding differences of a first preset number of consecutive images after the starting image are not greater than a second preset difference threshold; The ratio of the number of image changes to the fluency test duration is determined as the fluency of the target application of the device under test, wherein the number of image changes is the number of images from the starting image to the ending image whose difference is greater than or equal to the second preset difference threshold; and the fluency test duration is the duration between the time when the starting image is captured and the time when the ending image is captured.
3. The method according to claim 1, It is characterized in that The step of dividing each of the image frames into a plurality of images and taking the images corresponding to the same device under test as an image group of the device under test includes: dividing each of the image frames into a plurality of images; For each image, according to the split-screen sequence number of the split-screen where the image is located, the size of the image is restored to the size of the display interface image of the device under test having the split-screen sequence number; According to the split screen sequence number of the split screen where each image is located, each image with the same split screen sequence number is used as the image group of the device under test with the split screen sequence number.
4. The method according to claim 1, It is characterized in that The calculating the image difference between the image and the previous image as the difference corresponding to the image includes: For each pixel point in a preset area in the image, determining a difference value between a pixel value of the pixel point and a pixel value of a corresponding pixel point in a previous image of the image; The ratio of the number of pixel points in the image whose corresponding difference values are greater than a preset pixel difference threshold to the number of pixel points in the preset area is determined as the difference degree corresponding to the image.
5. The method according to claim 1, It is characterized in that The test system further comprises an image acquisition card; the image acquisition card is connected to the test device and the target screen splitter respectively; The collecting of multiple image frames of the display interface of the target screen splitter from the test start time includes: Acquire multiple image frames of the display interface of the target screen splitter acquired by the image acquisition card from the start time of the test.
6. The method according to claim 1, It is characterized in that The test system also includes an infrared transmitter; The sending of a test start instruction to each of the devices under test at the test start time includes: At the test start time, a test start instruction is sent to each of the devices under test according to the infrared serial number corresponding to each of the devices under test.
7. A performance testing system for an application program, It is characterized in that include: A test device, a target screen splitter and a plurality of devices under test; the target screen splitter is connected to each of the devices under test; The test device is used to send a test start instruction to each device under test at the start of the test when the number of threads of the device under test reaches a preset total number of threads, and to collect multiple image frames of the display interface of the target screen splitter from the start of the test; the test start instruction is used to instruct the target application installed on the corresponding device under test to perform a target operation; the image frame is formed by stitching images of multiple split-screen display interfaces of the target screen splitter, and the image of each split-screen display interface is the display interface image of the corresponding device under test; each of the image frames is divided into multiple images, and each image corresponding to the same device under test is used as an image group of the device under test; for each image other than the first frame in each image group, the image difference between the image and the previous image is calculated as the difference corresponding to the image; Based on the difference degree corresponding to each image in the image group, a target image is determined from each image, and the acquisition time of the target image is used as the test end time of the device under test; the target image is: the first frame image in multiple images that identifies that the target application of the device under test has executed the target operation; for each device under test, the duration between the test start time and the test end time of the device under test is determined as the delay of the target application of the device under test; The device under test is used to receive a test start instruction sent by the test device at the test start time, and instruct the installed target application to perform a target operation based on the received test start instruction; The target screen splitter is used to receive the image of the display interface of each device under test sent by the device under test; and then send multiple image frames of the display interface to the test device; The test device is specifically used to determine images in the image group whose difference exceeds a third preset difference threshold as candidate images; for each two adjacent candidate images in the candidate images, if the number of images between the two candidate images exceeds a second preset number, determine the candidate image whose acquisition time is farther away from the test start time among the two candidate images as the candidate target image, and determine the candidate target image whose acquisition time is closest to the test start time among the candidate target images as the target image; If the number of images between each adjacent two of the alternative images does not exceed the second preset number, then the average value of the differences corresponding to the images between each adjacent two of the alternative images is calculated, and the two adjacent alternative images whose corresponding average values of the differences exceed the preset average value threshold are determined as target images to be selected, and the target image whose acquisition time is closest to the start time of the test among the target images to be selected is determined as the target image; if the number of images between each adjacent two of the alternative images does not exceed the second preset number, and the average value of the differences corresponding to the images between each adjacent two of the alternative images does not exceed the preset average value threshold, among the two alternative images whose corresponding average values of the differences are the largest, the alternative image whose acquisition time is closest to the start time of the test is determined as the target image; or, the image in the image group whose difference exceeds the third preset difference value threshold and whose acquisition time is closest to the start time of the test is determined as the target image.
8. The system according to claim 7, It is characterized in that The test system further comprises an image acquisition card; the image acquisition card is connected to the test device and the target screen splitter respectively; The image acquisition card is used to acquire multiple image frames of the display interface of the target screen splitter starting from the start time of the test; The test device is used to obtain multiple image frames of the display interface of the target screen splitter acquired by the image acquisition card from the start time of the test.
9. A performance testing device for an application program, It is characterized in that A test device applied to a test system, the test system further comprising a plurality of devices under test and a target screen splitter, the target screen splitter being connected to each of the devices under test, the device comprising: An image frame acquisition module is used to send a test start instruction to each device under test at the test start time when the number of threads of the device under test reaches a preset total number of threads, and to collect multiple image frames of the display interface of the target screen splitter from the test start time; the test start instruction is used to instruct the target application installed on the corresponding device under test to perform a target operation; the image frame is formed by stitching images of multiple split-screen display interfaces of the target screen splitter, and the image of each split-screen display interface is the display interface image of its corresponding device under test; An image frame segmentation module, used to segment each of the image frames into multiple images, and use the images corresponding to the same device under test as an image group of the device under test; A difference calculation module, used for calculating, for each image other than the first frame in each image group, an image difference between the image and the previous image as the difference corresponding to the image; A target image determination module is used to determine a target image from each image based on the difference corresponding to each image in the image group, and use the acquisition time of the target image as the test end time of the device under test; the target image is: the first frame image in multiple images that indicates that the target application of the device under test has executed the target operation; A delay determination module, for determining, for each device under test, the duration between a test start time and a test end time of the device under test as a delay of a target application of the device under test; The target image determination module is specifically used to determine an image in the image group whose difference exceeds a third preset difference threshold as an alternative image; for each adjacent two alternative images in the alternative images, if the number of images between the two alternative images exceeds a second preset number, the alternative image whose acquisition time is farther away from the test start time among the two alternative images is determined as the target image to be selected, and the target image whose acquisition time is closest to the test start time among the alternative target images is determined as the target image; if the number of images between each adjacent two alternative images in the alternative images does not exceed the second preset number, then the average value of the difference corresponding to each image between each adjacent two alternative images in the alternative images is calculated, and the corresponding average value of the difference is used as the target image. Two adjacent candidate images that exceed the preset average value threshold are determined as candidate target images, and the candidate target image whose acquisition time is closest to the test start time among all the candidate target images is determined as the target image; if the number of images between each adjacent two candidate images in the candidate images does not exceed the second preset number, and the average value of the difference between each image between each adjacent two candidate images in the candidate images does not exceed the preset average value threshold, the candidate image whose acquisition time is closest to the test start time among the two candidate images with the largest corresponding average value of the difference is determined as the target image; or, the image in the image group whose difference exceeds the third preset difference value threshold and whose acquisition time is closest to the test start time is determined as the target image.
10. A test device, It is characterized in that It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 6 when executing a program stored in a memory.
Citation Information
Patent Citations
Response time testing method and device, equipment and computer storage medium
CN111858318A
Method, apparatus and device for testing response time of user interface of terminal
WO2015196540A1