Interface anomaly detection method, device and equipment

By dividing and grouping pixel points of the interface image and calculating the difference between the pixel groups, the problem of high computational complexity of existing interface detection methods is solved, and faster interface detection and more effective resource utilization are achieved.

CN114187458BActive Publication Date: 2025-03-25CCB FINTECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111556013.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-17
Publication Date
2025-03-25
Estimated Expiration
2041-12-17

AI Technical Summary

Technical Problem

The existing interface detection method requires calculating the full pixel value, resulting in high computational complexity, which leads to a slow detection process and occupies a large amount of computing resources.

Method used

By acquiring the first image and the second image of the interface to be detected, and dividing and grouping their pixel points according to preset pixel division rules, the pixel values ​​of each pixel group are calculated, and the degree of difference of the image is determined based on these pixel values. If the degree of difference is less than or equal to the target threshold, the interface is judged to be abnormal.

Benefits of technology

This reduces the computational complexity, improves the interface detection rate, and saves computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114187458B_ABST
    Figure CN114187458B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device and equipment for detecting an interface anomaly, wherein the method comprises obtaining a first image and a second image of an interface to be detected, wherein the first image comprises N first pixel groups, and the second image comprises N second pixel groups, and the N first pixel groups and the N second pixel groups are obtained by dividing according to a preset pixel division rule; calculating a first pixel value corresponding to each first pixel group and a second pixel value corresponding to each second pixel group; determining the difference between the first image and the second image according to the first pixel value and the second pixel value; and determining that the detection result of the interface to be detected is abnormal when the difference between the first image and the second image is less than or equal to a target difference threshold. In the embodiment of the present application, the use of full pixel value calculation is avoided, the amount of calculation is reduced, and the calculation complexity is reduced, thereby effectively improving the rate of interface detection and saving computing resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of interface detection technology, and in particular, relates to a method, device and equipment for detecting anomalies in an interface. Background Art

[0002] The system interface is the medium for information exchange between the system and the user. It realizes the visualization of information and enables users to conveniently operate the hardware to achieve the purpose of information exchange. Therefore, in order to ensure the user's interactive experience during system operation, it is crucial to detect whether the system interface has abnormal conditions such as response timeout, freeze or freeze. At present, interface detection is usually performed by intercepting the image of the interface to be detected for comparison, and judging whether the interface to be detected is abnormal based on the similarity. However, the resolution of the current system interface is often very high, so the computational complexity of image comparison is relatively large, resulting in a slow interface detection process and requiring a large amount of computing resources. Summary of the invention

[0003] The embodiments of the present application provide an interface anomaly detection method, device and equipment to solve the technical problem that a large amount of computing resources are required during the interface detection process.

[0004] In a first aspect, an embodiment of the present application provides a method for detecting an abnormality in an interface, the method comprising:

[0005] Acquire a first image and a second image of the interface to be detected, wherein the first image includes N first pixel groups, which are obtained by dividing pixel points in the first image according to a preset pixel division rule, and the second image includes N second pixel groups, which are obtained by dividing pixel points in the second image according to the preset pixel division rule, and N is an integer greater than 1;

[0006] Calculating a first pixel value corresponding to each of the first pixel groups and a second pixel value corresponding to each of the second pixel groups;

[0007] determining a difference between the first image and the second image according to the first pixel value and the second pixel value;

[0008] When the difference between the first image and the second image is less than or equal to a target difference threshold, it is determined that the detection result of the interface to be detected is abnormal.

[0009] In a second aspect, an embodiment of the present application provides an interface abnormality detection device, the device comprising:

[0010] A first acquisition module is used to acquire a first image and a second image of the interface to be detected, wherein the first image includes N first pixel groups, which are obtained by dividing pixel points in the first image according to a preset pixel division rule, and the second image includes N second pixel groups, which are obtained by dividing pixel points in the second image according to the preset pixel division rule, and N is an integer greater than 1;

[0011] A first calculation module, used for calculating a first pixel value corresponding to each of the first pixel groups and a second pixel value corresponding to each of the second pixel groups;

[0012] A first determining module, configured to determine a difference between the first image and the second image according to the first pixel value and the second pixel value;

[0013] The second determination module is used to determine that the detection result of the interface to be detected is abnormal when the difference between the first image and the second image is less than or equal to a target difference threshold.

[0014] In a third aspect, an embodiment of the present application provides an electronic device, the device comprising:

[0015] A processor and a memory storing program instructions;

[0016] The above method is implemented when the processor executes the program instructions.

[0017] In a fourth aspect, an embodiment of the present application provides a storage medium having program instructions stored thereon, and the program instructions implement the above-mentioned method when executed by a processor.

[0018] In a fifth aspect, an embodiment of the present application provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the above method.

[0019] The interface abnormality detection method, device and equipment provided by the embodiment of the present application can obtain the first image and the second image of the interface to be detected, wherein the first image includes N first pixel groups, the second image includes N second pixel groups, and the N first pixel groups and the N second pixel groups are obtained by dividing according to the preset pixel division rule; the first pixel value corresponding to each first pixel group and the second pixel value corresponding to each second pixel group are calculated; then the difference between the first image and the second image can be determined according to the first pixel value and the second pixel value; when the difference between the first image and the second image is less than or equal to the target difference threshold, it can be determined that the detection result of the interface to be detected is abnormal. In this way, by dividing and grouping the pixel points of the first image and the second image, and then calculating the difference between the first image and the second image according to the pixel values ​​after grouping, to determine whether the interface is abnormal, the use of full pixel value calculation is avoided, the amount of calculation is reduced, and the calculation complexity is reduced, thereby effectively improving the rate of interface detection and saving computing resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0021] Figure 1 It is a flowchart of an interface anomaly detection method provided by an embodiment of the present application;

[0022] Figure 2 is a structural schematic diagram of an interface anomaly detection device provided by another embodiment of the present application;

[0023] Figure 3 It is a structural schematic diagram of an electronic device provided in yet another embodiment of the present application. DETAILED DESCRIPTION

[0024] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.

[0025] 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 statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0026] In order to solve the problems of the prior art, the embodiments of the present application provide a method, device and apparatus for detecting an interface anomaly. The following first introduces the method for detecting an interface anomaly provided by the embodiments of the present application.

[0027] Figure 1 A flow chart of an interface anomaly detection method provided by an embodiment of the present application is shown. The interface anomaly detection method can be applied to interface detection scenarios of any system.

[0028] like Figure 1 As shown, the interface abnormality detection method may include the following steps:

[0029] Step 101, obtaining a first image and a second image of an interface to be detected, wherein the first image includes N first pixel groups, which are obtained by dividing pixel points in the first image according to a preset pixel division rule, and the second image includes N second pixel groups, which are obtained by dividing pixel points in the second image according to a preset pixel division rule, and N is an integer greater than 1;

[0030] Step 102, calculating a first pixel value corresponding to each first pixel group and a second pixel value corresponding to each second pixel group;

[0031] Step 103, determining the difference between the first image and the second image according to the first pixel value and the second pixel value;

[0032] Step 104 , when the difference between the first image and the second image is less than or equal to the target difference threshold, determining that the detection result of the interface to be detected is abnormal.

[0033] The specific implementation of each of the above steps will be described in detail below.

[0034] In an embodiment of the present application, the interface abnormality detection method can obtain the first image and the second image of the interface to be detected, wherein the first image includes N first pixel groups, the second image includes N second pixel groups, and the N first pixel groups and the N second pixel groups are obtained by dividing according to a preset pixel division rule; the first pixel value corresponding to each first pixel group and the second pixel value corresponding to each second pixel group are calculated; then the difference between the first image and the second image can be determined according to the first pixel value and the second pixel value; when the difference between the first image and the second image is less than or equal to the target difference threshold, it can be determined that the detection result of the interface to be detected is abnormal. In this way, by dividing and grouping the pixel points of the first image and the second image, and then calculating the difference between the first image and the second image according to the pixel values ​​after grouping, to determine whether the interface is abnormal, the use of full pixel value calculation is avoided, the amount of calculation is reduced, and the calculation complexity is reduced, thereby effectively improving the rate of interface detection and saving computing resources.

[0035] The specific implementation methods of the above steps are introduced below.

[0036] In step 101, the interface abnormality may occur after each click or start. If the time on the interface does not change after the click or start, it can be considered that the interface may have abnormal conditions such as response timeout, freeze or freeze. Whether the interface is abnormal can be determined by comparing the interface display before and after the interface is clicked or started. Therefore, obtaining the first image and the second image of the interface to be detected can be obtaining images of the interface to be detected before and after the click or start.

[0037] After acquiring the first image and the second image, the pixels in the first image and the second image can be grouped according to a preset pixel division rule. The preset pixel division rule can be set according to actual conditions. For example, the first image and the second image can be divided into a plurality of small images according to preset specifications, and the pixels in each small image are regarded as a pixel group. For another example, the size of the first image and the second image can be W*H, that is, it can be considered that the pixels of the first image and the second image can be arranged in W columns and H rows, and the pixels in each row can be regarded as a pixel group, or the preset number of pixels in a row can be regarded as a pixel group in units of rows.

[0038] For example, the pixels in the first image can be grouped first. Taking the grouping of the pixels in the first row as an example, the pixels in the first row can be grouped according to a preset number, and the last pixel number that is less than the preset number is still considered as a group. For example, the size of the first image is 1024*768. At this time, every 100 pixels in the first row can be considered as a first pixel group, and the first row can include 11 first pixel groups. Then, each subsequent row is grouped according to the grouping method of the first row. Since each row in the first image includes 11 first pixel groups and there are 768 rows in total, the pixels in the first image can be divided into 8448 first pixel groups. It can be understood that the same pixel division rule can be used to divide the pixels in the second image into 8448 second pixel groups.

[0039] In step 102, the first pixel value corresponding to each first pixel group and the second pixel value corresponding to each second pixel group may be calculated. For example, if each pixel group includes 100 pixels, the average pixel value of the 100 pixels in each first pixel group may be calculated, and the average pixel value may be the first pixel value corresponding to each first pixel group. Similarly, the average pixel value of the 100 pixels in each second pixel group may be calculated, and the average pixel value may be the second pixel value corresponding to each second pixel group.

[0040] In step 103, after calculating the first pixel value corresponding to each first pixel group and the second pixel value corresponding to each second pixel group, N first pixel values ​​of the first image and N second pixel values ​​of the second image can be obtained. The N first pixel values ​​are compared with the N second pixel values ​​one by one, and when the difference between the first pixel value and the second pixel value is greater than a first threshold, the comparison result is considered to be dissimilar, wherein the first threshold can be set according to an empirical value in combination with actual conditions, and is not specifically limited here.

[0041] After the N first pixel values ​​are compared one-to-one with the N second pixel values, the number of dissimilar comparison results can be obtained, and the difference between the first image and the second image can be obtained by dividing the number of dissimilar comparison results by N.

[0042] In step 104, after determining the difference between the first image and the second image, the difference between the first image and the second image can be compared with the target difference threshold. When the difference between the first image and the second image is less than or equal to the target difference threshold, the first image and the second image can be considered similar. In other words, it can be considered that the interface to be detected has not changed before and after clicking or starting. At this time, it can be determined that the detection result of the interface to be detected is abnormal. Among them, the target difference threshold can be set according to the empirical value in combination with the actual situation, and is not specifically limited here.

[0043] In some embodiments, the above step 102 may specifically perform the following steps:

[0044] Performing grayscale processing on the first image and the second image respectively;

[0045] A first pixel value corresponding to each first pixel group in the grayscale-processed first image and a second pixel value corresponding to each second pixel group in the grayscale-processed second image are calculated.

[0046] It can be understood that the first image and the second image can be colorful images, and the pixel values ​​of each pixel point may differ greatly. In this case, in order to improve the accuracy of interface detection, when the embodiment of the present application calculates the first pixel value and the second pixel value, it can first perform grayscale processing on the first image and the second image, and then calculate the first pixel value corresponding to each first pixel group in the first image after grayscale processing, and the second pixel value corresponding to each second pixel group in the second image after grayscale processing.

[0047] In this way, the pixel values ​​of each pixel point of the image after grayscale processing are slightly different, so it can be ensured that the difference between the first pixel value corresponding to each first pixel group and the second pixel value corresponding to each second pixel group is controlled within a smaller range, so that in the subsequent one-to-one comparison, it is easier and more accurate to determine whether the first pixel group and the second pixel group are similar, thereby improving the accuracy of interface detection.

[0048] In some embodiments, the above step 103 may specifically perform the following steps:

[0049] Determine, according to the first pixel value and a preset equivalent rule, a first equivalent value corresponding to each first pixel group;

[0050] Determine, according to the second pixel value and a preset equivalent rule, a second equivalent value corresponding to each second pixel group;

[0051] Determining a difference between the first image and the second image according to the first equivalent value and the second equivalent value;

[0052] Among them, the preset equivalent rule is: when the pixel value is greater than or equal to the preset pixel threshold, the equivalent value corresponding to the pixel value is the first identifier; when the pixel value is less than the preset pixel threshold, the equivalent value corresponding to the pixel value is the second identifier, and the first equivalent value and the second equivalent value respectively include the first identifier or the second identifier.

[0053] In an embodiment of the present application, in order to further improve the rate of interface detection and save computing resources, the first equivalent value corresponding to each first pixel group can be determined according to the first pixel value corresponding to each first pixel group and the preset equivalent rule. For example, when the first pixel value is greater than or equal to the preset pixel threshold, the first pixel value can be equivalent to the first identifier, that is, the first equivalent value corresponding to the first pixel group can be the first identifier at this time; when the first pixel value is less than the preset pixel threshold, the first pixel value can be equivalent to the second identifier, that is, the first equivalent value corresponding to the first pixel group can be the second identifier at this time. In other words, the first equivalent value corresponding to each first pixel group can be the first identifier or the second identifier. Among them, the preset pixel threshold can be set according to the empirical value in combination with the actual situation, and is not specifically limited here.

[0054] For example, the preset pixel threshold may be 127, the first identifier may be "1", and the second identifier may be "0". That is, if the first pixel value is greater than or equal to 127, the first pixel value is equivalent to "1", and the first equivalent value corresponding to the first pixel group is recorded as "1". If the first pixel value is less than 127, the first pixel value is equivalent to "0", and the first equivalent value corresponding to the first pixel group is recorded as "0". After determining the first equivalent value corresponding to each first pixel group, N first equivalent values ​​can be obtained, such as: [1,1,0,1,0,0,1...0].

[0055] It is understandable that the same preset equivalent rule as above can be used to determine the second equivalent value corresponding to each second pixel group. In other words, after determining the second equivalent value corresponding to each second pixel group, N second equivalent values ​​can be obtained, such as: [1, 0, 0, 1, 0, 0, 1 ... 1].

[0056] After obtaining N first equivalent values ​​and N second equivalent values, the N first equivalent values ​​can be compared one by one with the N second equivalent values. If the first equivalent value and the second equivalent value are both "1", the comparison result can be considered similar. If the first equivalent value and the second equivalent value are both "0", the comparison result can also be considered similar. If one of the first equivalent value and the second equivalent value is "1" and the other is "0", the comparison result can be considered dissimilar.

[0057] After the N first equivalent values ​​are compared one by one with the N second equivalent values, the number of dissimilar comparison results can be obtained, and the difference between the first image and the second image can be obtained by dividing the number of dissimilar comparison results by N.

[0058] In an embodiment of the present application, the pixel value can be equivalent to the first identifier or the second identifier, and then it can be directly determined whether the first pixel group is similar to the second pixel value based on whether the identifiers match, thereby further improving the rate of interface detection and saving computing power resources.

[0059] In some embodiments, before the above step 104, the interface abnormality detection method may further include the following steps:

[0060] Obtain an initial difference threshold and M image groups, where an image group includes two images, and M is an integer greater than 1;

[0061] Determine the difference between two images in each image group;

[0062] Determine Q image groups whose difference is less than or equal to the initial difference threshold as target image groups, where Q is a positive integer and Q is less than or equal to M;

[0063] According to the Q differences corresponding to the target image group, the difference mean and difference standard deviation of the target image group are calculated;

[0064] The target difference threshold is determined according to the difference mean and difference standard deviation of the target image group.

[0065] It is understandable that when detecting whether the interface is abnormal, the detection result is affected by the target difference threshold, so the more accurate the target difference threshold is, the more accurate the interface detection result is.

[0066] Based on this, in an embodiment of the present application, an initial difference threshold and M image groups can be obtained, wherein the initial difference threshold can be set according to an empirical value, and each image group can include two randomly captured images of the same interface.

[0067] According to the above difference calculation method, the difference between two images in each image group can be determined. Then, the image group corresponding to the difference less than or equal to the initial difference threshold can be marked as "T", and the image group corresponding to the difference greater than the initial difference threshold can be marked as "F", that is, the target image group can be Q image groups marked as "T".

[0068] The difference mean and difference standard deviation of the target image group can be calculated according to the difference of each image group marked as "T", and then the target difference threshold can be calculated according to the difference mean and difference standard deviation of the target image group.

[0069] The specific calculation formula of the target difference threshold K can be shown as formula (1):

[0070] K=k(avg)+3*k(sd) (1)

[0071] Among them, K is the target difference threshold, k(avg) is the mean difference, and k(sd) is the standard deviation of the difference.

[0072] In an embodiment of the present application, based on a preset initial difference threshold, a target image group whose difference is less than or equal to the initial difference threshold can be determined, and then the target difference threshold can be calculated based on the difference of the target image group. In this way, the initial difference threshold can be adjusted according to the difference that meets the conditions to obtain a more accurate target difference threshold, thereby improving the accuracy of interface detection.

[0073] In some embodiments, the target difference threshold is determined based on the difference mean and difference standard deviation of the target image group, and the following steps may be specifically performed:

[0074] Calculating a first difference threshold value according to a difference mean and a difference standard deviation of the target image group;

[0075] When the Q differences corresponding to the target image group are all less than or equal to the first difference threshold, the first difference threshold is determined as the target difference threshold.

[0076] In the embodiment of the present application, after the first difference threshold is calculated based on the difference mean and the difference standard deviation of the target image group, the first difference threshold can be verified again to further ensure the accuracy of the target difference threshold.

[0077] If the Q differences corresponding to the target image group are all less than or equal to the first difference threshold, it can be considered that when the first difference threshold is used as the target difference threshold, the interface detection result is accurate. At this time, the first difference threshold can be determined as the target difference threshold.

[0078] In some embodiments, the target difference threshold is determined based on the difference mean and difference standard deviation of the target image group, and the following steps may be specifically performed:

[0079] Calculating a first difference threshold value according to a difference mean and a difference standard deviation of the target image group;

[0080] When the difference of the first image group in the target image group is greater than the first difference threshold, the difference mean and the difference standard deviation of the second image group are calculated according to P differences corresponding to the second image group, wherein the second image group is the other image groups in the target image group except the first image group, P is a positive integer, and P is less than Q;

[0081] Calculating a second difference threshold value according to the difference mean and the difference standard deviation of the second image group;

[0082] When the P differences corresponding to the second image group are all less than or equal to the second difference threshold, the second difference threshold is determined as the target difference threshold.

[0083] In the embodiment of the present application, after the first difference threshold is calculated based on the difference mean and the difference standard deviation of the target image group, the first difference threshold can be verified again to further ensure the accuracy of the target difference threshold.

[0084] If in the target image group, there exists a first image group whose difference is greater than the first difference threshold, it can be considered that when the first difference threshold is used as the target difference threshold, the interface detection result is inaccurate. At this time, P image groups whose differences are less than or equal to the first difference threshold can be determined in the target image group as the second image group.

[0085] The difference mean and the difference standard deviation of the second image group can be calculated based on the corresponding P differences in the second image group, and then the second difference threshold can be calculated based on the difference mean and the difference standard deviation of the second image group. Here, the second difference threshold can be calculated by referring to formula (1).

[0086] If the P differences corresponding to the second image group are all less than or equal to the second difference threshold, it can be considered that when the second difference threshold is used as the target difference threshold, the interface detection result is accurate. At this time, the second difference threshold can be determined as the target difference threshold.

[0087] It can be understood that if there are still image groups in the second image group whose difference is greater than the second difference threshold, the above steps can be repeated to determine a third image group whose difference is less than or equal to the second difference threshold, until the differences of the image groups involved in calculating the difference threshold are all less than or equal to the difference threshold, and the difference threshold is determined as the target difference threshold.

[0088] In this way, the calculated difference threshold can be continuously adjusted according to the difference that meets the conditions until the verification result of the difference threshold involved in the verification indicates that the interface detection is accurate. The difference threshold involved in the verification is then determined as the target difference threshold, making the target difference threshold more accurate, thereby further improving the accuracy of the interface detection.

[0089] In some embodiments, the above step 101 may specifically perform the following steps:

[0090] Maximize the processing of the interface to be detected;

[0091] The first image and the second image of the interface to be detected after maximization processing are obtained.

[0092] In the embodiment of the present application, when acquiring the first image and the second image of the interface to be detected, the interface to be detected can be maximized to obtain the first image and the second image of the interface to be detected after the maximized processing. In this way, it can be ensured that the first image and the second image only include the content of the interface to be detected, and the influence of other factors on the difference between the first image and the second image is excluded, thereby ensuring the accuracy of interface detection.

[0093] In some embodiments, the above step 101 may specifically perform the following steps:

[0094] Obtain a first time difference, where the first time difference is a standard time difference for completing loading of the interface to be detected;

[0095] When a first input to the interface to be detected is received, in response to the first input, a first image of the interface to be detected is acquired, and a first time of acquiring the first image is recorded;

[0096] Calculate a second time according to the first time and the first time difference;

[0097] According to the second time, a second image of the interface to be detected is acquired.

[0098] It is understandable that when acquiring the first image and the second image of the interface to be detected, there is a time difference between intercepting the first image and intercepting the second image. If the intercepted time difference is too short, it is easy to detect an interface that has no abnormality as abnormal, resulting in inaccurate interface detection. In addition, if the intercepted time difference is short, more images will be intercepted in the same time period, which increases the amount of calculation for comparing the difference between two adjacent images and wastes computing resources. If the intercepted time difference is too long, although the accuracy of the interface detection can be guaranteed, the interface detection time is also longer. When an abnormality occurs in the interface, the longer interface detection time will affect the user's interactive experience.

[0099] Based on this, in an embodiment of the present application, a first time difference can be obtained, where the first time difference can be a standard time difference for the interface to be detected to be loaded, and then the first image and the second image of the interface to be detected can be obtained based on the first time difference.

[0100] For example, a first input of a user to an interface to be detected can be received, wherein the first input can be: a click input of the user to the interface to be detected, or a voice command input by the user, or a specific gesture input by the user, which can be determined according to actual use requirements, and the embodiment of the present application does not limit this. The specific gesture in the embodiment of the present application can be any one of a single-click gesture, a sliding gesture, a dragging gesture, a pressure recognition gesture, a long press gesture, an area change gesture, a double-press gesture, and a double-click gesture; the click input in the embodiment of the present application can be a single-click input, a double-click input, or any number of click inputs, etc., and can also be a long press input or a short press input. It can be understood that when the interface to be detected is operating normally, after receiving the first time difference of the first input, the interface to be detected completes the loading of the interface associated with the first input.

[0101] After receiving a first input to the interface to be detected, a first image of the interface to be detected can be acquired in response to the first input, and a first time of acquiring the first image can be recorded. The sum of the first time and the first time difference is calculated to obtain a second time of acquiring a second image of the interface to be detected, that is, the second image of the interface to be detected is acquired at the second time.

[0102] In an embodiment of the present application, the first image and the second image of the interface to be detected can be obtained according to the standard time difference when the loading of the interface to be detected is completed, thereby ensuring the accuracy of interface detection and improving the user's interactive experience.

[0103] In some embodiments, the obtaining of the first time difference may specifically perform the following steps:

[0104] Acquire multiple second time differences associated with multiple controls, where the multiple controls are set in at least one interface of the target system, and the interface to be detected is any interface in the target system, wherein the second time difference is obtained based on the time when the second input to the control is received, and the time when the interface associated with the control is loaded in response to the second input;

[0105] Calculating a time difference standard deviation based on the plurality of second time differences;

[0106] The first time difference is calculated according to the minimum time difference among the plurality of second time differences and the standard deviation of the time difference.

[0107] In the embodiment of the present application, the interface to be detected can be any interface in the target system. In other words, the standard time difference for the completion of loading the interface to be detected can be the standard time difference for the completion of loading the page of the target system. Based on this, multiple controls can be determined from the target system as samples, and the multiple controls can be set in at least one interface in the target system.

[0108] Receive a second input to one of the controls, such as a user clicking the control, record the click time t1, then wait for the interface associated with the control to load, record the loading completion time t2, calculate the difference between the loading completion time t2 and the click time t1, and obtain the time difference of this response, which can be the second time difference associated with the control. Then, based on the same calculation method, obtain multiple second time differences associated with multiple controls.

[0109] The time difference standard deviation may be calculated based on the multiple second time differences, and then the first time difference may be calculated based on the minimum time difference among the multiple second time differences and the time difference standard deviation.

[0110] The specific calculation formula of the first time difference T1 can be shown as formula (2):

[0111] T1=T(min)-3*T(sd) (2)

[0112] Wherein, T1 is the first time difference, T(min) is the minimum time difference among multiple second time differences, and T(sd) is the standard deviation of the time difference.

[0113] In some embodiments, the above step 104 may specifically perform the following steps:

[0114] When the difference between the first image and the second image is less than or equal to the target difference threshold, calculating the third time according to the second time and the first time difference;

[0115] Acquire a third image of the interface to be detected according to the third time, where the third image includes N third pixel groups, where the N third pixel groups are obtained by dividing pixel points in the third image according to a preset pixel division rule;

[0116] Calculating a third pixel value corresponding to each third pixel group;

[0117] Determining a difference between the second image and the third image according to the second pixel value and the third pixel value;

[0118] When the difference between the second image and the third image is less than or equal to the target difference threshold, it is determined that the detection result of the interface to be detected is abnormal.

[0119] In an embodiment of the present application, in order to further improve the accuracy of interface detection, when the difference between the first image and the second image is less than or equal to the target difference threshold, it can be considered that after the first time difference, the interface to be detected has not changed, that is, the page loading is not complete. At this time, the third image of the interface to be detected can be obtained again, and the difference between the second image and the third image can be used to further determine whether the interface to be detected has abnormal conditions such as response timeout or jamming.

[0120] For example, the sum of the difference between the second time and the first time can be calculated to obtain the third time for acquiring the third image of the interface to be detected, that is, the third image of the interface to be detected is acquired at the third time. The pixels in the third image can be divided into N third pixel groups using the same pixel division rule as the first image and the second image. Then the pixel value mean of the multiple pixels in each third pixel group can be calculated, and the pixel value mean can be the third pixel value corresponding to each third pixel group. Then the N second pixel values ​​are compared with the N third pixel values ​​one by one. After the comparison is completed, the number of dissimilar comparison results can be obtained, and the difference between the second image and the third image can be obtained by dividing the number of dissimilar comparison results by N.

[0121] After determining the difference between the second image and the third image, the difference between the second image and the third image can be compared with the target difference threshold. When the difference between the second image and the third image is also less than or equal to the target difference threshold, it can be confirmed again that the interface to be detected has not changed. At this time, it can be determined that the detection result of the interface to be detected is abnormal.

[0122] In this way, by repeatedly confirming whether the interface to be detected has completed loading, misjudgment behavior in the interface detection process is effectively avoided, and the accuracy of interface detection is further improved.

[0123] In some embodiments, the acquisition of the third image of the interface to be detected according to the third time may specifically be performed by performing the following steps:

[0124] Calculating a time difference mean according to the plurality of second time differences;

[0125] Calculating a third time difference according to a maximum time difference and an average time difference among the plurality of second time differences;

[0126] When the time difference between the first time and the third time is less than or equal to the third time difference, a third image of the interface to be detected is acquired according to the third time.

[0127] It is understandable that during the interface detection process, it is necessary to continuously capture images of the interface to be detected, and then compare them based on the captured images, and determine whether an abnormality occurs in the interface to be detected based on the comparison results. In order to avoid the waste of resources caused by continuously capturing images, a third time difference for stopping capturing images can be set. In other words, within the third time difference from the receipt of the first input to the interface to be detected, the image of the interface to be detected can be captured. For example, within this time period, the image of the interface to be detected can be continuously captured according to the second time difference. From the receipt of the first input to the interface to be detected, after exceeding the third time difference, stop capturing the image of the interface to be detected.

[0128] The time difference average may be calculated based on the multiple second time differences, and then the third time difference may be calculated based on the maximum time difference and the time difference average among the multiple second time differences.

[0129] The specific calculation formula of the third time difference T2 can be shown as formula (3):

[0130] T2=2*T(max)-T(avg) (3)

[0131] Wherein, T2 is the third time difference, T(max) is the maximum time difference among multiple second time differences, and T(avg) is the average time difference.

[0132] The time difference between the first time and the third time is calculated. If it is less than or equal to the third time difference, the third image of the interface to be detected can be captured at the third time. In other words, it is determined whether the third time for capturing the third image is within the third time difference. If the third time is within the third time difference, the third image can be acquired. If the third time is outside the third time difference, the image capture of the interface to be detected has been stopped at this time, and therefore the third image cannot be acquired.

[0133] Based on the interface anomaly detection method provided in the above embodiment, the present application also provides an embodiment of an interface anomaly detection device.

[0134] Figure 2 A schematic diagram of the structure of an interface anomaly detection device provided in another embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0135] Reference Figure 2 , the interface abnormality detection device 200 may include:

[0136] A first acquisition module 201 is used to acquire a first image and a second image of the interface to be detected, wherein the first image includes N first pixel groups, which are obtained by dividing the pixel points in the first image according to a preset pixel division rule, and the second image includes N second pixel groups, which are obtained by dividing the pixel points in the second image according to a preset pixel division rule, and N is an integer greater than 1;

[0137] A first calculation module 202, configured to calculate a first pixel value corresponding to each first pixel group and a second pixel value corresponding to each second pixel group;

[0138] A first determination module 203, configured to determine the difference between the first image and the second image according to the first pixel value and the second pixel value;

[0139] The second determination module 204 is configured to determine that the detection result of the interface to be detected is abnormal when the difference between the first image and the second image is less than or equal to a target difference threshold.

[0140] The interface anomaly detection device 200 in the embodiment of the present application can obtain the first image and the second image of the interface to be detected, wherein the first image includes N first pixel groups, the second image includes N second pixel groups, and the N first pixel groups and the N second pixel groups are obtained by dividing according to a preset pixel division rule; the first pixel value corresponding to each first pixel group and the second pixel value corresponding to each second pixel group are calculated; then the difference between the first image and the second image can be determined according to the first pixel value and the second pixel value; when the difference between the first image and the second image is less than or equal to the target difference threshold, it can be determined that the detection result of the interface to be detected is abnormal. In this way, by dividing and grouping the pixel points of the first image and the second image, and then calculating the difference between the first image and the second image according to the pixel values ​​after grouping, to determine whether the interface is abnormal, the use of full pixel value calculation is avoided, the amount of calculation is reduced, and the calculation complexity is reduced, thereby effectively improving the rate of interface detection and saving computing resources.

[0141] In some embodiments, the first calculation module 202 may include:

[0142] A first processing unit, used for performing grayscale processing on the first image and the second image respectively;

[0143] The first calculation unit is used to calculate the first pixel value corresponding to each first pixel group in the first image after grayscale processing, and the second pixel value corresponding to each second pixel group in the second image after grayscale processing.

[0144] In some embodiments, the first determining module 203 may include:

[0145] A first determining unit, configured to determine, according to the first pixel value and a preset equivalent rule, a first equivalent value corresponding to each first pixel group;

[0146] A second determining unit, configured to determine, according to the second pixel value and a preset equivalent rule, a second equivalent value corresponding to each second pixel group;

[0147] A third determining unit, configured to determine a difference between the first image and the second image according to the first equivalent value and the second equivalent value;

[0148] Among them, the preset equivalent rule is: when the pixel value is greater than or equal to the preset pixel threshold, the equivalent value corresponding to the pixel value is the first identifier; when the pixel value is less than the preset pixel threshold, the equivalent value corresponding to the pixel value is the second identifier, and the first equivalent value and the second equivalent value respectively include the first identifier or the second identifier.

[0149] In some embodiments, the interface abnormality detection device 200 may further include:

[0150] A second acquisition module is used to acquire an initial difference threshold and M image groups, where an image group includes two images, and M is an integer greater than 1;

[0151] A third determination module is used to determine the difference between two images in each image group;

[0152] a fourth determination module, configured to determine Q image groups whose difference is less than or equal to the initial difference threshold as target image groups, where Q is a positive integer and Q is less than or equal to M;

[0153] A second calculation module is used to calculate the difference degree mean and difference degree standard deviation of the target image group according to the Q difference degrees corresponding to the target image group;

[0154] The fifth determination module is used to determine a target difference threshold value according to the difference mean and the difference standard deviation of the target image group.

[0155] In some embodiments, the fifth determination module may include:

[0156] A second calculation unit, configured to calculate a first difference threshold value according to a difference mean and a difference standard deviation of the target image group;

[0157] The fourth determining unit is configured to determine the first difference threshold as the target difference threshold when the Q differences corresponding to the target image group are all less than or equal to the first difference threshold.

[0158] In some embodiments, the fifth determining module may further include:

[0159] a third calculating unit, configured to calculate, when the difference of the first image group in the target image group is greater than the first difference threshold, a difference mean and a difference standard deviation of the second image group according to P differences corresponding to the second image group, wherein the second image group is the other image groups in the target image group except the first image group, P is a positive integer, and P is less than Q;

[0160] A fourth calculation unit, configured to calculate a second difference threshold value according to the difference mean and the difference standard deviation of the second image group;

[0161] The fifth determining unit is configured to determine the second difference threshold as the target difference threshold when the P differences corresponding to the second image group are all less than or equal to the second difference threshold.

[0162] In some embodiments, the first acquisition module 201 may include:

[0163] A second processing unit, used for maximizing the processing of the interface to be detected;

[0164] The first acquisition unit is used to acquire the first image and the second image of the interface to be detected after maximization processing.

[0165] In some embodiments, the first acquisition module 201 may include:

[0166] A second acquisition unit is used to acquire a first time difference, where the first time difference is a standard time difference for completing the loading of the interface to be detected;

[0167] A third acquisition unit is used for, when receiving a first input to the interface to be detected, acquiring a first image of the interface to be detected in response to the first input, and recording a first time of acquiring the first image;

[0168] A fifth calculation unit, configured to calculate a second time according to the first time and the first time difference;

[0169] The fourth acquisition unit is used to acquire a second image of the interface to be detected according to the second time.

[0170] In some embodiments, the second acquiring unit may include:

[0171] a first acquisition subunit, configured to acquire a plurality of second time differences associated with a plurality of controls, the plurality of controls being arranged in at least one interface of the target system, the interface to be detected being any interface in the target system, wherein the second time difference is obtained based on a time when a second input to the control is received, and a time when loading of an interface associated with the control is completed in response to the second input;

[0172] A first calculation subunit, configured to calculate a time difference standard deviation according to a plurality of second time differences;

[0173] The second calculation subunit is used to calculate the first time difference according to the minimum time difference and the time difference standard deviation among the multiple second time differences.

[0174] In some embodiments, the second determination module 204 may include:

[0175] A sixth calculation unit, configured to calculate a third time according to the second time and the first time difference when the difference between the first image and the second image is less than or equal to a target difference threshold;

[0176] a fifth acquisition unit, configured to acquire a third image of the interface to be detected according to a third time, wherein the third image includes N third pixel groups, and the N third pixel groups are obtained by dividing pixel points in the third image according to a preset pixel division rule;

[0177] a seventh calculation unit, configured to calculate a third pixel value corresponding to each third pixel group;

[0178] a sixth determining unit, configured to determine a difference between the second image and the third image according to the second pixel value and the third pixel value;

[0179] The seventh determination unit is used to determine that the detection result of the interface to be detected is abnormal when the difference between the second image and the third image is less than or equal to the target difference threshold.

[0180] In some embodiments, the fifth acquiring unit may include:

[0181] A third calculation subunit, configured to calculate a time difference mean value according to the plurality of second time differences;

[0182] a fourth calculation subunit, configured to calculate a third time difference according to a maximum time difference and an average time difference among the plurality of second time differences;

[0183] The second acquisition subunit is used to acquire a third image of the interface to be detected according to the third time when the time difference between the first time and the third time is less than or equal to the third time difference.

[0184] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application, and are devices corresponding to the above-mentioned interface abnormality detection method. All implementation methods in the above-mentioned method embodiment are applicable to the embodiment of the device. Its specific functions and technical effects brought about can be found in the method embodiment part, which will not be repeated here.

[0185] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0186] Figure 3 A schematic diagram of the hardware structure of an electronic device provided in yet another embodiment of the present application is shown.

[0187] The device may include a processor 301 and a memory 302 storing program instructions.

[0188] When the processor 301 executes the program, the steps in any of the above method embodiments are implemented.

[0189] Exemplarily, the program may be divided into one or more modules / units, one or more modules / units are stored in the memory 302, and executed by the processor 301 to complete the present application. One or more modules / units may be a series of program instruction segments capable of completing a specific function, and the instruction segments are used to describe the execution process of the program in the device.

[0190] Specifically, the processor 301 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0191] The memory 302 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 302 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 302 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 302 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 302 is a non-volatile solid-state memory.

[0192] The memory may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, typically, the memory includes one or more tangible (non-transitory) readable storage media (e.g., memory devices) encoded with software including computer executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.

[0193] The processor 301 implements any one of the methods in the above embodiments by reading and executing program instructions stored in the memory 302 .

[0194] In one example, the electronic device may further include a communication interface 303 and a bus 310. The processor 301, the memory 302, and the communication interface 303 are connected via the bus 310 and communicate with each other.

[0195] The communication interface 303 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0196] Bus 310 includes hardware, software or both, and the parts of online data flow billing equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-end bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 310 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.

[0197] In addition, in combination with the method in the above embodiment, the embodiment of the present application can provide a storage medium for implementation. The storage medium stores program instructions; when the program instructions are executed by a processor, any one of the methods in the above embodiment is implemented.

[0198] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0199] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0200] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0201] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0202] The functional modules shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. Programs or code segments can be stored in machine-readable media, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable media" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. Code segments can be downloaded via computer grids such as the Internet, intranets, etc.

[0203] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.

[0204] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0205] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.

Claims

1. A method for detecting an abnormality in an interface, characterized in that: include: Acquire a first image and a second image of the interface to be detected, wherein the first image includes N first pixel groups, which are obtained by dividing pixel points in the first image according to a preset pixel division rule, and the second image includes N second pixel groups, which are obtained by dividing pixel points in the second image according to the preset pixel division rule, and N is an integer greater than 1; Calculating a first pixel value corresponding to each of the first pixel groups and a second pixel value corresponding to each of the second pixel groups; determining a difference between the first image and the second image according to the first pixel value and the second pixel value; When the difference between the first image and the second image is less than or equal to a target difference threshold, determining that the detection result of the interface to be detected is abnormal; In the case where the difference between the first image and the second image is less than or equal to a target difference threshold, before determining that the detection result of the interface to be detected is abnormal, the method further includes: Obtaining an initial difference threshold and M image groups, where the image group includes two images, and M is an integer greater than 1; Determining the difference between two images in each of the image groups; Determine Q image groups whose difference is less than or equal to the initial difference threshold as target image groups, where Q is a positive integer and Q is less than or equal to M; Calculating the difference mean and difference standard deviation of the target image group according to the Q difference degrees corresponding to the target image group; Determining a target difference threshold value according to a difference mean and a difference standard deviation of the target image group; Determining a target difference threshold according to the difference mean and difference standard deviation of the target image group includes: Calculating a first difference threshold value according to a difference mean and a difference standard deviation of the target image group; When the difference of the first image group in the target image group is greater than the first difference threshold, calculating the difference mean and the difference standard deviation of the second image group according to P differences corresponding to the second image group, wherein the second image group is the other image groups in the target image group except the first image group, P is a positive integer, and P is less than Q; Calculating a second difference threshold according to the difference mean and the difference standard deviation of the second image group; When the P differences corresponding to the second image group are all smaller than or equal to the second difference threshold, the second difference threshold is determined as the target difference threshold.

2. The method according to claim 1, characterized in that The calculating a first pixel value corresponding to each of the first pixel groups and a second pixel value corresponding to each of the second pixel groups includes: performing grayscale processing on the first image and the second image respectively; A first pixel value corresponding to each first pixel group in the grayscale-processed first image and a second pixel value corresponding to each second pixel group in the grayscale-processed second image are calculated.

3. The method according to claim 2, characterized in that The determining, according to the first pixel value and the second pixel value, the difference between the first image and the second image includes: Determine, according to the first pixel value and a preset equivalent rule, a first equivalent value corresponding to each of the first pixel groups; According to the second pixel value and the preset equivalent rule, determining a second equivalent value corresponding to each second pixel group; Determining a difference between the first image and the second image according to the first equivalent value and the second equivalent value; Among them, the preset equivalent rule is: when the pixel value is greater than or equal to the preset pixel threshold, the equivalent value corresponding to the pixel value is the first identifier; when the pixel value is less than the preset pixel threshold, the equivalent value corresponding to the pixel value is the second identifier, and the first equivalent value and the second equivalent value respectively include the first identifier or the second identifier.

4. The method according to claim 1, characterized in that: Determining a target difference threshold according to the difference mean and difference standard deviation of the target image group includes: Calculating a first difference threshold value according to a difference mean and a difference standard deviation of the target image group; In a case where the Q differences corresponding to the target image group are all smaller than or equal to the first difference threshold, the first difference threshold is determined as the target difference threshold.

5. The method according to claim 1, characterized in that The step of acquiring the first image and the second image of the interface to be detected includes: Performing maximization processing on the interface to be detected; The first image and the second image of the interface to be detected after maximization processing are obtained.

6. The method according to claim 1, characterized in that The step of acquiring the first image and the second image of the interface to be detected includes: Acquire a first time difference, where the first time difference is a standard time difference for completing loading of the interface to be detected; When a first input to the interface to be detected is received, in response to the first input, a first image of the interface to be detected is acquired, and a first time of acquiring the first image is recorded; Calculate a second time according to the first time and the first time difference; According to the second time, a second image of the interface to be detected is acquired.

7. The method according to claim 6, characterized in that The obtaining of the first time difference comprises: Acquire multiple second time differences associated with multiple controls, the multiple controls are set in at least one interface of the target system, and the interface to be detected is any interface in the target system, wherein the second time difference is obtained based on the time when the second input to the control is received, and the time when the interface associated with the control is loaded in response to the second input; Calculating a time difference standard deviation according to the plurality of second time differences; The first time difference is calculated according to the minimum time difference among the multiple second time differences and the time difference standard deviation.

8. The method according to claim 7, characterized in that The step of determining that the detection result of the interface to be detected is abnormal when the difference between the first image and the second image is less than or equal to a target difference threshold comprises: When the difference between the first image and the second image is less than or equal to a target difference threshold, calculating a third time according to the second time and the first time difference; According to the third time, a third image of the interface to be detected is acquired, wherein the third image includes N third pixel groups, and the N third pixel groups are obtained by dividing pixel points in the third image according to the preset pixel division rule; Calculating a third pixel value corresponding to each of the third pixel groups; determining a difference between the second image and the third image according to the second pixel value and the third pixel value; When the difference between the second image and the third image is less than or equal to the target difference threshold, it is determined that the detection result of the interface to be detected is abnormal.

9. The method according to claim 8, characterized in that The acquiring, according to the third time, a third image of the interface to be detected includes: Calculating a time difference mean according to the multiple second time differences; Calculating the third time difference according to the maximum time difference among the multiple second time differences and the average of the time differences; When the time difference between the first time and the third time is less than or equal to the third time difference, a third image of the interface to be detected is acquired according to the third time.

10. An interface abnormality detection device, characterized in that: The device comprises: A first acquisition module is used to acquire a first image and a second image of the interface to be detected, wherein the first image includes N first pixel groups, which are obtained by dividing the pixel points in the first image according to a preset pixel division rule, and the second image includes N second pixel groups, which are obtained by dividing the pixel points in the second image according to the preset pixel division rule, and N is an integer greater than 1; A first calculation module, used for calculating a first pixel value corresponding to each of the first pixel groups and a second pixel value corresponding to each of the second pixel groups; A first determining module, configured to determine a difference between the first image and the second image according to the first pixel value and the second pixel value; A second determination module is used to determine that the detection result of the interface to be detected is abnormal when the difference between the first image and the second image is less than or equal to a target difference threshold; The device also includes: A second acquisition module is used to acquire an initial difference threshold and M image groups, where the image group includes two images, and M is an integer greater than 1; A third determination module, used to determine the difference between two images in each of the image groups; a fourth determination module, configured to determine Q image groups whose difference is less than or equal to the initial difference threshold as target image groups, where Q is a positive integer and is less than or equal to M; A second calculation module, configured to calculate a difference degree mean and a difference degree standard deviation of the target image group according to the Q difference degrees corresponding to the target image group; A fifth determination module, configured to determine a target difference threshold value according to a difference mean and a difference standard deviation of the target image group; The fifth determining module is further used for: Calculating a first difference threshold value according to a difference mean and a difference standard deviation of the target image group; When the difference of the first image group in the target image group is greater than the first difference threshold, calculating the difference mean and the difference standard deviation of the second image group according to P differences corresponding to the second image group, wherein the second image group is the other image groups in the target image group except the first image group, P is a positive integer, and P is less than Q; Calculating a second difference threshold according to the difference mean and the difference standard deviation of the second image group; When the P differences corresponding to the second image group are all smaller than or equal to the second difference threshold, the second difference threshold is determined as the target difference threshold.

11. An electronic device, characterized in that: The device comprises: a processor and a memory storing program instructions; When the processor executes the program instructions, the method according to any one of claims 1 to 9 is implemented.

12. A storage medium, characterized in that: The storage medium stores program instructions, and when the program instructions are executed by the processor, the method according to any one of claims 1 to 9 is implemented.

13. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Video display state anomaly detection method and device and electronic equipment

    CN111601105A