Interface consistency detection method, electronic device, storage medium and program product

By performing layout analysis on the interface and using progressive, tiled or structured comparison methods, the problem of low fault tolerance for interface consistency detection in the prior art is solved, and the accuracy and reliability of detection are improved.

CN119739638APending Publication Date: 2025-04-01KE COM (BEIJING) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411855734.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

In the prior art, interface consistency detection relies on pixel-level comparison, resulting in low fault tolerance, affecting the accuracy and reliability of detection, especially when facing details, device differences or dynamic content.

Method used

An interface consistency detection method is proposed. By obtaining the reference interface and the interface to be detected, layout analysis is performed separately to obtain the reference layout diagram and the layout diagram to be detected, and comparison is adopted using progressive, tiled or structured comparison methods to obtain the comparison results.

Benefits of technology

Through layout diagram comparison, the impact of details changes and dynamic content can be eliminated, the efficiency, accuracy and reliability of interface consistency detection can be improved, and the problem of low fault tolerance in the existing technology can be solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739638A_ABST
    Figure CN119739638A_ABST
Patent Text Reader

Abstract

The present disclosure provides an interface consistency detection method, electronic device, storage medium and program product. The interface consistency detection method of the present disclosure comprises: obtaining a reference interface and an interface to be detected; performing layout analysis on the reference interface and the interface to be detected respectively to obtain a reference layout diagram and a layout diagram to be detected; comparing the reference layout diagram with the layout diagram to be detected to obtain a comparison result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to technical fields such as interface testing, and in particular to an interface consistency detection method, electronic equipment, storage medium and program product. Background Art

[0002] Interface consistency testing is an important quality assurance process that aims to ensure that the user interface remains the same or as expected in terms of visual performance, layout structure, etc. in applications or websites across different versions, platforms, or devices.

[0003] Taking different versions of applications or websites as an example, in the prior art, the user interface of the old version of the application or website is usually compared at pixel level with the user interface of the new version of the application or website to detect the pixel difference between the two versions of the user interface.

[0004] However, since pixel-level comparison relies on precise pixel-by-pixel matching, and changes in details, device differences, or dynamic content in the user interface may be misjudged as pixel differences, the fault tolerance of interface consistency detection is low, affecting the accuracy and reliability of interface consistency detection. Summary of the invention

[0005] The present disclosure provides an interface consistency detection method, electronic equipment, storage medium and program product.

[0006] According to one aspect of the present disclosure, there is provided an interface consistency detection method, comprising: Obtain the reference interface and the interface to be detected; Performing layout analysis on the reference interface and the interface to be detected respectively to obtain a reference layout diagram and a layout diagram to be detected; The reference layout diagram is compared with the layout diagram to be detected to obtain a comparison result.

[0007] According to at least one embodiment of the interface consistency detection method of the present disclosure, the comparing the reference layout diagram with the layout diagram to be detected to obtain a comparison result includes: Using a progressive comparison method to compare the reference layout diagram with the layout diagram to be tested to obtain a comparison result; or, Using a flat-layout comparison method to compare the reference layout diagram with the layout diagram to be tested to obtain a comparison result; or, The reference layout diagram is compared with the layout diagram to be detected by using a structured comparison method to obtain a comparison result.

[0008] According to at least one embodiment of the interface consistency detection method of the present disclosure, the step of using a progressive comparison method to compare the reference layout diagram with the layout diagram to be detected to obtain a comparison result includes: Acquire the total number of reference blocks of the reference layout diagram and the total number of blocks to be detected of the layout diagram to be detected; Determining whether the total number of the reference blocks is the same as the total number of the blocks to be detected; When the total number of the reference blocks is different from the total number of the blocks to be detected, the inconsistency between the reference interface and the interface to be detected is taken as the comparison result.

[0009] According to at least one embodiment of the interface consistency detection method of the present disclosure, when the total number of the reference blocks is the same as the total number of the blocks to be detected, the reference layout diagram is compared with the layout diagram to be detected by using a progressive comparison method to obtain a comparison result, and further includes: Performing pixel-level comparison between the reference layout image and the layout image to be detected to obtain a pixel difference result; When the pixel difference result is pixel consistency, the consistency between the reference interface and the interface to be detected is taken as the comparison result.

[0010] According to the interface consistency detection method of at least one embodiment of the present disclosure, the pixel-level comparison between the reference layout image and the layout image to be detected includes: Binarization is performed on the reference layout image and the layout image to be detected to obtain a reference black-and-white image and a black-and-white image to be detected; A pixel-level comparison is performed between the reference black-and-white image and the black-and-white image to be detected.

[0011] According to at least one embodiment of the interface consistency detection method of the present disclosure, when the pixel difference result is pixel inconsistency, the reference layout diagram is compared with the layout diagram to be detected by using a progressive comparison method to obtain a comparison result, and further includes: Grouping the blocks of the reference layout diagram and the blocks of the layout diagram to be detected respectively to obtain a plurality of reference block groups and a plurality of block groups to be detected; Acquire the number of reference groups of the plurality of reference block groups and the number of to-be-detected groups of the plurality of to-be-detected block groups; Determining whether the reference number of groups is the same as the number of groups to be detected; When the reference group number and the to-be-detected group number are different, the inconsistency between the reference interface and the to-be-detected interface is taken as the comparison result.

[0012] According to at least one embodiment of the interface consistency detection method of the present disclosure, when the reference group number and the to-be-detected group number are the same, the stepwise comparison method is used to compare the reference layout diagram with the to-be-detected layout diagram to obtain a comparison result, and further includes: for each reference block group, determining whether the reference block number of blocks included in the reference block group and the to-be-detected block number of blocks included in the to-be-detected block group related to the reference block group are the same; when the reference block number and the to-be-detected block number are different, taking the inconsistency between the reference interface and the to-be-detected interface as the comparison result; Optionally, when the number of reference blocks is the same as the number of blocks to be detected, the use of a progressive comparison method to compare the reference layout diagram with the layout diagram to be detected to obtain a comparison result further includes: obtaining a reference size of a block in the reference layout diagram and a size to be detected of a block in the layout diagram to be detected; determining whether the reference size is the same as the size to be detected; when the reference size is the same as the size to be detected, taking the consistency of the reference interface with the interface to be detected as the comparison result; when the reference size is different from the size to be detected, taking the inconsistency of the reference interface with the interface to be detected as the comparison result; Optionally, the obtaining of the reference size of the block in the reference layout diagram and the to-be-detected size of the block in the to-be-detected layout diagram comprises: obtaining the reference size of the block in the reference layout diagram relative to the reference layout diagram; obtaining the to-be-detected size of the block in the to-be-detected layout diagram relative to the to-be-detected layout diagram; Optionally, the performing layout analysis on the reference interface and the interface to be detected respectively includes: preprocessing the reference interface and the interface to be detected respectively to obtain a reference processing interface and a processing interface to be detected; performing element segmentation on the reference processing interface and the processing interface to be detected respectively to obtain reference element information and element information to be detected; and acquiring the reference layout diagram and the layout diagram to be detected respectively according to the reference element information and the element information to be detected; Optionally, before obtaining the reference interface and the interface to be detected, the method further includes: obtaining a first application and a second application; respectively controlling the first application and the second application to enter different interfaces and take screenshots to obtain a first screenshot and a second screenshot; obtaining the reference interface from the first screenshot; and obtaining the interface to be detected from the second screenshot.

[0013] According to another aspect of the present disclosure, an electronic device is provided, comprising: a memory storing execution instructions; and a processor executing the execution instructions stored in the memory, so that the processor executes the interface consistency detection method of any embodiment of the present disclosure.

[0014] According to another aspect of the present disclosure, a readable storage medium is provided, wherein the readable storage medium stores execution instructions, and when the execution instructions are executed by a processor, the interface consistency detection method of any embodiment of the present disclosure is implemented.

[0015] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the interface consistency detection method of any embodiment of the present disclosure is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings illustrate exemplary embodiments of the present disclosure and together with the description serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.

[0017] Figure 1 The process of the interface consistency detection method of an embodiment of the present disclosure is as follows Figure 1 .

[0018] Figure 2 The process of the interface consistency detection method of an embodiment of the present disclosure is as follows Figure 2 .

[0019] Figure 3 The process of the interface consistency detection method of an embodiment of the present disclosure is as follows Figure 3 .

[0020] Figure 4 The process of the interface consistency detection method of an embodiment of the present disclosure is as follows Figure 4 .

[0021] Figure 5 yes Figure 4 The process of the progressive detection method in the interface consistency detection method shown Figure 1 .

[0022] Figure 6 yes Figure 4 The process of the progressive detection method in the interface consistency detection method shown Figure 2 .

[0023] Figure 7 yes Figure 6 A flowchart of the pixel-level comparison method in the progressive detection method is shown.

[0024] Figure 8 yes Figure 4 The process of the progressive detection method in the interface consistency detection method shown Figure 3 .

[0025] Fig. 9 yes Figure 4 The process of the progressive detection method in the interface consistency detection method shown Figure 4 .

[0026] Fig.10 yes Figure 4 The process of the progressive detection method in the interface consistency detection method shown Figure 5 .

[0027] Fig.11 yes Fig.10 A flow chart of a size acquisition method in a progressive detection method is shown.

[0028] Fig.12 yes Figure 1 A flow chart of the layout analysis method in the interface consistency detection method shown.

[0029] Fig.13 yes Figure 1 The flowchart of the interface acquisition method in the interface consistency detection method shown.

[0030] Fig.14 It is a schematic flow chart of the interface consistency detection method according to the embodiment of the present disclosure.

[0031] Fig.15 It is a schematic block diagram of the structure of an interface consistency detection device according to an embodiment of the present invention.

[0032] Fig.16 It is a schematic block diagram of the structure of an electronic device equipped with an interface consistency detection device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0033] The present disclosure is further described in detail below in conjunction with the accompanying drawings and examples. It is understood that the specific examples described herein are only used to explain the relevant content, rather than to limit the present disclosure. It should also be noted that, for ease of description, only the parts related to the present disclosure are shown in the accompanying drawings.

[0034] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in the present disclosure can be combined with each other. The technical solution of the present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0035] Taking the interface consistency detection of the product details page of the new and old versions of the e-commerce website as an example, assuming that the product details page contains the following elements: automatically rotated product pictures, real-time prices that change dynamically according to discounts, countdown promotions that display the remaining time, and a user evaluation module with a paginated comment list, when performing pixel-level comparison, changes in the remaining time, real-time price changes caused by dynamic discounts, and different product pictures displayed in each screenshot may all lead to false positives, thereby weakening the accuracy and reliability of interface consistency detection.

[0036] To this end, the present disclosure proposes an interface consistency detection method, electronic device, storage medium and program product. For interface consistency detection of web pages or desktop applications, it can be implemented through detection software installed on a computer; for interface consistency detection of mobile applications, it can be implemented through detection software installed on mobile devices such as mobile phones and tablets; for interface consistency detection of large-scale projects, it can be implemented through detection software installed on a server.

[0037] For the convenience of description and to make the technical solutions of the specific implementation methods of the present disclosure easier to understand, before describing the interface consistency detection method implemented by the present disclosure, the technical terms involved in the specific implementation methods of the present disclosure are explained as follows: Layout analysis refers to the process of converting the original image into a structured layout diagram through a series of algorithms and techniques.

[0038] Progressive contrast is a gradually deepening contrast method, from rough to fine and gradually in-depth.

[0039] Tiled comparison is a comparison method that displays the content to be compared side by side.

[0040] Structural contrast is a contrast method based on interface structure.

[0041] Figure 1 FIG. 1 is a schematic diagram showing the overall process of an interface consistency detection method M100 according to an embodiment of the present disclosure. Figure 1 The method shown includes steps S110 to S130. The method can be executed by electronic devices such as mobile phones and tablet computers.

[0042] Specifically, Figure 1 The methods shown include: Step S110, obtaining a reference interface and an interface to be detected.

[0043] In some embodiments of the present disclosure, when performing interface consistency detection on different versions of applications, the reference interface in step S110 may be the interface of any application in the two versions of the application to be detected for interface consistency, and the interface to be detected may be the interface of the other application; in particular, in order to avoid unexpected errors or inconsistencies introduced by the new version of the application, and to ensure the consistency, stability and compatibility of the interface, the reference interface in step S110 may be the interface of the current stable version (the version currently used by the user, which has been fully tested and verified) or the original version of the application, and the interface to be detected may be the interface of the new version of the application.

[0044] When performing interface consistency detection on applications on different platforms, the reference interface in step S110 may be the interface of an application on any one of the two platforms to be detected, and the interface to be detected may be the interface of the application on the other platform.

[0045] When performing interface consistency detection on applications of different terminal devices, the reference interface in step S110 can be the interface of the application of any terminal device among the applications of the two terminal devices to be detected, and the interface to be detected is the interface of the application of the other terminal device.

[0046] Step S120 , performing layout analysis on the reference interface and the interface to be detected respectively to obtain a reference layout diagram and a layout diagram to be detected.

[0047] In some embodiments of the present disclosure, the layout analysis in step S120 can be implemented based on image processing, including image segmentation, edge detection, region detection and other processes; the layout analysis can also be implemented based on computer vision, including target detection, optical character recognition, layout structure recognition and other processes.

[0048] The reference layout diagram obtained through step S120 reflects the position, size, arrangement and hierarchical relationship of interface elements such as buttons, text boxes, images, navigation bars, etc. in the reference interface on the reference interface, and the layout diagram to be detected reflects the position, size, arrangement and hierarchical relationship of elements in the interface to be detected on the interface to be detected.

[0049] The reference layout diagram and the layout diagram to be detected obtained in step S120 may be expressed in the form of structured data (such as JSON, XML, SVG, etc.), visual graphics (intuitively displaying the layout features such as the position, size, and alignment of elements through rectangles, arrows, lines, etc.), grid system diagrams (showing how elements are aligned and distributed according to the grid system), etc. The reference layout diagram and the layout diagram to be detected obtained in step S120 may be specifically color layout diagrams, that is, different colors are used to distinguish and identify different areas, functional areas, and elements in the reference interface and the interface to be detected.

[0050] Step S130, comparing the reference layout diagram with the layout diagram to be tested to obtain a comparison result.

[0051] In some embodiments of the present disclosure, step S130 can be used to compare the differences between the reference layout diagram and the layout diagram to be detected in terms of position, level, alignment, spacing, etc. When the reference layout diagram and the layout diagram to be detected obtained by step S120 are structured data, the comparison in step S130 can adopt structured data comparison; when the reference layout diagram and the layout diagram to be detected obtained by step S120 are in a visual form, the comparison in step S130 can adopt graphical comparison; when the reference layout diagram and the layout diagram to be detected obtained by step S120 are in a grid system, the comparison in step S130 can adopt layout rule comparison based on the grid system, etc.

[0052] The comparison result obtained in step S130 may be consistent or inconsistent.

[0053] The interface consistency detection method provided by the present disclosure realizes interface consistency detection through layout diagram comparison. Since the layout diagram comparison focuses on the relative position, size and hierarchical relationship between elements, it can eliminate the inconsistency of detail changes, dynamic content, etc. Therefore, the layout comparison can be unaffected by the difference in display details, and the efficiency, accuracy and reliability of interface consistency comparison can be improved. This method solves the problem in the prior art that because pixel-level comparison relies on precise pixel-by-pixel matching, detail changes, device differences or dynamic content in the user interface may be misjudged as pixel differences, the fault tolerance rate of interface consistency detection is low, affecting the accuracy and reliability of interface consistency detection.

[0054] Regarding step S130, in some embodiments of the present disclosure, Figure 2 As shown, it can be replaced by the following steps: The reference layout diagram is compared with the layout diagram to be tested by using a flat-layout comparison method to obtain a comparison result.

[0055] In some embodiments of the present disclosure, this step may include: first, obtaining detailed information of the interface elements contained in the baseline layout diagram and the layout diagram to be detected, such as element position, size, hierarchical relationship (such as parent-child relationship or Z-axis order), element attributes (such as type, identifier, etc.), etc.; secondly, matching the interface elements in the baseline layout diagram with the interface elements in the layout diagram to be detected according to the detailed information (for example, matching based on the identifier first, matching based on the position and size when the identifier does not exist, etc.), to obtain multiple matching interface element pairs; again, performing feature comparison on each interface element pair according to the detailed information, to obtain feature comparison results for each interface element pair; finally, summarizing the feature comparison results of all interface element pairs to obtain a comparison result.

[0056] For scenarios with simple interface layouts or strict comparison requirements, this step can be used to perform a tiled comparison, which can display all differences between the baseline layout diagram and the layout diagram to be tested at one time, and can obtain intuitive and comprehensive comparison results.

[0057] Regarding step S130, in some embodiments of the present disclosure, Figure 3 As shown, it can be replaced by the following steps: The reference layout diagram is compared with the layout diagram to be tested using a structured comparison method to obtain a comparison result.

[0058] In some embodiments of the present disclosure, this step may include: first, obtaining detailed information of the interface elements contained in the baseline layout diagram and the layout diagram to be detected; secondly, parsing the baseline layout diagram and the layout diagram to be detected into a baseline tree structure and a tree structure to be detected according to the hierarchical relationship; again, comparing the features of the baseline tree structure and the tree structure to be detected layer by layer from the root node to the child node according to the detailed information to obtain a feature comparison result; finally, summarizing all feature comparison results to obtain a comparison result.

[0059] Structured comparison can improve the accuracy, operability, fault tolerance and adaptability of layout comparison, and provide strong support for interface consistency detection of complex layouts.

[0060] Regarding step S130, in some embodiments of the present disclosure, Figure 4 As shown, it can be replaced by the following steps: The reference layout diagram is compared with the layout diagram to be tested by using a progressive comparison method to obtain a comparison result.

[0061] In some embodiments of the present disclosure, this step can be used to compare the baseline layout diagram and the layout diagram to be tested layer by layer from the whole to the part, thereby improving the adaptability to complex interface layouts and dynamic content while ensuring the accuracy and efficiency of interface consistency detection.

[0062] When the progressive comparison method is adopted, step S130 may include the following steps in some embodiments of the present disclosure: Figure 5 Steps S131 to S133 are shown.

[0063] Step S131 , obtaining the total number of reference blocks of the reference layout diagram and the total number of to-be-detected blocks of the to-be-detected layout diagram.

[0064] In some embodiments of the present disclosure, since a block refers to an element or area in a layout diagram having independent visual or functional significance, the blocks in the baseline layout diagram and the layout diagram to be detected usually have clear boundaries, that is, step S131 can obtain the total number of baseline blocks and the total number of blocks to be detected based on the number of contours in the baseline layout diagram and the layout diagram to be detected, respectively.

[0065] Step S132, determining whether the total number of reference blocks is the same as the total number of blocks to be detected.

[0066] In some embodiments of the present disclosure, when it is determined in step S132 that the total number of reference blocks and the total number of blocks to be detected are different, step S133 is executed.

[0067] Step S133: The inconsistency between the reference interface and the interface to be detected is taken as a comparison result.

[0068] Through steps S131 to S133, an overall comparison between the reference layout diagram and the layout diagram to be tested is achieved, so that global problems can be quickly screened.

[0069] When it is determined through step S132 that the total number of reference blocks is the same as the total number of blocks to be detected, step S130, in some embodiments of the present disclosure, may further include: Figure 6 Steps S134 to S135 are shown.

[0070] Step S134 , performing pixel-level comparison between the reference layout image and the layout image to be detected to obtain a pixel difference result.

[0071] In some embodiments of the present disclosure, the process of performing pixel-level comparison in step S134 may include: respectively calculating the pixel difference between two pixels at the same position in the reference layout diagram and the layout diagram to be detected; when the pixel difference is greater than 0, the pixel difference result is that the pixels of the two pixels are inconsistent; when the pixel difference is equal to 0, the pixel difference result is that the pixels of the two pixels are consistent. In particular, in order to ignore small pixel differences, a tolerance threshold may be set, and when the pixel difference is greater than the tolerance threshold, the pixel difference result is pixel inconsistency; when the pixel difference is less than or equal to the tolerance threshold, the pixel difference result is pixel consistency.

[0072] Step S134 may be directly based on the comparison between the original images of the reference layout image and the layout image to be detected; in particular, in order to improve the accuracy, step S134 may also convert the reference layout image and the layout image to be detected respectively, and then compare based on the converted layout images.

[0073] When it is determined in step S134 that the pixel difference result is pixel consistency, step S135 is executed.

[0074] Step S135 , taking the consistency between the reference interface and the interface to be detected as a comparison result.

[0075] When the overall comparison is preliminarily determined to be consistent with the interface through steps S131 to S132, further pixel-level comparison is performed through steps S134 to S135, which can accurately detect every detail of the reference layout diagram and the layout diagram to be detected, thereby improving the accuracy of interface consistency detection. And because the layout diagram is usually a simplified abstract image with less content, the cost of interface consistency detection is relatively small, which can improve the performance of interface consistency detection.

[0076] Regarding step S134, in some embodiments of the present disclosure, it may include the following steps: Figure 7 Steps S1341 to S1342 are shown.

[0077] Step S1341 , binarizing the reference layout image and the layout image to be detected respectively to obtain a reference black-and-white image and a black-and-white image to be detected.

[0078] In some embodiments of the present disclosure, the binarization in step S1341 is a process of converting each pixel in the reference layout image and the layout image to be detected into black and white respectively.

[0079] Step S1342: perform pixel-level comparison between the reference black-and-white image and the black-and-white image to be detected.

[0080] Through step S1341 to step S1342, the reference layout diagram and the layout diagram to be tested are combined. Figure 2 By comparing the values ​​after quantization, the color information in the reference layout image and the layout image to be detected can be removed, the data volume of the image can be reduced, and the performance overhead of interface consistency detection can be reduced and the processing efficiency can be improved.

[0081] When the pixel difference result is determined to be pixel inconsistency by step S134, step S130, in some embodiments of the present disclosure, may further include: Figure 8 Steps S136 to S139 are shown.

[0082] Step S136 , grouping the blocks of the reference layout image and the to-be-detected layout image respectively to obtain a plurality of reference block groups and a plurality of to-be-detected block groups.

[0083] In some embodiments of the present disclosure, the specific manner of grouping the blocks of the reference layout diagram and the to-be-detected layout diagram respectively through step S136 may include: grouping based on element type (e.g., divided into buttons, text boxes, pictures, navigation bars, etc.), grouping based on position and level (e.g., divided into top area, bottom area, left sidebar, right content area, etc.), grouping based on functional modules (e.g., divided into user information display area, search box area, advertisement display area, operation button area, etc.), etc. Among them, grouping based on position and level may specifically be grouping in the same line according to the vertex coordinate height of the block.

[0084] Step S137 , obtaining the number of reference groups of the plurality of reference block groups and the number of to-be-detected groups of the plurality of to-be-detected block groups.

[0085] Step S138, determining whether the reference group number and the to-be-detected group number are the same.

[0086] In some embodiments of the present disclosure, when it is determined in step S138 that the reference number of groups and the number of groups to be detected are different, step S139 is executed.

[0087] Step S139: The inconsistency between the reference interface and the interface to be detected is taken as a comparison result.

[0088] When the overall comparison through steps S131 to S132 preliminarily determines that the interface is consistent, further pixel-level comparison is performed through steps S134 to S135, and when the pixel-level comparison is inconsistent, group comparison is performed through steps S136 to S139, which can further reduce the impact of tiny pixel differences on the comparison results, thereby improving the accuracy of interface consistency detection.

[0089] When it is determined in step S138 that the reference number of groups is the same as the number of groups to be detected, step S130, in some embodiments of the present disclosure, may further include: Fig. 9 Steps S140 to S141 are shown.

[0090] Step S140 : for each reference block group, determining whether the number of reference blocks of the blocks included in the reference block group is the same as the number of to-be-detected blocks of the blocks included in the to-be-detected block group associated with the reference block group.

[0091] In some embodiments of the present disclosure, when it is determined in step S140 that the number of reference blocks of blocks included in one or more reference block groups is different from the number of blocks to be detected of blocks included in the block group to be detected related to the reference block group, step S141 is performed. The block group to be detected related to the reference block group refers to the block group to be detected that matches the reference block group, and the matching process between the reference block group and the block group to be detected is similar to the matching process of the blocks.

[0092] Step S141: The inconsistency between the reference interface and the interface to be detected is taken as a comparison result.

[0093] When the overall comparison through step S131 to step S132 is preliminarily determined to be consistent with the interface, further pixel-level comparison is performed through step S134 to step S135. When the pixel-level comparison is inconsistent, group number comparison is performed through step S136 to step S138, and when the number of groups is the same, the number of blocks in the group is compared through steps S140 to S141. This can further reduce the impact of tiny pixel differences on the comparison results, thereby improving the accuracy of interface consistency detection.

[0094] When it is determined through step S140 that the number of reference blocks included in all reference block groups is the same as the number of blocks to be detected included in the relevant block group to be detected, step S130, in some embodiments of the present disclosure, may further include: Fig.10 Steps S142 to S145 are shown.

[0095] Step S142, obtaining a reference size of a block in the reference layout image and a to-be-detected size of a block in the to-be-detected layout image.

[0096] In some embodiments of the present disclosure, step S142 may perform contour detection or layout file parsing on the baseline layout diagram and the layout diagram to be detected, respectively, to obtain a baseline size and a size to be detected. The baseline size may be the original size of the block in the baseline layout diagram, and the size to be detected may be the original size of the block in the layout diagram to be detected.

[0097] Step S143, determining whether the reference size and the size to be detected are the same.

[0098] In some embodiments of the present disclosure, when it is determined in step S143 that the reference size and the size to be detected are the same, step S144 is executed; when it is determined in step S143 that the reference size and the size to be detected are different, step S145 is executed.

[0099] Step S144: The consistency between the reference interface and the interface to be detected is taken as a comparison result.

[0100] Step S145 , taking the inconsistency between the reference interface and the interface to be detected as a comparison result.

[0101] By gradually deepening and continuously advancing the layout diagram comparison through steps S131 to S145, the efficiency and success rate of interface consistency detection can be improved.

[0102] Regarding step S142, in some embodiments of the present disclosure, it may include the following: Fig.11 Steps S1421 and S1422 are shown.

[0103] Step S1421, obtaining a reference size of a block in the reference layout diagram relative to the reference layout diagram.

[0104] In some embodiments of the present disclosure, the process of obtaining the baseline size of a block in a baseline layout diagram relative to the baseline layout diagram through step S1421 may include: first obtaining the layout diagram size of the entire baseline layout diagram; secondly obtaining the block size of each block in the baseline layout diagram; and finally dividing each block size by the layout diagram size to obtain the baseline size of each block relative to the baseline layout diagram.

[0105] Step S1422, obtaining the size of the block in the layout diagram to be detected relative to the layout diagram to be detected.

[0106] In some embodiments of the present disclosure, the process of obtaining the size to be detected of the block in the layout diagram to be detected relative to the layout diagram to be detected through step S1422 is similar to the process of obtaining the reference size of the block in the reference layout diagram relative to the reference layout diagram through step S1421, and will not be repeated here.

[0107] By obtaining the reference size of the block in the reference layout diagram relative to the reference layout diagram and the size to be detected of the block in the layout diagram to be detected relative to the layout diagram to be detected through steps S1421 and S1422, the risk of deviation caused by equipment differences and unit conversion errors during comparison can be reduced, and the accuracy of comparison can be improved.

[0108] Regarding step S120, in some embodiments of the present disclosure, it may include the following steps: Fig.12 Steps S121 to S123 are shown.

[0109] Step S121 , pre-processing the reference interface and the interface to be detected respectively to obtain a reference processed interface and a processed interface to be detected.

[0110] In some embodiments of the present disclosure, the preprocessing in step S121 may include graying, denoising, contrast adjustment, etc. Specifically, preprocessing the reference interface and the interface to be detected respectively through step S121 may include: denoising the reference interface and the interface to be detected respectively to obtain a reference denoised interface and a denoised interface to be detected; contrast adjusting the reference denoised interface and the denoised interface to be detected respectively to obtain a reference high contrast interface and a high contrast interface to be detected; graying the reference high contrast interface and the high contrast interface to be detected respectively to obtain a reference grayscale interface and a grayscale interface to be detected; performing projection correction on the reference grayscale interface and the grayscale interface to be detected respectively to obtain a reference processing interface and a processing interface to be detected. Denoising can improve clarity, contrast adjustment can make boundaries more obvious, graying can simplify images and reduce processing complexity, and projection correction can improve readability and analysis accuracy.

[0111] Step S122 , performing element segmentation on the reference processing interface and the to-be-detected processing interface respectively, to obtain reference element information and to-be-detected element information.

[0112] In some embodiments of the present disclosure, step S122 may use methods such as element analysis to perform element segmentation. The specific process of performing element segmentation through step S122 may include: using a contour detection algorithm to respectively detect and extract contours in the reference processing interface and the processing interface to be detected, multiple reference contours and multiple contours to be detected; obtaining reference element information and element information to be detected respectively according to the multiple reference contours and the multiple contours to be detected. In particular, in order to exclude noise and background, obtaining reference element information and element information to be detected respectively according to multiple reference contours and multiple contours to be detected may include: screening out qualified reference contours and qualified contours to be detected according to the area, shape and other features of the contours in the multiple reference contours and the multiple contours to be detected, and obtaining reference element information and element information to be detected respectively according to the qualified reference contours and the qualified contours to be detected.

[0113] Step S123 , obtaining a reference layout diagram and a layout diagram to be detected according to the reference element information and the information of the element to be detected, respectively.

[0114] In some embodiments of the present disclosure, the process of obtaining the baseline layout diagram and the layout diagram to be detected through step S123 may include: first, respectively obtaining a baseline blank image and a blank image to be detected that are the same size as the baseline interface and the interface to be detected; secondly, drawing a rectangular frame of each baseline element on the baseline blank image according to the baseline element information to obtain the baseline layout diagram; finally, drawing a rectangular frame of each element to be detected on the blank image to be detected according to the element information to be detected to obtain the layout diagram to be detected.

[0115] The preprocessing in step S121 can improve the quality and structural information of the reference interface and the interface to be detected, lay a foundation for subsequent layout analysis, and improve the accuracy of layout analysis.

[0116] Regarding step S110, in some embodiments of the present disclosure, it may include: Fig.13 Steps S111 to S114 are shown.

[0117] Step S111, obtaining a first application and a second application.

[0118] In some embodiments of the present disclosure, when the method is used to compare different versions, the first application and the second application obtained through step S111 may be an old version application and a new version application; when the method is used to compare different platforms, the first application and the second application obtained through step S111 may be applications running on the first platform and the second platform; when the method is used to compare different terminal devices, the first application and the second application obtained through step S111 may be applications running on the first terminal device and the second terminal device. Among them, the old version application refers to the released or existing application version used as a benchmark when comparing interface consistency. The old version application is usually the version currently used by the user or the most recently released stable version; the new version application refers to the latest version of the application that is about to be released or is under development when comparing interface consistency. The new version application usually contains new functions, improved performance or fixed bugs, etc.

[0119] Step S112, respectively controlling the first application and the second application to enter different interfaces and take screenshots, to obtain a first screenshot and a second screenshot.

[0120] Step S113, obtaining a reference interface from the first screenshot.

[0121] Step S114, obtaining the interface to be detected from the second screenshot.

[0122] Automatically acquiring original images of the reference interface and the interface to be detected through steps S111 to S114 can improve the efficiency and accuracy of image acquisition, thereby achieving comprehensive interface consistency detection.

[0123] Fig.14 An exemplary flow chart of the interface consistency detection method according to the present disclosure is shown.

[0124] Fig.14 In the flowchart shown, taking the comparison between the new and old versions of the enterprise internal management system as an example, the interface consistency detection method includes: 1. Get the new version system and the old version system.

[0125] 2. Control the new version system and the old version system respectively to enter different pages and take screenshots to obtain new version screenshots and old version screenshots.

[0126] In some embodiments of the present disclosure, the new version screenshots and the old version screenshots obtained through this step may include an employee list page displaying all employee information, an employee details page displaying detailed information of a certain employee, a department management page displaying and managing information of each department, and a project management page displaying and managing the progress and allocation of a project.

[0127] Through this step, all interfaces of the new version system and the old version system can be collected, which improves the efficiency and accuracy of interface collection and ensures that comprehensive interface consistency testing can be performed on the new version system and the old version system.

[0128] 3. Get the baseline interface from the old version screenshot and get the interface to be tested from the new version screenshot.

[0129] In some embodiments of the present disclosure, the interface to be detected obtained by this step is an interface matching the reference interface in the new version screenshot, and the reference interface can be any interface in the old version screenshot. By sequentially obtaining the reference interface and the corresponding interface to be detected by this step, and performing analysis and comparison in subsequent steps, consistency detection of all interfaces in the old version system can be achieved, thereby improving the comprehensiveness of interface consistency detection.

[0130] The following uses the benchmark interface and the interface to be tested as employee list pages as examples. It is assumed that in the benchmark interface, the employee search box is located at the top of the interface, horizontally centered, and the add button is located in the upper right corner of the interface; in the interface to be tested, the employee search box is located in the upper left corner of the interface, aligned to the left, and the add button no longer exists.

[0131] 4. Perform layout analysis on the reference interface and the interface to be tested respectively to obtain a reference layout diagram and a layout diagram to be tested.

[0132] 5. Compare the reference layout diagram with the layout diagram to be tested to obtain a comparison result.

[0133] In some implementations of the present disclosure, after the comparison in this step, a comparison result showing that the employee search box and the add button are inconsistent can be obtained.

[0134] After obtaining the comparison results through the above steps, a detailed analysis can be performed based on the comparison results to determine the reasons for the inconsistent comparison of elements in the interface, such as missing or shifted.

[0135] The interface consistency detection method provided by the present invention can be used in scenarios such as version updates in software development and testing (ensuring that the interface of the new version is consistent with the interface of the old version), cross-platform testing (ensuring that the interface performance of the same application on different platforms is consistent), and multi-device testing (ensuring that the interface performance of the application on different devices is consistent). It can be used for interface consistency detection of applications such as medical care, education, finance, games, and real estate.

[0136] Based on any of the above embodiments, the present disclosure also provides an interface consistency detection device.

[0137] Fig.15 It is a schematic block diagram of the structure of an interface consistency detection device according to an embodiment of the present invention.

[0138] like Fig.15As shown, the interface consistency detection device includes: The interface acquisition module 110 is used to acquire a reference interface and an interface to be detected.

[0139] The layout analysis module 120 is used to perform layout analysis on the reference interface and the interface to be detected respectively to obtain a reference layout diagram and a layout diagram to be detected.

[0140] The layout comparison module 130 is used to compare the reference layout diagram with the layout diagram to be tested to obtain a comparison result.

[0141] Each of the above modules can be implemented by a computer program module. Fig.15 The interface consistency detection device shown can be implemented based on a computer program module architecture.

[0142] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.

[0143] The execution subject of the interface consistency detection method in the specific implementation manner of the present disclosure may be an electronic device such as a mobile phone, a tablet computer, or a server.

[0144] Therefore, based on any of the above embodiments, the present disclosure also provides an electronic device, which can execute the interface consistency detection method of any of the embodiments described above in the present disclosure, and the interface consistency detection device of any of the embodiments described above can be configured on the electronic device.

[0145] Fig.16 It is a schematic block diagram of the structure of an electronic device 1000 equipped with an interface consistency detection device according to an embodiment of the present disclosure.

[0146] The hardware structure of the electronic device 1000 can be implemented using a bus architecture. The bus architecture can include any number of interconnected buses and bridges, depending on the specific application and overall design constraints of the hardware. The bus 1100 connects various circuits including one or more processors 1200, memory 1300 and / or hardware modules together. The bus 1100 can also connect various other circuits 1400 such as peripherals, voltage regulators, power management circuits, external antennas, etc.

[0147] The bus 1100 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Component (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the figure only uses one connecting line, but does not mean that there is only one bus or one type of bus.

[0148] The present disclosure also provides a readable storage medium, in which a computer program is stored, and the computer program is used to implement the above method when executed by a processor. "Readable storage medium" can be any device that can contain, store, communicate, propagate or transmit a program for use in an instruction execution system, device or equipment or in combination with these instruction execution systems, devices or equipment. More specific examples of readable storage media include the following: an electrical connection portion (electronic device) with one or more wirings, a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), an optical fiber device, and a portable read-only memory (CDROM), etc.

[0149] The present disclosure also provides a computer program product. The method of the present disclosure can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed, the process or function of the present disclosure is executed in whole or in part.

[0150] The computer program or instructions may be stored in a readable storage medium or transmitted from one readable storage medium to another readable storage medium, for example, the computer program or instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired or wireless means. The readable storage medium may be any available medium that can be accessed or a data storage device such as a server, data center, etc. that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; it may also be an optical medium, such as a digital video disk; it may also be a semiconductor medium, such as a solid state drive. The computer readable storage medium may be a volatile or non-volatile storage medium, or may include both volatile and non-volatile types of storage media.

[0151] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0152] The present disclosure is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0153] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0154] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0155] In the description of this specification, the description with reference to the terms "one embodiment / method", "some embodiments / methods", "example", "specific example", or "some examples" etc. means that the specific features, structures, or characteristics described in conjunction with the embodiment / method or example are included in at least one embodiment / method or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment / method or example. Moreover, the specific features, structures, or characteristics described may be combined in any one or more embodiments / methods or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments / methods or examples described in this specification and features of different embodiments / methods or examples, unless they are contradictory.

[0156] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, "plurality" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0157] Those skilled in the art should understand that the above embodiments are only for the purpose of clearly illustrating the present disclosure, and are not intended to limit the scope of the present disclosure. For those skilled in the art, other changes or modifications may be made based on the above disclosure, and these changes or modifications are still within the scope of the present disclosure.

Claims

1. A method for detecting interface consistency, characterized in that: include: Obtain the reference interface and the interface to be detected; Performing layout analysis on the reference interface and the interface to be detected respectively to obtain a reference layout diagram and a layout diagram to be detected; as well as The reference layout diagram is compared with the layout diagram to be detected to obtain a comparison result.

2. The interface consistency detection method according to claim 1, characterized in that: The step of comparing the reference layout diagram with the layout diagram to be detected to obtain a comparison result includes: Using a progressive comparison method to compare the reference layout diagram with the layout diagram to be tested to obtain a comparison result; or, Using a flat-layout comparison method to compare the reference layout diagram with the layout diagram to be tested to obtain a comparison result; or, The reference layout diagram is compared with the layout diagram to be detected by using a structured comparison method to obtain a comparison result.

3. The interface consistency detection method according to claim 2, characterized in that: The step of using a progressive comparison method to compare the reference layout diagram with the layout diagram to be tested to obtain a comparison result includes: Acquire the total number of reference blocks of the reference layout diagram and the total number of blocks to be detected of the layout diagram to be detected; Determining whether the total number of the reference blocks is the same as the total number of the blocks to be detected; and When the total number of the reference blocks is different from the total number of the blocks to be detected, the inconsistency between the reference interface and the interface to be detected is taken as the comparison result.

4. The interface consistency detection method according to claim 3, characterized in that: When the total number of the reference blocks is the same as the total number of the blocks to be detected, the step of comparing the reference layout diagram with the layout diagram to be detected by a progressive comparison method to obtain a comparison result further includes: Performing pixel-level comparison between the reference layout image and the layout image to be detected to obtain a pixel difference result; and When the pixel difference result is pixel consistency, the consistency between the reference interface and the interface to be detected is taken as the comparison result.

5. The interface consistency detection method according to claim 4, characterized in that: The pixel-level comparison between the reference layout diagram and the layout diagram to be detected includes: Binarizing the reference layout image and the layout image to be detected respectively to obtain a reference black-and-white image and a black-and-white image to be detected; and A pixel-level comparison is performed between the reference black-and-white image and the black-and-white image to be detected.

6. The interface consistency detection method according to claim 4 or 5, characterized in that: When the pixel difference result is pixel inconsistency, the step of using a progressive comparison method to compare the reference layout diagram with the layout diagram to be detected to obtain a comparison result further includes: Grouping the blocks of the reference layout diagram and the blocks of the layout diagram to be detected respectively to obtain a plurality of reference block groups and a plurality of block groups to be detected; Acquire the number of reference groups of the plurality of reference block groups and the number of to-be-detected groups of the plurality of to-be-detected block groups; Determining whether the reference number of groups is the same as the number of groups to be detected; and When the reference group number and the to-be-detected group number are different, the inconsistency between the reference interface and the to-be-detected interface is taken as the comparison result.

7. The interface consistency detection method according to claim 6, characterized in that: When the number of reference groups and the number of groups to be detected are the same, the step of comparing the reference layout diagram with the layout diagram to be detected by a progressive comparison method to obtain a comparison result further includes: for each reference block group, determining whether the number of reference blocks of the blocks included in the reference block group and the number of blocks to be detected of the block group to be detected related to the reference block group are the same; when the number of reference blocks and the number of blocks to be detected are different, taking the inconsistency between the reference interface and the interface to be detected as the comparison result; Optionally, when the number of reference blocks is the same as the number of blocks to be detected, the use of a progressive comparison method to compare the reference layout diagram with the layout diagram to be detected to obtain a comparison result further includes: obtaining a reference size of a block in the reference layout diagram and a size to be detected of a block in the layout diagram to be detected; determining whether the reference size is the same as the size to be detected; when the reference size is the same as the size to be detected, taking the consistency of the reference interface with the interface to be detected as the comparison result; when the reference size is different from the size to be detected, taking the inconsistency of the reference interface with the interface to be detected as the comparison result; Optionally, the obtaining of the reference size of the block in the reference layout diagram and the to-be-detected size of the block in the to-be-detected layout diagram comprises: obtaining the reference size of the block in the reference layout diagram relative to the reference layout diagram; obtaining the to-be-detected size of the block in the to-be-detected layout diagram relative to the to-be-detected layout diagram; Optionally, the performing layout analysis on the reference interface and the interface to be detected respectively includes: preprocessing the reference interface and the interface to be detected respectively to obtain a reference processing interface and a processing interface to be detected; performing element segmentation on the reference processing interface and the processing interface to be detected respectively to obtain reference element information and element information to be detected; and acquiring the reference layout diagram and the layout diagram to be detected respectively according to the reference element information and the element information to be detected; Optionally, before obtaining the reference interface and the interface to be detected, the method further includes: obtaining a first application and a second application; respectively controlling the first application and the second application to enter different interfaces and take screenshots to obtain a first screenshot and a second screenshot; obtaining the reference interface from the first screenshot; and obtaining the interface to be detected from the second screenshot.

8. An electronic device, characterized in that: include: A memory storing execution instructions; as well as A processor, wherein the processor executes the execution instructions stored in the memory, so that the processor executes the interface consistency detection method according to any one of claims 1 to 7.

9. A readable storage medium, characterized in that: The readable storage medium stores execution instructions, which are used to implement the interface consistency detection method according to any one of claims 1 to 7 when executed by the processor.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the interface consistency detection method according to any one of claims 1 to 7 is implemented.