CN112527539B - Interface detection method and related device - Google Patents

Interface detection method and related device Download PDF

Info

Publication number
CN112527539B
CN112527539B CN201910804142.6A CN201910804142A CN112527539B CN 112527539 B CN112527539 B CN 112527539B CN 201910804142 A CN201910804142 A CN 201910804142A CN 112527539 B CN112527539 B CN 112527539B
Authority
CN
China
Prior art keywords
preset
detection
picture
white screen
interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910804142.6A
Other languages
Chinese (zh)
Other versions
CN112527539A (en
Inventor
何兆林
朱海军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910804142.6A priority Critical patent/CN112527539B/en
Publication of CN112527539A publication Critical patent/CN112527539A/en
Application granted granted Critical
Publication of CN112527539B publication Critical patent/CN112527539B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0751Error or fault detection not based on redundancy
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • G06T7/001Industrial image inspection using an image reference approach
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Engineering & Computer Science (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application discloses an interface detection method and a related device, wherein a current interface is determined, a detection picture is obtained, and then at least one pixel set of the detection picture in a preset direction is obtained to determine a reference pixel value; comparing the reference pixel value with the pixel value of each pixel set respectively to determine a difference pixel set; calculating the white screen parameters of the detected picture according to a preset rule; if the white screen parameters meet preset conditions, determining that the current interface is a white screen, and realizing real-time detection of the interface white screen; the detection picture can accurately reflect the display condition of the interface, so that the detection process of the process has good credibility, improves the accuracy of interface detection, and has wider application range.

Description

Interface detection method and related device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method for detecting an interface and a related device.
Background
An interface (UI) is a medium for interaction and information exchange between an end system and a user, and it implements conversion between an internal form of information and a human acceptable form. However, during the running process of the terminal system, white screens may be caused by some program faults, that is, only a single color is provided in a designated interface area, for example, only black is provided in a designated content area; it is necessary to detect and report this situation to notify the relevant personnel.
Generally, a method for detecting whether the interface has child nodes is adopted for detecting the white screen, namely whether the interface has corresponding display content is judged according to the expansion condition of the interface nodes.
However, since the pages corresponding to some child nodes may have no content, for example, although there is a list node in the page, there is no content in the list, so that the detection result is inaccurate; moreover, the method for detecting the child node is invalid for the H5 page, which is unpredictable in the level of the webkit page and affects the application range of the detection process.
Disclosure of Invention
In view of this, the first aspect of the present application provides a method for detecting an interface, which can be applied to a terminal system or a program running process, and specifically includes: determining a current interface to obtain a first detection picture, wherein the first detection picture comprises A pixel sets, and A is a positive integer;
acquiring at least one pixel set of the first detection picture in a preset direction to determine a reference pixel value;
comparing the reference pixel value with the pixel values of the A pixel sets respectively to determine B difference pixel sets, wherein B is less than or equal to A, and B is a positive integer;
calculating a white screen parameter of the first detection picture according to a first preset rule, wherein the first preset rule is set based on the quantity ratio of the difference pixel set to the pixel set;
And if the white screen parameter meets a preset condition, determining that the current interface is a white screen and sending a detection report, wherein the preset condition is determined based on the size relation between the white screen parameter and a preset threshold value.
Preferably, in some possible implementations of the present application, the determining the current interface to obtain the first detected picture includes:
determining a current interface to acquire a screen capturing picture;
cutting the screen capturing pictures according to a second preset rule to determine a plurality of cut pictures, wherein the second preset rule is set based on picture parameters of the screen capturing pictures;
and determining the first detection picture in the plurality of cutting pictures according to a preset sequence.
Preferably, in some possible implementations of the present application, the method further includes:
if the white screen parameters do not meet the preset conditions, selecting a second detection picture from the plurality of cutting pictures according to the preset sequence;
calculating the white screen parameters of the second detection picture according to a first preset rule;
and if the white screen parameter of the second detection picture meets the preset condition, determining that the current interface is a white screen and sending a detection report.
Preferably, in some possible implementations of the present application, the comparing, based on the reference pixel values, the pixel values of the a pixel sets to determine B differential pixel sets includes:
Acquiring a preset comparison interval;
c comparison pixel sets are determined according to the preset comparison interval, B is more than or equal to C and less than or equal to A, and C is a positive integer;
and comparing the reference pixel value with the pixel values corresponding to the C comparison pixel sets respectively to determine B difference pixel sets.
Preferably, in some possible implementations of the present application, the determining the current interface to obtain the first detected picture includes:
determining a current interface, and waiting for a preset detection time length, wherein the preset detection time length is set based on the data loading condition of the current interface;
and if the waiting time length reaches the preset detection time length, acquiring a first detection picture.
Preferably, in some possible implementations of the present application, the determining the current interface and waiting for a preset detection duration include:
determining a current interface to determine a target component, wherein the target component is used for indicating a component for sending feedback after loading is completed;
determining a feedback time length according to the target component;
waiting for the preset detection time period, wherein the preset detection time period is set based on the feedback time period.
Preferably, in some possible implementations of the present application, after determining that the current interface is a white screen and sending a detection report, the method further includes:
Extracting the current interface, and comparing the current interface with a preset picture to obtain a comparison result, wherein the preset picture is used for indicating a picture determined to be a white screen;
and adjusting the preset threshold according to the comparison result, wherein the adjusted preset threshold is used for indicating whether the white screen parameter of the interface at the next moment meets the judgment of the preset condition.
A second aspect of the present application provides another interface detection apparatus, comprising: the device comprises a determining unit, a display unit and a display unit, wherein the determining unit is used for determining a current interface to obtain a first detection picture, the first detection picture comprises A pixel sets, and A is a positive integer;
an acquisition unit, configured to acquire at least one pixel set of the first detection picture in a preset direction, so as to determine a reference pixel value;
the comparison unit is used for respectively comparing the reference pixel value with the pixel values of the A pixel sets to determine B difference pixel sets, B is less than or equal to A, and B is a positive integer;
the computing unit is used for computing the white screen parameter of the first detection picture according to a first preset rule, and the first preset rule is set based on the quantity ratio of the difference pixel set to the pixel set;
and the judging unit is used for determining that the current interface is a white screen and sending a detection report if the white screen parameter meets the preset condition, and the preset condition is determined based on the size relation between the white screen parameter and a preset threshold value.
Preferably, in some possible implementations of the present application, the determining unit is specifically configured to determine a current interface to obtain a screenshot;
the determining unit is specifically configured to cut the screenshot pictures according to a second preset rule to determine a plurality of cut pictures, where the second preset rule is set based on picture parameters of the screenshot pictures;
the determining unit is specifically configured to determine the first detection picture from the plurality of cut pictures according to a preset sequence.
Preferably, in some possible implementations of the present application, the determining unit is further configured to select, if the white screen parameter does not meet a preset condition, a second detection picture from the plurality of cut pictures according to the preset order;
the determining unit is specifically configured to calculate a white screen parameter of the second detected picture according to a first preset rule;
the determining unit is specifically configured to determine that the current interface is a white screen and send a detection report if the white screen parameter of the second detection picture meets a preset condition.
Preferably, in some possible implementations of the present application, the comparing unit is specifically configured to obtain a preset comparison interval;
The comparison unit is specifically configured to determine C comparison pixel sets according to the preset comparison interval, where B is greater than or equal to C and less than or equal to a, and C is a positive integer;
the comparing unit is specifically configured to compare the reference pixel value with the pixel values corresponding to the C comparison pixel sets, so as to determine B difference pixel sets.
Preferably, in some possible implementations of the present application, the determining unit is specifically configured to determine a current interface, and wait for a preset detection duration, where the preset detection duration is set based on a data loading condition of the current interface;
the determining unit is specifically configured to obtain a first detection picture if the waiting duration reaches the preset detection duration.
Preferably, in some possible implementations of the present application, the determining unit is specifically configured to determine a current interface to determine a target component, where the target component is used to indicate a component that sends feedback after loading is completed;
the determining unit is specifically configured to determine a feedback duration according to the target component;
the determining unit is specifically configured to wait for the preset detection duration, where the preset detection duration is set based on the feedback duration.
Preferably, in some possible implementations of the present application, the determining unit is further configured to extract the current interface, and compare the current interface with a preset picture to obtain a comparison result, where the preset picture is used to indicate a picture determined to be a white screen;
the determining unit is further configured to adjust the preset threshold according to the comparison result, where the adjusted preset threshold is used to indicate whether a white screen parameter of the interface at the next moment meets the judgment of the preset condition.
A third aspect of the present application provides a computer apparatus comprising: a memory, a processor, and a bus system; the memory is used for storing program codes; the processor is configured to perform the method of interface detection according to the first aspect or any one of the first aspects according to instructions in the program code.
A fourth aspect of the application provides a computer readable storage medium having instructions stored therein which, when run on a computer, cause the computer to perform the method of interface detection of the first aspect or any of the first aspects described above.
From the above technical solutions, the embodiment of the present application has the following advantages:
Determining a reference pixel value by determining a current interface, acquiring a detection picture and then acquiring at least one pixel set of the detection picture in a preset direction; comparing the reference pixel value with the pixel value of each pixel set respectively to determine a difference pixel set; calculating a white screen parameter of the detected picture according to a preset rule, wherein the preset rule is set based on the quantity ratio of the difference pixel set to the pixel set; if the white screen parameters meet preset conditions, determining that the current interface is a white screen and sending a detection report, so that real-time detection of the interface white screen is realized; the detection picture can accurately reflect the display condition of the interface, so that the detection process of the process has good credibility, improves the accuracy of interface detection, and has wider application range.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a display scene diagram of an interface generation white screen;
FIG. 2 is a system architecture diagram of an interface detection;
FIG. 3 is a flowchart of a method for detecting an interface according to an embodiment of the present application;
FIG. 4 is a flowchart of another method for detecting an interface according to an embodiment of the present application;
fig. 5 is a schematic view of an application scenario provided in an embodiment of the present application;
FIG. 6 is a schematic diagram of interface display for interface detection according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an interface detection device according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of another interface detection device according to an embodiment of the present application.
Detailed Description
The embodiment of the application provides an interface detection method and a related device, which can be applied to a terminal system or a program running process, and particularly comprises the steps of determining a current interface, acquiring a detection picture, and then acquiring at least one pixel set of the detection picture in a preset direction to determine a reference pixel value; comparing the reference pixel value with the pixel value of each pixel set respectively to determine a difference pixel set; calculating a white screen parameter of the detected picture according to a preset rule, wherein the preset rule is set based on the quantity ratio of the difference pixel set to the pixel set; if the white screen parameters meet preset conditions, determining that the current interface is a white screen and sending a detection report, so that real-time detection of the interface white screen is realized; the detection picture can accurately reflect the display condition of the interface, so that the detection process of the process has good credibility, improves the accuracy of interface detection, and has wider application range.
The terms "first," "second," "third," "fourth" and the like in the description and in the claims and in the above drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented, for example, in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "includes" and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that the interface detection method provided by the application can be applied to the operation process of the terminal system, specifically, the interface detection method provided by the application can be operated on a personal mobile terminal, a server and a third party device to provide white screen detection of a target interface and generate a detection report; the specific interface detection method may be implemented in the above-mentioned device in the form of a program, or may be implemented as a system component in the above-mentioned device, and the specific operation mode is not limited herein, depending on the actual scenario.
An interface (UI) is a medium for interaction and information exchange between an end system and a user, and it implements conversion between an internal form of information and a human acceptable form. However, during the running process of the terminal system, a white screen may be caused by some program faults, that is, only a single color exists in a designated interface area, as shown in fig. 1, the display scene diagram of the white screen generated by the interface is a display scene diagram of only black in a designated content area; it is necessary to detect and report this situation to notify the relevant personnel.
Generally, a method for detecting whether the interface has child nodes is adopted for detecting the white screen, namely whether the interface has corresponding display content is judged according to the expansion condition of the interface nodes.
However, since the pages corresponding to some child nodes may have no content, for example, although there is a list node in the page, there is no content in the list, so that the detection result is inaccurate; moreover, the method for detecting the child node is invalid for the H5 page, which is unpredictable in the level of the webkit page and affects the application range of the detection process.
In order to solve the above-mentioned problems, the present application provides an interface detection method, which is applied to a system framework of interface detection shown in fig. 2, and as shown in fig. 2, is a system architecture diagram of interface detection, where the diagram includes application start, detection configuration, page creation, trigger, white screen detection and server, where a start signal of an application corresponding to a target interface is obtained, and a corresponding detection configuration is pulled, for example: detection timing, detection mode, etc.; after the condition reaches the detection condition, the trigger performs white screen detection on the created pages, generates corresponding detection results on each page, reports the detection results to the server, and the server notifies relevant personnel to maintain or correspondingly adjust detection configuration according to the reported results so as to improve the accuracy of white screen detection.
With reference to the above system architecture, the method for detecting an interface in the present application will be described, referring to fig. 3, fig. 3 is a flowchart of a method for detecting an interface provided by an embodiment of the present application, where the embodiment of the present application at least includes the following steps:
301. and determining a current interface to acquire a first detection picture.
In this embodiment, the first detection picture includes a pixel set, where a is a positive integer; the pixel set may be a set of a plurality of horizontal pixels, a set of a plurality of vertical pixels, or a set of a plurality of pixels on a diagonal of the detected picture, and a specific set form depends on an actual scene.
It will be appreciated that, for the determination of the pixel set of the first detected picture, a plurality of pixels may be set together to save the calculation amount, and in some scenarios, the operation may also be performed for each pixel, which is not limited herein.
Optionally, since the white screen of the current interface may occur in a certain portion, that is, when the display content of a portion of the interface cannot be displayed, the white screen is the white screen, at this time, the screenshot picture corresponding to the current interface may be cut to implement distributed detection, specifically, the current interface is determined first to obtain the screenshot picture; cutting the screen capturing pictures according to a second preset rule to determine a plurality of cutting pictures; and then determining the first detection picture in the plurality of cutting pictures according to a preset sequence.
The second preset rule is set based on picture parameters of the screen capturing picture, specifically, the picture parameters can include length, width and the like, and the second preset rule can be that three pictures to be detected are obtained according to trisection of the length of the screen capturing picture; or three pictures to be detected can be obtained according to trisection of the width of the screen capturing picture; irregular cutting can be performed on the screen capturing picture according to preset cutting parameters, and the specific cutting mode is determined according to actual scenes and is not limited herein.
In one possible scenario, because the data in the interface needs to be loaded to a certain extent, if the interface is opened immediately, the interface data may not be completely loaded, which results in misjudgment of the detection result. At this time, a mode of prescribing a preset detection duration may be adopted, specifically, a current interface is first determined, and a preset detection duration is waited, where the preset detection duration is set based on a data loading condition of the current interface; and if the waiting time length reaches the preset detection time length, acquiring a first detection picture.
Optionally, for different interfaces, the preset detection duration may be different, and at this time, the loading condition of the related components in the detection interface may be used to determine whether the preset detection duration is reached; specifically, a current interface is firstly determined to determine a target component, wherein the target component is used for indicating a component which sends feedback after loading is completed; then determining a feedback time length according to the target component; and waiting for the preset detection duration, wherein the preset detection duration is set based on the feedback duration.
It can be understood that the target component can be a manually set component type, or can be a loading time length of a system statistics related component, and a component with a longer loading time is selected, namely, other components of the current interface are guaranteed to be loaded completely when the loading of the target component is completed.
302. And acquiring at least one pixel set of the first detection picture in a preset direction to determine a reference pixel value.
In this embodiment, for determining the reference pixel value, that is, selecting a set of a certain number of pixel points as a reference, in detecting the detected picture, due to the regularity of the picture, a preset direction may be adopted to select the pixel set, for example: and selecting a pixel value corresponding to the pixel set of the vertical first column as a reference pixel value.
It can be understood that the preset direction may be a horizontal direction or a vertical direction, and the specific pixel set form may be a row-column or a plurality of rows-columns, which may be correspondingly dynamically adjusted according to the size of the picture, so as to reduce the calculation amount.
In addition, for the determination of the pixel value, RGB values may be employed, for example: the RGB values in the first column in the longitudinal direction are (210,115,56), (42,115,112), (210,55,56), (78,115,56), (210,115,56), and the numerical sequence is used as a reference pixel value, it is understood that the pixel value may also be expressed by other pixel expressions of other RGB value correlation conversion, which is not limited herein.
303. And comparing the reference pixel value with the pixel values of the A pixel sets respectively to determine a difference pixel set.
In this embodiment, the number of the difference pixel sets is B, which corresponds to the step 301, B is less than or equal to a, and B is a positive integer.
It will be appreciated that the set of difference pixels may be a set of pixels that are different from the reference pixel value, i.e. the region corresponding to a different colour to the region corresponding to the reference pixel value may be used to indicate whether or not there is display content.
Optionally, because some of the base colors of the interface adopt an gradient color design, when the interface has no display content, the interface is still detected and judged to have content due to the relationship of the base colors of the interface, at this time, a difference value can be set, that is, the difference value between the pixel value of a certain pixel set and the reference pixel value, which is required to be satisfied for judging the difference pixel set, is in the range of the difference value, that is, the difference value is considered to be similar to the reference pixel value, otherwise, the difference pixel set is determined.
In one possible scenario, to reduce the amount of computation in the interface detection process, interval detection may be used, i.e., selecting and comparing pixel points in a certain pixel set with a base pixel value. Specifically, a preset comparison interval is firstly obtained; then C comparison pixel sets are determined according to the preset comparison interval, B is more than or equal to C and less than or equal to A, and C is a positive integer; and comparing the reference pixel value with the pixel values corresponding to the C comparison pixel sets respectively to determine B difference pixel sets. The preset comparison interval may be that the comparison is performed with the base pixel value once every 2 rows until all the pixel sets are traversed.
304. And calculating the white screen parameters of the first detection picture according to a first preset rule.
In this embodiment, the first preset rule is set based on a number ratio of the difference pixel set to the pixel set.
In one possible expression, the white screen parameters may be represented by the following formula: white screen parameter = 100-B/a x 100; wherein B is the number of difference pixel sets, A is the number of all pixel sets of the detection picture.
305. And if the white screen parameters meet preset conditions, determining that the current interface is a white screen and sending a detection report.
In this embodiment, the preset condition is determined based on a size relationship between the white screen parameter and a preset threshold. The preset condition may be that the white screen parameter is greater than a preset threshold, for example, the preset threshold is 80, and an interface with the white screen parameter greater than 80 is considered to be white screen; the preset condition may also be that the difference between the white screen parameter and the preset threshold reaches a certain limit, for example, the preset threshold is 80, the white screen parameter is 90, and the difference is 10 and greater than the limit 5, and the interface is considered to appear white screen.
It will be appreciated that after the white screen is determined, a detection report may also be generated and sent, where the detection report may include the result of the white screen detection and may also include the currently detected parameter configuration, for example: the detection configuration content can take the following form:
{
delay 3000, (detection opportunity, default delay detection)
Percent 80 (white screen when the percentage, color similarity reaches a specified percentage)
}
Detecting content:
{
percent 90, (color similarity, percentage)
area 1, (region, upper, middle and lower regions are 1, 2 and 3 respectively)
}
Optionally, after uploading the report, the preset threshold may be adjusted according to the report, for example: the detection report indicates that the current interface is a white screen, but the related personnel find that the current interface is not the white screen, and the detection report may be caused by the fact that the preset threshold is too small, that is, the preset threshold for the difference pixels is too small, and the preset threshold can be increased at the moment so as to be used for the interface detection process at the next moment.
By combining the above embodiments, the reference pixel value is determined by determining the current interface, acquiring a detection picture, and then acquiring at least one pixel set of the detection picture in the preset direction; comparing the reference pixel value with the pixel value of each pixel set respectively to determine a difference pixel set; calculating a white screen parameter of the detected picture according to a preset rule, wherein the preset rule is set based on the quantity ratio of the difference pixel set to the pixel set; if the white screen parameters meet preset conditions, determining that the current interface is a white screen and sending a detection report, so that real-time detection of the interface white screen is realized; the detection picture can accurately reflect the display condition of the interface, so that the detection process of the process has good credibility, improves the accuracy of interface detection, and has wider application range.
The above embodiment describes the detection process for a single detected picture, but when the first detected picture obtained by cutting is detected as not being a white screen, the current interface still has the possibility of a white screen; next, the scenario is described with reference to the accompanying drawings, as shown in fig. 4, fig. 4 is a flowchart of another method for detecting an interface according to an embodiment of the present application, where the embodiment of the present application at least includes the following steps:
401. and determining the current interface, and acquiring a screen capturing picture.
402. And cutting the screen capturing pictures to obtain a plurality of detection pictures.
In this embodiment, steps 401-402 are similar to step 301 in fig. 3, and the related description may be referred to, and will not be repeated here.
403. And calculating the white screen parameters of the first detection picture.
In this embodiment, the process of calculating the white screen parameter of the first detected picture may refer to the relevant descriptions of steps 302-304, that is, the process of determining the reference pixel value, detecting the difference pixel set, and calculating the white screen parameter.
404. Judging whether the white screen parameters meet preset conditions.
In this embodiment, the determination of the white screen parameter of the first detected picture may refer to the related description in step 305, which is not described herein.
405. And calculating the white screen parameters of the second detection picture.
In this embodiment, when the first detected picture is detected as not being a white screen, the detection process for the second detected picture is immediately entered, and it can be understood that, in the screenshot of the same interface, the first detected picture and the second detected picture may be adjacent pictures or non-adjacent pictures, and specific selection logic depends on the actual scene.
406. And determining that the current interface is white.
In this embodiment, when the first detection picture is detected as a white screen, that is, the second detection picture is not required to be detected, the relevant report of the white screen is directly uploaded.
407. Judging whether the white screen parameters meet preset conditions.
In this embodiment, the determination of the white screen parameter of the second detected picture may refer to the related description in step 305, which is not described herein.
408. And determining that the current interface is white.
In this embodiment, when the second detection picture is detected as being a white screen, the relevant report of the white screen is uploaded.
It will be appreciated that if the second detection picture is detected as not being a white screen, the third detection picture, the fourth detection picture, etc. obtained by cutting the current interface may be further detected, and only the second detection picture will be described herein, and if there is a subsequent detection step, reference may also be made to the detection process of the second detection picture.
409. A report is generated.
410. And comparing, analyzing and updating the preset threshold value.
In this embodiment, after uploading the report, the preset threshold may be adjusted according to the report, for example: the detection report indicates that the current interface is a white screen, but the related personnel find that the current interface is not the white screen, and the detection report may be caused by the fact that the preset threshold is too small, that is, the preset threshold for the difference pixels is too small, and the preset threshold can be increased at the moment so as to be used for the interface detection process at the next moment.
The calculation amount of interface detection is reduced by the partition detection mode; due to the setting of the multi-picture detection logic, the accuracy of interface detection is also ensured.
The following describes the interface detection method provided by the present application with reference to a specific scenario, as shown in fig. 5, which is a schematic diagram of an application scenario provided by an embodiment of the present application. In the figure, firstly, starting white screen detection, then, carrying out screen capturing on a current page, carrying out image cutting according to trisection of the length of the screen capturing corresponding to an image, then, scanning the detected image obtained by cutting to obtain a pixel set representation, namely, taking a first column of pixel values of the detected image as a reference pixel value, when the pixel values corresponding to other columns are the same as the reference pixel value, calculating the pixel values to be 0, calculating the pixel values to be 1 when the pixel values are different from the reference pixel value, finally, counting the similarity, namely, a white screen parameter, scanning the next image of the cut image if the similarity is smaller than a preset threshold value, feeding back a result if the similarity is larger than the preset threshold value, and scanning the next interface.
In one possible display manner, a display manner as shown in fig. 6 may be adopted, and fig. 6 is a schematic diagram of interface display of an interface detection according to an embodiment of the present application. The interface may include monitoring of white screen detection for a plurality of applications and displaying corresponding white screen parameters; the user can also know which area of the white screen interface is in the specific white screen by looking at the details, and can also query the detected time delay to judge the relevant reason of the white screen, for example, the detection time delay of the application program 1 in the figure is 1000ms, and compared with the detection time delay of the application programs 2 and 3, the detection time delay is smaller, which is probably due to the fact that the relevant data is not loaded completely, so that the detection time delay can be properly adjusted.
In order to better implement the above-described aspects of the embodiments of the present application, the following provides related apparatuses for implementing the above-described aspects. Referring to fig. 7, fig. 7 is a schematic structural diagram of an interface detection device according to an embodiment of the present application, and an interface detection device 700 includes:
a determining unit 701, configured to determine a current interface to obtain a first detection picture, where the first detection picture includes a pixel sets, and a is a positive integer;
an obtaining unit 702, configured to obtain at least one pixel set of the first detected picture in a preset direction, so as to determine a reference pixel value;
A comparing unit 703, configured to compare the reference pixel value with the pixel values of the a pixel sets, respectively, so as to determine B difference pixel sets, where B is less than or equal to a, and B is a positive integer;
a calculating unit 704, configured to calculate a white screen parameter of the first detected picture according to a first preset rule, where the first preset rule is set based on a number ratio of the difference pixel set to the pixel set;
and the judging unit 705 is configured to determine that the current interface is a white screen and send a detection report if the white screen parameter meets a preset condition, where the preset condition is determined based on a size relationship between the white screen parameter and a preset threshold.
Preferably, in some possible implementations of the present application, the determining unit 701 is specifically configured to determine a current interface to obtain a screenshot;
the determining unit 701 is specifically configured to cut the screenshot pictures according to a second preset rule to determine a plurality of cut pictures, where the second preset rule is set based on picture parameters of the screenshot pictures;
the determining unit 701 is specifically configured to determine the first detection picture from the plurality of cut pictures according to a preset order.
Preferably, in some possible implementations of the present application, the determining unit 701 is further configured to select, if the white screen parameter does not meet a preset condition, a second detected picture from the plurality of cut pictures according to the preset order;
The determining unit 701 is specifically configured to calculate a white screen parameter of the second detected picture according to a first preset rule;
the determining unit 701 is specifically configured to determine that the current interface is a white screen and send a detection report if the white screen parameter of the second detection picture meets a preset condition.
Preferably, in some possible implementations of the present application, the comparing unit 703 is specifically configured to obtain a preset comparison interval;
the comparing unit 703 is specifically configured to determine C sets of comparison pixels according to the preset comparison interval, where B is equal to or less than C and equal to or less than a, and C is a positive integer;
the comparing unit 703 is specifically configured to compare the reference pixel value with the pixel values corresponding to the C comparison pixel sets respectively, so as to determine B difference pixel sets.
Preferably, in some possible implementations of the present application, the determining unit 701 is specifically configured to determine a current interface, and wait for a preset detection duration, where the preset detection duration is set based on a data loading condition of the current interface;
the determining unit 701 is specifically configured to obtain a first detection picture if the waiting duration reaches the preset detection duration.
Preferably, in some possible implementations of the present application, the determining unit 701 is specifically configured to determine a current interface, so as to determine a target component, where the target component is used to indicate a component that sends feedback after loading is completed;
The determining unit 701 is specifically configured to determine a feedback duration according to the target component;
the determining unit 701 is specifically configured to wait for the preset detection duration, where the preset detection duration is set based on the feedback duration.
Preferably, in some possible implementations of the present application, the determining unit 701 is further configured to extract the current interface, and compare the current interface with a preset picture to obtain a comparison result, where the preset picture is used to indicate a picture determined to be a white screen;
the determining unit 701 is further configured to adjust the preset threshold according to the comparison result, where the adjusted preset threshold is used to indicate whether a white screen parameter of the interface at the next moment meets the judgment of the preset condition.
Determining a reference pixel value by determining a current interface, acquiring a detection picture and then acquiring at least one pixel set of the detection picture in a preset direction; comparing the reference pixel value with the pixel value of each pixel set respectively to determine a difference pixel set; calculating a white screen parameter of the detected picture according to a preset rule, wherein the preset rule is set based on the quantity ratio of the difference pixel set to the pixel set; if the white screen parameters meet preset conditions, determining that the current interface is a white screen and sending a detection report, so that real-time detection of the interface white screen is realized; the detection picture can accurately reflect the display condition of the interface, so that the detection process of the process has good credibility, improves the accuracy of interface detection, and has wider application range.
Referring to fig. 8, fig. 8 is a schematic structural diagram of another interface detection device according to an embodiment of the present application, where the interface detection device 800 may have a relatively large difference due to different configurations or performances, and may include one or more central processing units (central processing units, CPU) 822 (e.g., one or more processors) and a memory 832, and one or more storage mediums 830 (e.g., one or more mass storage devices) storing application programs 842 or data 844. Wherein the memory 832 and the storage medium 830 may be transitory or persistent. The program stored in the storage medium 830 may include one or more modules (not shown), each of which may include a series of instruction operations in the interface detection device. Still further, the central processor 822 may be configured to communicate with the storage medium 830 to execute a series of instruction operations in the storage medium 830 on the interface detection device 800.
Interface detection device 800 may also include one or more power supplies 826, one or more wired or wireless network interfaces 850, one or more input/output interfaces 858, and/or one or more operating systems 841, such as Windows Server, mac OS XTM, unixTM, linuxTM, freeBSDTM, etc.
The steps performed by the interface detecting means in the above-described embodiments may be based on the interface detecting means structure shown in fig. 8.
Embodiments of the present application also provide a computer-readable storage medium having stored therein interface detection instructions that, when executed on a computer, cause the computer to perform the steps performed by the interface detection apparatus in the method described in the embodiments of fig. 2 to 6.
Embodiments of the present application also provide a computer program product comprising interface detection instructions which, when run on a computer, cause the computer to perform the steps performed by the interface detection apparatus in the method described in the embodiments of figures 2 to 6 described above.
The embodiment of the application also provides an interface detection system, which can comprise the interface detection device in the embodiment shown in fig. 7 or the interface detection device shown in fig. 8.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in whole or in part in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, an interface detection means, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (14)

1. A method of interface detection, comprising:
determining a current interface to obtain a first detection picture, wherein the first detection picture comprises A pixel sets, and A is a positive integer;
acquiring at least one pixel set of the first detection picture in a preset direction to determine a reference pixel value;
comparing the reference pixel value with the pixel values of the A pixel sets respectively to determine B difference pixel sets, wherein B is less than or equal to A, and B is a positive integer;
calculating a white screen parameter of the first detection picture according to a first preset rule, wherein the first preset rule is set based on the quantity ratio of the difference pixel set to the A pixel sets;
if the white screen parameter meets a preset condition, determining that the current interface is a white screen and sending a detection report, wherein the preset condition is determined based on the size relation between the white screen parameter and a preset threshold;
extracting the current interface, and comparing the current interface with a preset picture to obtain a comparison result, wherein the preset picture is used for indicating a picture determined to be a white screen;
and adjusting the preset threshold according to the comparison result, wherein the adjusted preset threshold is used for indicating whether the white screen parameter of the interface at the next moment meets the judgment of the preset condition.
2. The method of claim 1, wherein determining the current interface to obtain the first detected picture comprises:
determining a current interface to acquire a screen capturing picture;
cutting the screen capturing pictures according to a second preset rule to determine a plurality of cut pictures, wherein the second preset rule is set based on picture parameters of the screen capturing pictures;
and determining the first detection picture in the plurality of cutting pictures according to a preset sequence.
3. The method according to claim 2, wherein the method further comprises:
if the white screen parameters do not meet the preset conditions, selecting a second detection picture from the plurality of cutting pictures according to the preset sequence;
calculating the white screen parameters of the second detection picture according to a first preset rule;
and if the white screen parameter of the second detection picture meets the preset condition, determining that the current interface is a white screen and sending a detection report.
4. The method of claim 1, wherein the comparing the reference pixel value with the pixel values of the a sets of pixels, respectively, to determine B sets of difference pixels comprises:
acquiring a preset comparison interval;
C comparison pixel sets are determined according to the preset comparison interval, B is more than or equal to C and less than or equal to A, and C is a positive integer;
and comparing the reference pixel value with the pixel values corresponding to the C comparison pixel sets respectively to determine B difference pixel sets.
5. The method of claim 1, wherein determining the current interface to obtain the first detected picture comprises:
determining a current interface, and waiting for a preset detection time length, wherein the preset detection time length is set based on the data loading condition of the current interface;
and if the waiting time length reaches the preset detection time length, acquiring a first detection picture.
6. The method of claim 5, wherein determining the current interface and waiting for a preset detection duration comprises:
determining a current interface to determine a target component, wherein the target component is used for indicating a component for sending feedback after loading is completed;
determining a feedback time length according to the target component;
waiting for the preset detection time period, wherein the preset detection time period is set based on the feedback time period.
7. An apparatus for interface detection, comprising:
the device comprises a determining unit, a display unit and a display unit, wherein the determining unit is used for determining a current interface to obtain a first detection picture, the first detection picture comprises A pixel sets, and A is a positive integer;
An acquisition unit, configured to acquire at least one pixel set of the first detection picture in a preset direction, so as to determine a reference pixel value;
the comparison unit is used for respectively comparing the reference pixel value with the pixel values of the A pixel sets to determine B difference pixel sets, B is less than or equal to A, and B is a positive integer;
the computing unit is used for computing the white screen parameter of the first detection picture according to a first preset rule, and the first preset rule is set based on the quantity ratio of the difference pixel set to the A pixel sets;
the judging unit is used for determining that the current interface is a white screen and sending a detection report if the white screen parameter meets the preset condition, and the preset condition is determined based on the size relation between the white screen parameter and a preset threshold;
the determining unit is further configured to extract the current interface, and compare the current interface with a preset picture to obtain a comparison result, where the preset picture is used to indicate a picture determined to be a white screen; and adjusting the preset threshold according to the comparison result, wherein the adjusted preset threshold is used for indicating whether the white screen parameter of the interface at the next moment meets the judgment of the preset condition.
8. The apparatus according to claim 7, wherein the determining unit is specifically configured to:
determining a current interface to acquire a screen capturing picture;
cutting the screen capturing pictures according to a second preset rule to determine a plurality of cut pictures, wherein the second preset rule is set based on picture parameters of the screen capturing pictures;
and determining the first detection picture in the plurality of cutting pictures according to a preset sequence.
9. The apparatus of claim 8, wherein the determining unit is further configured to:
if the white screen parameters do not meet the preset conditions, selecting a second detection picture from the plurality of cutting pictures according to the preset sequence;
calculating the white screen parameters of the second detection picture according to a first preset rule;
and if the white screen parameter of the second detection picture meets the preset condition, determining that the current interface is a white screen and sending a detection report.
10. The apparatus according to claim 7, wherein the comparing unit is specifically configured to:
acquiring a preset comparison interval;
c comparison pixel sets are determined according to the preset comparison interval, B is more than or equal to C and less than or equal to A, and C is a positive integer;
and comparing the reference pixel value with the pixel values corresponding to the C comparison pixel sets respectively to determine B difference pixel sets.
11. The apparatus according to claim 7, wherein the determining unit is specifically configured to:
determining a current interface, and waiting for a preset detection time length, wherein the preset detection time length is set based on the data loading condition of the current interface;
and if the waiting time length reaches the preset detection time length, acquiring a first detection picture.
12. The apparatus according to claim 11, wherein the determining unit is specifically configured to
Determining a current interface to determine a target component, wherein the target component is used for indicating a component for sending feedback after loading is completed;
determining a feedback time length according to the target component;
waiting for the preset detection time period, wherein the preset detection time period is set based on the feedback time period.
13. A computer device, the computer device comprising a processor and a memory:
the memory is used for storing program codes; the processor is configured to perform the method of interface detection of any one of claims 1 to 6 according to instructions in the program code.
14. A computer readable storage medium having instructions stored therein which, when run on a computer, cause the computer to perform the method of interface detection of any of the preceding claims 1 to 6.
CN201910804142.6A 2019-08-28 2019-08-28 Interface detection method and related device Active CN112527539B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910804142.6A CN112527539B (en) 2019-08-28 2019-08-28 Interface detection method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910804142.6A CN112527539B (en) 2019-08-28 2019-08-28 Interface detection method and related device

Publications (2)

Publication Number Publication Date
CN112527539A CN112527539A (en) 2021-03-19
CN112527539B true CN112527539B (en) 2023-10-03

Family

ID=74973956

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910804142.6A Active CN112527539B (en) 2019-08-28 2019-08-28 Interface detection method and related device

Country Status (1)

Country Link
CN (1) CN112527539B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115220939A (en) * 2021-08-05 2022-10-21 广州汽车集团股份有限公司 Fault recovery method and device for vehicle-mounted display equipment, terminal equipment and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105955884A (en) * 2016-04-27 2016-09-21 上海携程商务有限公司 Method and device for checking white screen of App (Application) page
CN105979092A (en) * 2016-05-13 2016-09-28 腾讯科技(深圳)有限公司 Abnormity monitoring method and device
CN108984399A (en) * 2018-06-29 2018-12-11 上海连尚网络科技有限公司 Detect method, electronic equipment and the computer-readable medium of interface difference
CN109005457A (en) * 2018-09-19 2018-12-14 腾讯科技(北京)有限公司 Blank screen detection method, device, computer equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105955884A (en) * 2016-04-27 2016-09-21 上海携程商务有限公司 Method and device for checking white screen of App (Application) page
CN105979092A (en) * 2016-05-13 2016-09-28 腾讯科技(深圳)有限公司 Abnormity monitoring method and device
CN108984399A (en) * 2018-06-29 2018-12-11 上海连尚网络科技有限公司 Detect method, electronic equipment and the computer-readable medium of interface difference
CN109005457A (en) * 2018-09-19 2018-12-14 腾讯科技(北京)有限公司 Blank screen detection method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN112527539A (en) 2021-03-19

Similar Documents

Publication Publication Date Title
CN106951346B (en) Response time testing method and device
CN105979092B (en) Abnormity monitoring method and device
US10313746B2 (en) Server, client and video processing method
CN105469381B (en) Information processing method and terminal
CN111629146B (en) Shooting parameter adjusting method, shooting parameter adjusting device, shooting parameter adjusting equipment and storage medium
CN110392306A (en) A kind of data processing method and equipment
US20160065425A1 (en) Visual representations of status
CN113766217A (en) Video delay test method and device, electronic equipment and storage medium
CN112527539B (en) Interface detection method and related device
CN112788329A (en) Video static frame detection method and device, television and storage medium
CN110531951B (en) Picture output mode adjusting method, device, equipment, system and storage medium
JP2001186514A (en) Method and device for detecting repeated frame of video signal
US9026584B2 (en) Server device, communication method, and program product for processing the transfer of screen changes
CN111431761A (en) Method and device for measuring time delay of cloud mobile phone response rendering stage
CN115643408A (en) Image compression method, device, equipment and storage medium
CN113315913B (en) Image sensor control method and related product
CN113141433B (en) Method and device for testing screen sensitivity and processor
CN106056042B (en) It generates video data transformation and indicates and analyze the method and system of video data
CN106484215B (en) Method and device for managing desktop of mobile terminal
CN112199131B (en) Page detection method, device and equipment
CN110971895B (en) Video jitter detection method and device
CN114005059A (en) Video transition detection method and device and electronic equipment
CN115115526A (en) Image processing method and apparatus, storage medium, and graphic calculation processor
CN112770014A (en) Static frame detection method and device and readable storage medium
JP2018036687A (en) Information processing device and information processing method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant