CN115357490A - Interface scaling defect detection method for mobile application and electronic device - Google Patents

Interface scaling defect detection method for mobile application and electronic device Download PDF

Info

Publication number
CN115357490A
CN115357490A CN202210991441.7A CN202210991441A CN115357490A CN 115357490 A CN115357490 A CN 115357490A CN 202210991441 A CN202210991441 A CN 202210991441A CN 115357490 A CN115357490 A CN 115357490A
Authority
CN
China
Prior art keywords
component
components
scaling
visible
root
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.)
Pending
Application number
CN202210991441.7A
Other languages
Chinese (zh)
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.)
Institute of Software of CAS
Original Assignee
Institute of Software of CAS
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 Institute of Software of CAS filed Critical Institute of Software of CAS
Priority to CN202210991441.7A priority Critical patent/CN115357490A/en
Publication of CN115357490A publication Critical patent/CN115357490A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/28Quantising the image, e.g. histogram thresholding for discrimination between background and foreground patterns
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • G06V10/765Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects using rules for classification or partitioning the feature space
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/16Image preprocessing
    • G06V30/162Quantising the image signal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/18Extraction of features or characteristics of the image
    • G06V30/1801Detecting partial patterns, e.g. edges or contours, or configurations, e.g. loops, corners, strokes or intersections
    • G06V30/18076Detecting partial patterns, e.g. edges or contours, or configurations, e.g. loops, corners, strokes or intersections by analysing connectivity, e.g. edge linking, connected component analysis or slices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/19Recognition using electronic means
    • G06V30/191Design or setup of recognition systems or techniques; Extraction of features in feature space; Clustering techniques; Blind source separation
    • G06V30/19173Classification techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Human Computer Interaction (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses an interface scaling defect detection method for mobile application and an electronic device. The method comprises the following steps: 1) Zooming a user interface of a target mobile application at different zooming ratios to obtain an interface under each zooming ratio; establishing corresponding relations of the same component in interfaces with different scaling ratios by taking the component in the interface as granularity; 2) Based on the corresponding relation, performing inter-component analysis, namely comparing the position relation of the same component under different scaling interfaces, and detecting scaling defects caused by the change of the position relation among the components; 3) And performing intra-component analysis based on the corresponding relation, comparing and analyzing the content displayed by the component, and detecting the scaling defect caused by the inconsistency of the component content. The invention can more comprehensively and accurately find problems, quickly and automatically finish the zooming barrier-free test of the application program and ensure the development quality of mobile application.

Description

Interface scaling defect detection method for mobile application and electronic device
Technical Field
The invention relates to the technical field of computers, in particular to an automatic detection method for interface scaling defects of mobile applications and an electronic device.
Background
Nowadays, the popularity of mobile intelligent terminal devices is very wide, an android operating system has become one of the most common systems, and at least 260 ten thousand mobile application programs are published in the application market of android to date, and cover various functions.
Users with visual impairments, such as elderly people, tend to increase the font size or display size of the screen when using mobile applications to manipulate the application more easily.
However, the graphical user interfaces of many applications are designed only for default set font or display sizes, since most developers are sighted, and most of them rarely or never consider visually impaired users. This results in inconsistencies in the user interface when transitioning from default settings to larger font or display sizes, which may result in scaling defects for components of the user interface, such as component overlap, component missing, and component occlusion problems, which are also the most common of several. The user interface comprises components, the components are basic units forming the user interface, and the components are in a wide variety, such as text components, image components, drop-down box components, custom components and the like. The wide variety of components also makes the performance of scaling problems diverse and also increases the difficulty of detecting scaling problems.
In the prior art, there are several methods for detecting the scaling problem as follows:
and (5) manual detection. The basic idea is to rely on the developer to manually explore the application, record the screen display at the default scale and the corresponding screen display at the larger scale, check where the display is inconsistent by comparing the display results of the components, and record the components with display defects in these components that represent the inconsistency. However, inspection by manpower is time-consuming and laborious.
And deep learning detection based on the screenshot. The basic idea is to detect the position where zooming is problematic directly on the interface with a large zooming ratio through screenshot, and the core detection means includes but is not limited to an image feature detection method such as deep learning, but detects zooming defects only on a single screenshot without considering the dynamic property of the layout, and the problems of misjudgment and missed detection may exist. At present, an automatic and accurate interface scaling defect detection technology for mobile applications is urgently needed.
Disclosure of Invention
In view of this, the present invention provides an automatic detection method for an interface scaling defect of a mobile application, which solves the problem that the current detection scheme cannot solve. The invention provides a detection method based on comparison, namely, the scaling problem is detected by comparing the position relation and the content of layout files and components in the layout under different scaling ratios, which comprises the following steps:
s1, zooming a user interface of a target mobile application at different zooming ratios to obtain an interface under each zooming ratio; establishing corresponding relation of the same component in interfaces with different scaling ratios by taking the component as granularity in the interfaces with different scaling ratios;
and S2, performing inter-component analysis based on the corresponding relation of the components, and detecting the scaling defects caused by the change of the position relation among the components by comparing the position relation among the components under different scaling ratios.
And S3, performing intra-component analysis based on the corresponding relation of the components, comparing and analyzing the content displayed by the components, and detecting the scaling defect caused by the inconsistency of the component content.
In one embodiment, step S1 specifically includes:
s1.1, acquiring all layout files in the installation package of the mobile application program, and injecting unique component identifiers into components contained in the layout files to distinguish different types of components.
And S1.2, packaging the application program injected with the unique identifier of the component into an installation package, and automatically installing the installation package on the mobile phone.
And S1.3, installing and operating the application program on the mobile phone with different scaling ratios, enabling the application program to reach the same interface p, obtaining a layout file of the interface p and image information of components in the interface p, and identifying component pairs corresponding to the same content by utilizing the component identifiers in the layout file and the contained character strings to generate component IDs of the components.
In one embodiment, step S2 specifically includes:
and S2.1, analyzing among the assemblies according to the assembly tree of the interface, namely analyzing whether the position relation of a certain assembly relative to other assemblies changes or not, so that the display result of the assembly is changed, and the scaling problem is generated. Specifically, whether each non-root component in the component tree is visible in the component directly containing the non-root component is analyzed in the sequence of first root traversal, and the visibility including the visible scale is analyzed through the image and the visible area of the non-root component and the image and the visible area of the component containing the component. And if the non-root component has the brother component, analyzing whether the brother component shields the component or not according to the drawing sequence of the non-root component and the brother component and the visible regions and images of the components, and recording the component ID of the brother component shielding the component to form a shielding ID set. The scaling problem (visibility problem, overlap problem) is analyzed accordingly.
And S2.2, after the interfaces with two different scaling ratios are subjected to inter-component analysis, comparing and analyzing whether the two parts of contents of the components change under different scaling ratios, namely the change of visibility and shielding relation, according to the visibility of the components in the component pairs and the IDs of brother components shielding the components, and judging that the scaling problem exists if the visibility and shielding relation change.
In one embodiment, step S3 specifically includes:
and S3.1, classifying the component pairs formed by the leaf nodes in the component trees under the two scaling ratios into character component pairs and non-character component pairs.
And S3.2, extracting the character part image of the character component pair from the image of the character component under different zooming ratios by using a binarization method, carrying out connected domain statistics on the character part image, comparing the connected domains, counting the area change regions, summing the area change regions to obtain the character area, and judging that the zooming problem exists if the ratio change of the two character areas under different zooming ratios is inconsistent with the zooming ratio.
And S3.3, extracting the foreground of the component by using a binarization mode for the non-character component pair, counting the number of connected domains, judging that the scaling problem does not exist if the components under two scaling ratios have the same connected domain, otherwise calling an SSIM algorithm to identify the similarity of the image, and judging that the scaling problem exists if the similarity is lower than 0.9.
The invention also encompasses a storage medium having a computer program stored thereon, wherein the computer program is configured to carry out the method described above when executed.
Also the invention comprises an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer to perform the method as described above.
One or more technical solutions in the embodiments of the present application have at least one or more of the following technical effects:
the invention aims to detect the scaling problem, firstly, component pairs are searched for applied components, and the position relation and the visibility among the components and the change of the internal content of the components are respectively detected according to the analysis among the components and the analysis in the components which are completed by the component pairs, so as to detect whether the scaling problem exists in the components. The invention finally forms a complete component scaling detection scheme.
The method and the detection scheme of the scaling problem solve the problems of high cost and low efficiency of manual detection, and can find the problem more comprehensively and accurately by means of comparison.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a flowchart of an interface scaling defect automatic detection technology for a mobile application according to an embodiment of the present invention.
Detailed Description
In order to achieve the technical effects, the invention mainly adopts the following concept:
the invention aims to provide a set of detection scheme for detecting the problems of interface defects of a mobile application program caused by adjusting the zoom setting of a mobile device, including component overlapping, component missing and component shading. The method specifically comprises three steps, namely, unique identifier injection is carried out on components in a layout file, so that the corresponding relation of the components is found in component trees under different scaling ratios, namely, a component pair, in order to analyze the scaling problem of the component pair, the visibility of the components under the corresponding scaling ratios, other components which shield the components and the content of the components need to be obtained in the subsequent steps, and whether the scaling problem exists in the components under a certain scaling ratio is judged by comparing the inconsistency of the information; specifically, firstly, the scaling problem between components is analyzed by using the position relationship between the component pair and the components in the component tree and the attributes (such as drawing sequence and the like) of the component image and the components, the visibility of the components is specifically obtained, identifiers of other components which shield the components are compared according to the component pair to determine whether the information has difference, and if the information has difference, the scaling problem (the visibility problem and the shielding problem) is reported; and then analyzing the scaling problem in the component by utilizing the component pair and the content of the component, specifically acquiring the content of the component, analyzing whether the content has a difference according to the attribute of the component, and reporting the scaling problem (the problem of content missing) if the content has the difference. Based on the three steps, a complete and automatic scaling defect detection scheme is finally formed.
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment provides a method for detecting an interface defect problem of a mobile application program caused by adjusting a zoom setting of a mobile device, please refer to fig. 1, and the method includes:
and S1, establishing a corresponding relation between components by taking the components as granularity in interfaces under different scaling ratios.
The method aims to accurately and finely detect the scaling problem, so the method takes the component as the minimum detection granularity and detects the scaling problem by comparing the display conditions of the component under different scaling ratios. However, it is often difficult to accurately and quickly find components corresponding to the same content in interfaces with different scales because it is not guaranteed that the components contain unique ID identifiers, and it is also difficult to establish the correspondence between the components. Meanwhile, the component tree may also contain list components capable of scrolling, list items in the list components may have repeatability in structure, and the list items may have the same ID identification, and the list items are difficult to distinguish simply by using the ID identification, which makes it difficult to determine the list items containing the same content at different scales and establish component pair relationships for the list items. In order to solve the problem, in step S1, the method establishes a correspondence between component pairs by injecting a component unique identifier and using a heuristic method in combination with a text inside a component. Specifically, the method comprises the following substeps:
s1.1, acquiring all layout files in the mobile application program, and injecting unique component identifiers into components contained in the layout files to distinguish different types of components. One interface may use multiple layout files, and one layout file may be used multiple times by one or more interfaces.
The layout File is a File that controls the display result of the mobile application program interface, and each component widget exists in the layout File in the form of a tree structure (i.e., a component tree widget tree). The component widget among the component tree widget trees may contain K (K)>0) Component { widget j ,widget j+1 ,…,widget j+K Or zero components. In the component tree, one component can only be included by another component, so that a strict tree structure is formed. In the component tree, the display of a component is controlled by the component that directly contains the component. In the component tree, in most cases only leaf components (components that do not contain any components) carry content, e.g. text, images.
Due to the component widget in the layout file i May lack a unique identifier and is difficult to identifyTo correctly distinguish between different types of components, this step assigns the attribute auxiliary ID i I.e. unique string identifiers are injected into all widgets i In each widget i All have auxiliary ID i Therefore, after the attributes are injected, the widget is relied upon i Auxiliary ID of i The method can distinguish the components according to the information.
And S1.2, packaging the application program injected with the unique identifier of the component into an installation package, and automatically installing the installation package on the equipment to be tested.
The specific implementation of the installation package packaging in the step can be finished from two angles, namely before the application program is packaged into the installation package, directly injecting the attributes of the components of the layout file from the source code, and compiling the source code into the installation package after injection; the other one is to perform decompiling on the packed installation package, perform attribute injection from the decompiled layout file, and pack the source code and various resources into the installation package after injection.
After the installation package is packaged, the installation package is subjected to necessary processing, such as operations of signature, byte alignment and the like, and then is installed on the device to be tested.
And S1.3, installing and operating the application program on the mobile phone with different scaling ratios, enabling the application program to reach the same interface, obtaining a layout file of the interface and image information of the components, generating a component ID of the corresponding component by using the component identifier of the component in the layout file and the character string contained in the component, and identifying the component pair corresponding to the same content.
After a corresponding program is installed on a device to be tested, the program is adjusted to a certain interface p to be tested and the scaling size s by means of operating the program by means of a test script and the like, and a component tree PageWidgetTree of the interface p is obtained p,s And all components therein
Figure BDA0003804117580000051
Image of (2)
Figure BDA0003804117580000052
Components in a component tree
Figure BDA0003804117580000053
Comprising a series of attributes
Figure BDA0003804117580000054
Such as height
Figure BDA0003804117580000055
Width of
Figure BDA0003804117580000056
Rendering order
Figure BDA0003804117580000057
Text
Figure BDA0003804117580000058
Rollability
Figure BDA0003804117580000059
Scaling
Figure BDA00038041175800000510
Whether to use an ellipsis to replace omitted characters after the characters overflow
Figure BDA00038041175800000511
Etc. in addition, the component itself contains an image in RGBA format (the common PNG format image is RGBA format, containing four channels)
Figure BDA00038041175800000512
I.e. a width of
Figure BDA00038041175800000513
Height of
Figure BDA00038041175800000514
A depth 4 multi-channel image, the last channel of which is a transparency channel image
Figure BDA00038041175800000515
The first three channels are red, green and blue channel images
Figure BDA00038041175800000516
By using
Figure BDA00038041175800000517
Image, can graying the image to obtain corresponding grayscale image
Figure BDA00038041175800000518
Collecting the component tree PageWidgetTree p,s For each component therein
Figure BDA0003804117580000061
Generating component ID attribute values
Figure BDA0003804117580000062
And find component pairs using the ID
Figure BDA0003804117580000063
Where s represents a normal scaling and s' represents a larger scaling, the component pair is generated as follows:
1. traversing all components in a component tree
Figure BDA0003804117580000064
Record the value of its attribute auxiliaryID
Figure BDA0003804117580000065
If the component is
Figure BDA0003804117580000066
Is unique, i.e. not identical to the auxiliaryID value of any other component, i.e. as the ID attribute value of the component
Figure BDA0003804117580000067
Then directly connect the components
Figure BDA0003804117580000068
Is
Figure BDA0003804117580000069
Value as a component
Figure BDA00038041175800000610
The component ID value of (1).
2. For other cases, the component is determined
Figure BDA00038041175800000611
Whether or not to have a component with the brother
Figure BDA00038041175800000612
(having the same parent component) has the same value of auxiliary ID, and if so, traverses this component in some determined order of traversal of the tree
Figure BDA00038041175800000613
All descendant components of
Figure BDA00038041175800000614
The traversal order may be one of a first root traversal order, a middle root traversal order, and a last root traversal order, and the traversal order must remain consistent in generating the component pairs. In the process of traversing, generating character strings according to the traversed components
Figure BDA00038041175800000615
If a certain descendant component is encountered
Figure BDA00038041175800000616
And this descendant component
Figure BDA00038041175800000617
auxiliaryID value of (a) and its sibling component
Figure BDA00038041175800000618
The auxiliary ID value of the child component is the same, then the descendant component
Figure BDA00038041175800000619
And
Figure BDA00038041175800000620
all descendant components of do not participate
Figure BDA00038041175800000621
Generating; for other traversed components
Figure BDA00038041175800000622
Connecting the value of the text attribute and the value of auxiliaryID into a character string according to the traversal order
Figure BDA00038041175800000623
After traversing all
Figure BDA00038041175800000624
Then, the component is assembled
Figure BDA00038041175800000625
Is
Figure BDA00038041175800000626
Value of (A) and
Figure BDA00038041175800000627
are connected together to form an assembly
Figure BDA00038041175800000628
ID value of (2). Since a certain layout file may be used by a page for multiple times, the auxiariaryID injected in the layout file may repeatedly appear in the page component tree, so that a new ID needs to be generated for distinguishing components in the page component tree; sibling components may originate from the same layout file and therefore may contain the same auxiliary id value, as they may be reused.
3. And establishing a component pair relation according to the generated ID value:
a) For injection of auxi by step 1Components of liaryID
Figure BDA00038041175800000629
Directly finding the component containing the same ID in another component tree with different scaling s
Figure BDA00038041175800000630
If finding the corresponding component, establishing the component pair relation for the pair of components
Figure BDA00038041175800000631
b) For components injected with auxiliary ID by step 2
Figure BDA00038041175800000632
Directly finding the component containing the same ID in another component tree with different scaling s
Figure BDA00038041175800000633
If finding out the corresponding component, directly establishing the component-to-component relation
Figure BDA00038041175800000634
And is a descendant component of the two components
Figure BDA00038041175800000635
And
Figure BDA00038041175800000636
and establishing a corresponding relation. Specifically, first, the component is recorded as follows
Figure BDA00038041175800000637
ID value of
Figure BDA00038041175800000638
Traverse the descendant component of this component
Figure BDA00038041175800000639
In the process of traversing, if encounteringCertain descendant component
Figure BDA0003804117580000071
And this descendant component
Figure BDA0003804117580000072
Auxiliary ID value of and its sibling component
Figure BDA0003804117580000073
The auxiliary ID value of is the same, then this component is temporarily not used
Figure BDA0003804117580000074
And assembly
Figure BDA0003804117580000075
The method of establishing a relationship (according to step b) for the descendant component of (c), the component being selected from the group consisting of
Figure BDA0003804117580000076
Component pair relationships are established with its descendant components and the components in the component tree under s' because the components
Figure BDA0003804117580000077
auxiliaryID of (a) is also injected by step 2); for other descendant components
Figure BDA0003804117580000078
Then will be
Figure BDA0003804117580000079
And this descendant component
Figure BDA00038041175800000710
Is connected together as this descendant component
Figure BDA00038041175800000711
If it is possible to find a component having the same ID in another component tree
Figure BDA00038041175800000712
The pair of components are established into corresponding relation, namely, the component pair is generated
Figure BDA00038041175800000713
And S2, performing inter-component analysis based on the corresponding relation of the components, and detecting scaling defects caused by the change of the position relation and the change of the visibility between the components by comparing the position relation between the components under different scaling ratios.
In the component tree, the components are organized together according to the tree structure, the components are rendered on the interface according to the tree structure, and the problem of shielding exists among the components according to the difference of the rendering sequence drawingOrder of the components. Because of the structural relationship of the tree, the parent component controls the visibility of the direct sub-components, and if the visibility changes, the sub-components may be partially invisible or completely invisible. Therefore, based on the relationship between the tree structure and the parent-child components, the step carries out analysis among the components, and the scaling defects are analyzed according to the position relationship among the components and the change of visibility. Specifically, this step includes several substeps as follows.
And S2.1, analyzing among the assemblies according to the assembly tree of the interface, namely analyzing whether the position relation of a certain assembly relative to other assemblies changes or not, so that the display result of the assembly changes and the scaling problem is generated. Specifically, whether each non-root component in the component tree is visible in the component directly containing the non-root component is analyzed in the sequence of first root traversal, and the visibility including the visible scale is analyzed through the image and the visible area of the non-root component and the image and the visible area of the component containing the component. And if the non-root component has the brother component, analyzing whether the brother component shields the component or not according to the drawing sequence of the non-root component and the brother component and the visible regions and images of the components, and recording the component ID of the brother component shielding the component to form a shielding ID set. The scaling problem (visibility problem, overlap problem) is analyzed accordingly.
For a non-root component
Figure BDA00038041175800000714
In other words, its parent component
Figure BDA00038041175800000715
Controlling its visibility (visibility range) and its rendering order relative to its sibling components, this step analyzes each non-root component in the component tree in a root-first traversal manner
Figure BDA00038041175800000716
And its sibling component set
Figure BDA00038041175800000717
A condition in which it is occluded, i.e. an overlap condition, wherein
Figure BDA00038041175800000718
Corresponding to the component
Figure BDA00038041175800000719
We utilize the visibility matrix visible p,s,i To describe the assembly
Figure BDA00038041175800000720
Visibility of, to, the component
Figure BDA00038041175800000721
In other words, the visibility matrix is initialized to a width of
Figure BDA00038041175800000722
Has a height of
Figure BDA00038041175800000723
The value in this matrix is either 0 or 1,0 indicating invisible and 1 indicating visible. Thereafter, the image of the component is utilized
Figure BDA0003804117580000081
Alpha of transparency channel p,s,i To initialize the visibility matrix, i.e.:
Figure BDA0003804117580000082
transparency channel alpha is a width of
Figure BDA0003804117580000083
Has a height of
Figure BDA0003804117580000084
Alpha of the two-dimensional matrix p,s,i The size of the matrix is consistent with the size of the visible matrix, and for the element of the m-th row and the n-th column in the visible matrix, if the two-dimensional matrix is alpha p,s,i The value of the element in the mth row and the nth column in the matrix is greater than 0, the value of the element in the mth row and the nth column in the matrix is 1, otherwise, the value is 0.
This step traverses the component tree pagewidget tree in a root-first traversal manner p,s Specifically, after a node is traversed, if there is a subcomponent in the node, the subcomponent is traversed according to the drawing order from large to small. Traversing each non-root component, two parts of the content need to be analyzed, as follows:
a first part: for each non-root component
Figure BDA0003804117580000085
We want to determine if it is directly containing its parent component
Figure BDA0003804117580000086
Invisible in, whether or not there is a parent component
Figure BDA0003804117580000087
(ii) case of occlusion, calculating attribute
Figure BDA0003804117580000088
The corresponding judgment method is as follows:
1. first, determine the non-root component
Figure BDA0003804117580000089
Whether an area in the screen is in the parent component
Figure BDA00038041175800000810
Outside the area in the screen, if the area is outside and the parent component is not scrollable, then the non-root component is judged not to be visible, and the component is set
Figure BDA00038041175800000811
Is/are as follows
Figure BDA00038041175800000812
The attribute is false;
2. obtaining a cropped image of the non-root component inside the region of the parent component if the region of the non-root component is within the region of the parent component
Figure BDA00038041175800000813
And corresponding clipping coordinate region
Figure BDA00038041175800000814
3. Obtaining an image of a parent component, and utilizing a template matching algorithm in the image field to cut the image of the non-root component
Figure BDA00038041175800000815
Searching in the image of the parent component as a template, if the final searched area
Figure BDA00038041175800000816
And a clip coordinate region of the sub-assembly
Figure BDA00038041175800000817
If the intersection ratio of (1) is equal to 1, the non-root component is visible in the parent component, and the component is recorded
Figure BDA00038041175800000818
Is
Figure BDA00038041175800000819
Attribute false, otherwise invisible, and record component
Figure BDA00038041175800000820
Is
Figure BDA00038041175800000821
The attribute is true.
4. Obtaining a parent component
Figure BDA00038041175800000822
Visible matrix of p,s,j Obtaining a non-root component
Figure BDA00038041175800000823
Visible matrix visible p,s,i If the component
Figure BDA00038041175800000824
Is
Figure BDA00038041175800000825
With the attribute of false, the visible matrix visible p,s,i All values in (a) are assigned a value of 0. Otherwise, the step 5 is entered.
5. According to non-root components
Figure BDA00038041175800000826
Visible matrix visible p,s,i To obtain a corresponding visible area
Figure BDA00038041175800000827
Figure BDA00038041175800000828
According to the cutting coordinate area
Figure BDA00038041175800000829
Clipping the visible matrix of the non-root component and the visible matrix of the parent component (clipping the visible matrix, namely acquiring the visible matrix in clippingMatrix blocks inside the coordinate region) to get a crotedVisible p,s,i And crop Visible p,s,j And obtaining cropeddandibile p,s,i Namely:
Figure BDA0003804117580000091
in short, to the crop Visable p,s,i And cropedD ANDVisible p,s,j Performing a bitwise sum (AND) operation to obtain crop ANDVisible p,s,i . Thereafter, according to the clipping coordinate region
Figure BDA0003804117580000092
Will cropeddanducibile p,s,i Replace back the visable p,s,i In the clipping region of (2), obtain the updated visible p,s,i And calculating a new visible area
Figure BDA0003804117580000093
If it is
Figure BDA0003804117580000094
Is equal to
Figure BDA0003804117580000095
Recording assembly
Figure BDA0003804117580000096
Property of whether or not it is occluded by a parent component
Figure BDA0003804117580000097
False, otherwise true.
A second part: at the same time, for all
Figure BDA0003804117580000098
Non-root component with attribute of true
Figure BDA0003804117580000099
If its sibling component set
Figure BDA00038041175800000910
Not an empty set, taking advantage of its drawing order among parent components
Figure BDA00038041175800000911
Analyzing occlusion relation of non-root component and brother component set thereof, and recording occlusion non-root component
Figure BDA00038041175800000912
Of sibling components
Figure BDA00038041175800000913
The method comprises the following specific steps:
1. because components with larger drawingOrder may be drawn onto components with smaller drawingOrder, the non-root components and their sibling components are sorted in descending order of drawing order among the parent components, and their sibling components are filtered in order of drawing order from larger to smaller
Figure BDA00038041175800000914
Namely the assembly
Figure BDA00038041175800000915
If brother component
Figure BDA00038041175800000916
Namely the assembly
Figure BDA00038041175800000917
Is/are as follows
Figure BDA00038041175800000918
Is greater than
Figure BDA00038041175800000919
And is provided with
Figure BDA00038041175800000920
To true, this component is applied
Figure BDA00038041175800000921
Adding to an ordered set
Figure BDA00038041175800000922
Therein, wherein
Figure BDA00038041175800000923
Corresponding sibling component
Figure BDA00038041175800000924
Namely the assembly
Figure BDA00038041175800000925
2. Traversing the ordered set Peer according to the order from big to small of the drawing order p,s,i . According to the assembly
Figure BDA00038041175800000926
Position coordinates and currently traversed components
Figure BDA00038041175800000927
The position coordinates of the two components are calculated, and if the two components intersect in the screen, the components are updated
Figure BDA00038041175800000928
The visibility matrix of (a). Namely, calculating the intersection position area overlapping region of the two components in the screen p,s,i,k The width of the intersection region is pverlaparegionwidth p,s,i,k Height of overlap pRegion height p,s,i,k The coordinate of the upper left corner on the user interface is (overlap pRegionX) p,s,i,k ,overlapRegionY p,s,i,k ) According to the intersection area and its position and components on the screen
Figure BDA00038041175800000929
Visible matrix of p,s,i Visible matrix visible p,s,i Cut out, we get the assembly
Figure BDA00038041175800000930
The clipping visible matrix overlap visible p,s,i And an assembly
Figure BDA00038041175800000931
The clipping visible matrix overlap visible p,s,k . At this time, the visible matrix overlapVisible is calculated p,s,i Visible area of
Figure BDA00038041175800000932
According to the two clipping visible matrixes, an intersecting shielding matrix overlapBlockVisible is obtained through calculation p,s,i,k
Figure BDA0003804117580000101
Namely the quilt component
Figure BDA0003804117580000102
The blocked parts of the visible area are not visible, and the visibility of other parts which are not blocked is not influenced.
Overlap region according to intersection region p,s,i,k To overlay the logo p,s,i,k Matrix Replacing to overlapVisible p,s,i In the corresponding region, thereby updating the overlapVisible p,s,i . At the moment, an intersecting occlusion matrix overlapBlockedVisile is calculated p,s,i,k Visible area of
Figure BDA0003804117580000103
If it is
Figure BDA0003804117580000104
Explain the component
Figure BDA0003804117580000105
Sheltered from assembly
Figure BDA0003804117580000106
And assembly
Figure BDA0003804117580000107
ID attribute value of (2)
Figure BDA0003804117580000108
Joining to overlapping sets of sibling components
Figure BDA0003804117580000109
In (1). Post-analysis component
Figure BDA00038041175800001010
Whether to shield assembly
Figure BDA00038041175800001011
Until Peer is to be ordered set p,s,i And (5) finishing all analysis.
And S2.2, after the interfaces with two different scaling ratios are subjected to inter-component analysis, comparing and analyzing whether the two parts of contents of the components change under different scaling ratios, namely the change of visibility and shielding relation, according to the visibility of the components in the component pairs and the IDs of brother components shielding the components, and judging that the scaling problem exists if the visibility and shielding relation change.
After performing inter-component analysis on the interface p of the two scales s and s', a PageWidgetTree is formed in a component tree p,s Each of the non-root components
Figure BDA00038041175800001012
Both have two attribute values
Figure BDA00038041175800001013
Figure BDA00038041175800001014
And collections
Figure BDA00038041175800001015
PageWidgetTree in component tree p,s′ Each of the non-root components
Figure BDA00038041175800001016
Both have two attribute values
Figure BDA00038041175800001017
And set
Figure BDA00038041175800001018
According to component pair
Figure BDA00038041175800001019
If it is
Figure BDA00038041175800001020
Or
Figure BDA00038041175800001021
Figure BDA00038041175800001022
Or
Figure BDA00038041175800001023
Then a scaling problem is determined to exist.
And S3, performing intra-component analysis based on the corresponding relation of the components, comparing and analyzing the content displayed by the components, and detecting the scaling defect caused by the inconsistency of the component content.
Since the leaf components are carried in the component tree, this step will analyze whether the contents of the leaf components have scaling defects, such as missing contents, at different scaling ratios. The components can be roughly divided into text components and other components, and since the text in the text components is wrapped due to the adjustment of the scaling, the recognition accuracy is reduced and the operation pressure is increased according to the common OCR method, so that the following steps are designed to complete the analysis in the components. Specifically, the following substeps are included.
And S3.1, classifying the component pairs formed by the leaf nodes in the component trees under the two scaling ratios into character component pairs and non-character component pairs.
For a component widget, the component widget is divided into a text component or a non-text component according to whether the component widget contains a text attribute, if the component widget contains the text attribute, the component is the text component, otherwise, the component is the non-text component.
And S3.2, extracting the character component pair from the images of the components under different scaling ratios by using a binarization method to obtain images of character parts of the components, carrying out statistics of connected domains for the images of the character parts, comparing the connected domains, counting regions with changed visible areas, summing the regions with changed visible areas to obtain the character visible areas, and judging that scaling problems exist if the ratio change of the character visible areas under two different scaling ratios is inconsistent with the scaling ratios. This step has several substeps as follows:
1. for text components
Figure BDA0003804117580000111
According to its image p,s,i Obtaining rgb p,s,i Image, alpha p,s,i Image and gray p,s,i And (4) an image.
2. Obtaining a binary image binary p,s,i And binary ^p,s,i :
1) If gray p,s,i The image is an all 0 image, then alpha will be p,s,i The image is binarized by utilizing an Otsu algorithm to obtain a binarization threshold value
Figure BDA0003804117580000112
And obtaining binary image binary according to threshold value p,s,i And binary ^p,s,i Namely:
Figure BDA0003804117580000113
Figure BDA0003804117580000114
2) If gray p,s,i The image is not all 0, and the gray image is processed as follows to obtain the gary ^p,s,i Image:
Figure BDA0003804117580000115
then, in gary ^p,s,i In the image, the calculation is carried out in the non-1 area by utilizing the Dajin algorithm
Figure BDA00038041175800001112
And using the threshold value to complete binarization on the gray image by the method in the step 2 to obtain binary p,s,i And binary ^p,s,i And (4) an image.
3. Obtaining binary p,s,i And binary ^p,s,i After the image, analyzing the binary by using a connected component analysis method p ,s,i And binary ^p,s,i The 8-connected domain with the value of 1 in the image obtains the area of each connected domain, namely the number of pixels with the value of 1. Obtaining a set of corresponding connected domains
Figure BDA0003804117580000116
And
Figure BDA0003804117580000117
Figure BDA0003804117580000118
wherein,
Figure BDA0003804117580000119
is binary p,s,i The area of the t-th connected component in the image,
Figure BDA00038041175800001110
is binary ^p,s,i Area of the e-th connected component in the image.
4. After performing intra-component analysis on the interface p of the two scales S and S', a certain character component pair under the two scales is obtained by the method of step S1.3
Figure BDA00038041175800001111
Binary image of (1), binary p,s,i And binary p,s′,j And is combined withObtaining the corresponding connected domain set conn p,s,i And conn p,s′,j . According to the obtained areas of the connected domains, the connected domains with the same area in the two components are screened out, and the areas of the remaining connected domains are summed respectively to obtain connSum p,s,i And connSum p,s′,j If, if
Figure BDA0003804117580000121
Figure BDA0003804117580000122
The text scaling inside the text component is legal, otherwise, if so
Figure BDA0003804117580000123
True, then legal, otherwise, bind is used ^p,s,i And binary ^p,s′,j And calculating to obtain connSum ^p,s,i And connSum ^p,s′,j If, if
Figure BDA0003804117580000124
The text scaling inside the text component is legal, otherwise a scaling problem is reported.
And S3.3, extracting the foreground of the component by using a binarization mode for the non-character component pair, counting the number of connected domains, judging that the scaling problem does not exist if the components under two scaling ratios have the same connected domain, otherwise calling an SSIM algorithm, and judging that the scaling problem exists if the similarity is lower than 0.9.
1. For non-text components
Figure BDA0003804117580000125
According to its image p,s,i Obtaining rgb p,s,i Image, alpha p,s,i Image and gray p,s,i And (4) an image.
2. Will gray p,s,i The image is calculated by the Dajin algorithm
Figure BDA0003804117580000126
And carrying out binarization to obtain a binarization graphImage bank p,s,i Namely:
Figure BDA0003804117580000127
3. in obtaining binary p,s,i After the image, the bind is analyzed by using the 8-connected domain analysis method p,s,i Obtaining the area of each connected domain, namely the number of pixels with the value of 1, and obtaining the number count of the connected domains p,s,i
4. Obtaining non-text component pairs at two scales by the method of step S1.3
Figure BDA0003804117580000128
Binary image of (1), binary p,s,i And binary p,s′,j And obtaining the corresponding connected domain number count p,s,i And count p,s,j . If count p,s,i =count p,s,j If yes, the content scaling inside the non-text component is legal, otherwise, step 5 is performed.
5. Will gray p,s,i And gray p,s′,j Cutting to obtain croppedGray p,s,i And croppedGray p,s′,j To cut gray p,s,i For example, croppedGray p,s,i The requirements are as follows:
Figure BDA0003804117580000129
croppedGray p,s,i has a width and a height of W p,s,i And H p,s,i
Figure BDA00038041175800001210
Figure BDA00038041175800001211
Figure BDA0003804117580000131
Figure BDA0003804117580000132
Figure BDA0003804117580000133
croppedGray p,s′,j Also following the same manner, by gray p,s′,j And (5) cutting.
6. Calculating croppedGray by using SSIM algorithm p,s,i And croppedGray p,s′,j If the similarity value is greater than 0.9, the content scaling is legal, otherwise a scaling problem is reported.
Additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made in the embodiments of the present invention without departing from the spirit or scope of the embodiments of the invention. Thus, if such modifications and variations of the embodiments of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to encompass these modifications and variations.

Claims (10)

1. An interface zooming defect detection method for mobile application comprises the following steps:
1) Zooming a user interface of a target mobile application at different zooming ratios to obtain an interface under each zooming ratio; establishing the corresponding relation of the same component in interfaces with different scaling ratios by taking the components in the interfaces as granularity;
2) Performing inter-component analysis based on the corresponding relationship, namely comparing the position relationship of the same component under different scaling interfaces, and detecting scaling defects caused by the change of the position relationship among the components;
3) And performing intra-component analysis based on the corresponding relation, comparing and analyzing the content displayed by the components, and detecting the scaling defects caused by the inconsistency of the component content.
2. The method according to claim 1, wherein the method for establishing the corresponding relationship is: acquiring all layout files of the target mobile application, and injecting a unique component identifier into the component contained in each layout file to distinguish different types of components; packaging the target mobile application injected with the component unique identifier into an installation package, installing the installation package on a plurality of smart phones which are displayed in different scaling ratios, and operating the target mobile application to reach the same interface p; the method comprises the steps of obtaining a layout file of an interface p and image information of components in the interface p, generating component IDs of corresponding components by utilizing component identifiers in the layout file and character strings contained in the components, taking the components with the same component IDs as a component pair, and establishing corresponding relations of the same component in interfaces with different scaling ratios.
3. The method of claim 2, wherein each component widget in the layout file forms a component tree widget in a tree structure form; ith component widget in component tree Widget i Containing K components { widget j ,widget j+1 ,…,widget j+K Either } or zero components; generating a unique string identifier for each component as the ID attribute auxiliaryID of the corresponding component; operating the target mobile application to reach the interface p, and acquiring the corresponding component tree PageWidget of the interface p when the scaling is s p,s And an image of each component therein, wherein
Figure FDA0003804117570000011
As a pagewidget tree p,s Middle ith component
Figure FDA0003804117570000012
The image of (a); according to
Figure FDA0003804117570000013
Component ID of (1) looking up the corresponding component in the interface p at the scaling s
Figure FDA0003804117570000014
Get the component pair
Figure FDA0003804117570000015
4. The method of claim 3, wherein generating a component
Figure FDA0003804117570000016
The method of component ID value of (1) is:
11 Traverse each component in the component tree Widget and record its ID attribute auxiliaryID; if it is
Figure FDA0003804117570000017
ID attribute value of
Figure FDA0003804117570000018
Is unique, it is taken as a component
Figure FDA0003804117570000019
ID attribute value of, component
Figure FDA00038041175700000110
As a component
Figure FDA00038041175700000111
Otherwise, step 12) is performed;
12 ) a judgment component
Figure FDA00038041175700000112
Whether it has the same auxiliary ID value as its sibling component, if any
Figure FDA00038041175700000113
Sibling components with the same auxiliary id value; traversing all the descendant components of the sibling component, stopping traversing the sibling component and the descendant components thereof if encountering the descendant component with the auxiaryID value not unique in the traversing process, connecting the text attribute values of the traversed components into a character string postfix, connecting the auxiaryID value and the postfix of the traversed components together to form the component
Figure FDA0003804117570000021
The component ID value of (1).
5. The method of claim 3, wherein the assembly is in a form of a kit
Figure FDA0003804117570000022
Including height
Figure FDA0003804117570000023
Width of
Figure FDA0003804117570000024
Rendering order drawingOrder i p,s Text, text
Figure FDA0003804117570000025
Rollability
Figure FDA0003804117570000026
Scaling
Figure FDA0003804117570000027
The image
Figure FDA0003804117570000028
Is a width
Figure FDA0003804117570000029
Height
Figure FDA00038041175700000210
A depth 4 multi-channel image, the image
Figure FDA00038041175700000211
The last channel of (2) is a transparency channel image
Figure FDA00038041175700000212
The first three channels are red, green and blue channel images
Figure FDA00038041175700000213
6. The method of claim 5, wherein the inter-component analysis is performed by:
21 PageWidget Tree for the corresponding interface p at scale s p,s Traversing the component tree PageWidgetTree in a root-first traversal manner p,s If the current component is a non-root component
Figure FDA00038041175700000214
Then utilize the non-root component
Figure FDA00038041175700000215
Image of (2)
Figure FDA00038041175700000216
Transparency channel alpha of (1) p,s,i Is initialized to a width of
Figure FDA00038041175700000217
Has a height of
Figure FDA00038041175700000218
Two-dimensional visible matrix visible p,s,i
22 Determine non-root components
Figure FDA00038041175700000219
Whether a region in the screen is in its parent component
Figure FDA00038041175700000220
Outside the area in the screen, if outside the area, and parent component
Figure FDA00038041175700000221
If it is not rolling, then determine the non-root component
Figure FDA00038041175700000222
Is not visible, and is provided with a component
Figure FDA00038041175700000223
Is
Figure FDA00038041175700000224
The attribute is false; if within the region, then a non-root component is obtained
Figure FDA00038041175700000225
At its parent component
Figure FDA00038041175700000226
Within the region of (1)
Figure FDA00038041175700000227
And corresponding clipping coordinate region
Figure FDA00038041175700000228
23 Will crop the image
Figure FDA00038041175700000229
As a template, at the parent component
Figure FDA00038041175700000230
Performing a matching search in the image of (1), if the searched area
Figure FDA00038041175700000231
And cropping coordinate regions
Figure FDA00038041175700000232
If the cross-over ratio of (1) is equal to 1, then the non-root component is determined
Figure FDA00038041175700000233
At parent component
Figure FDA00038041175700000234
Visible recording assembly
Figure FDA00038041175700000235
Is/are as follows
Figure FDA00038041175700000236
Attribute false, otherwise invisible, and record component
Figure FDA00038041175700000237
Is/are as follows
Figure FDA00038041175700000238
Attribute is true;
24 Get parent component
Figure FDA00038041175700000239
Visible matrix of p,s,j Obtaining a non-root component
Figure FDA00038041175700000240
Visible matrix visible p,s,i If the component
Figure FDA00038041175700000241
Is/are as follows
Figure FDA00038041175700000242
With the attribute of false, the visible matrix visible p,s,i All values in (1) are assigned to 0; otherwise, go to step 25);
25 According to non-root components
Figure FDA00038041175700000243
Visible matrix of p,s,i Obtaining the corresponding visible area
Figure FDA00038041175700000244
According to the cutting coordinate region
Figure FDA00038041175700000245
For non-root component
Figure FDA00038041175700000246
Visual matrix and parent component
Figure FDA00038041175700000247
Clipping the visible matrix, and performing bitwise sum operation on the clipping result to obtain crop ANDVisible p,s,i (ii) a Then according to the cutting coordinate region
Figure FDA0003804117570000031
Will cropeddanducibile p,s,i Replace back the visable p,s,i In the cutting area of (2), obtaining an updated visible p,s,i And calculating a new visible area
Figure FDA0003804117570000032
If it is
Figure FDA0003804117570000033
Is equal to
Figure FDA0003804117570000034
Recording assembly
Figure FDA0003804117570000035
Properties of whether occluded by parent component
Figure FDA0003804117570000036
False, otherwise true;
26 For
Figure FDA0003804117570000037
Non-root component with attribute of true
Figure FDA0003804117570000038
If its sibling component set
Figure FDA0003804117570000039
If not, then draw order in parent component is utilized i p,s Analyzing non-root components
Figure FDA00038041175700000310
Occlusion relationships with its set of sibling components and recording occluded non-root components
Figure FDA00038041175700000311
Of sibling components
Figure FDA00038041175700000312
27 According to the method of the steps 21 to 26) to scale the component tree PageWidget of the corresponding interface p when the scale s' is scaled p,s′ Processing to obtain the PageWidgetTree p,s′ Each inA non-root assembly
Figure FDA00038041175700000313
Property value of (2)
Figure FDA00038041175700000314
Figure FDA00038041175700000315
Overlapping sets with sibling components
Figure FDA00038041175700000316
28 For component pairs
Figure FDA00038041175700000317
If it is
Figure FDA00038041175700000318
Or alternatively
Figure FDA00038041175700000319
Or
Figure FDA00038041175700000320
It is determined that a scaling problem exists.
7. The method of claim 6, wherein an overlapping set of sibling components is obtained
Figure FDA00038041175700000321
The method comprises the following steps:
261 Will not be a root component
Figure FDA00038041175700000322
And its sibling component is based on the parent component
Figure FDA00038041175700000323
Drawing order of (1)Sorting in a descending order, and screening brother components of the sequence according to the sequence from big to small of the drawing order; wherein the non-root elements
Figure FDA00038041175700000324
Qth large sibling component of (1)
Figure FDA00038041175700000325
PageWidgetTree being a component tree p,s The kth component in
Figure FDA00038041175700000326
Brother component
Figure FDA00038041175700000327
Is/are as follows
Figure FDA00038041175700000328
Greater than drawingOrder i p,s And is
Figure FDA00038041175700000329
To true, then the component is
Figure FDA00038041175700000330
Adding to an ordered set
Figure FDA00038041175700000331
In which
Figure FDA00038041175700000332
Corresponding sibling component
Figure FDA00038041175700000333
Namely the assembly
Figure FDA00038041175700000334
262 ) traverse the ordered set Peer in descending order of drawing order p,s,i According to the assembly
Figure FDA00038041175700000335
Position coordinates and currently traversed components
Figure FDA00038041175700000336
If the two components intersect in the screen, the intersection area of the two components in the screen is calculated, and the components are paired according to the intersection area and the positions of the components on the screen
Figure FDA00038041175700000337
Visible matrix of p,s,i Cutting to obtain assembly
Figure FDA00038041175700000338
The clipping visible matrix overlap visible p,s,i And assembly
Figure FDA00038041175700000339
The clipping visible matrix overlap visible p,s,k (ii) a Calculating the visible matrix overlapVisible p,s,i Visible area of
Figure FDA00038041175700000340
And intersecting occlusion matrix overlapBlockedVisible p,s,i,k
263 According to the intersection region, will intersect the occlusion matrix overlappblockdvisible p,s,i,k Replacement to overlapVisible p,s,i In the corresponding region, thereby updating the overlapVisible p,s,i (ii) a Calculating an intersecting occlusion matrix overlap pBlockedVisile p,s,i,k Area of (2)
Figure FDA0003804117570000041
If it is
Figure FDA0003804117570000042
Then the decision component
Figure FDA0003804117570000043
Shielding component
Figure FDA0003804117570000044
And the components
Figure FDA0003804117570000045
Add the ID attribute value of (c) to the sibling component overlapping set
Figure FDA0003804117570000046
In (1).
8. The method of claim 2, wherein the in-module analysis is performed by:
31 Classifying component pairs consisting of leaf nodes in the component trees under two different scales into literal component pairs and non-literal component pairs;
32 For a text component pair, extracting images of text parts in the component from images of the component at different scales, and judging that scaling problems exist if the ratio change of text areas at two different scales is inconsistent with the scales;
33 For non-character component pairs, extracting the foreground of the components and counting the number of connected domains, if the components under two scaling ratios have the same connected domain, judging that scaling problems do not exist, otherwise, calculating the image similarity of the two components, and if the similarity is lower than a set threshold, judging that scaling problems exist.
9. An electronic apparatus, comprising a memory and a processor, the memory storing a computer program configured to be executed by the processor, the computer program comprising instructions for carrying out the steps of the method of any of claims 1 to 8.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 8.
CN202210991441.7A 2022-08-18 2022-08-18 Interface scaling defect detection method for mobile application and electronic device Pending CN115357490A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210991441.7A CN115357490A (en) 2022-08-18 2022-08-18 Interface scaling defect detection method for mobile application and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210991441.7A CN115357490A (en) 2022-08-18 2022-08-18 Interface scaling defect detection method for mobile application and electronic device

Publications (1)

Publication Number Publication Date
CN115357490A true CN115357490A (en) 2022-11-18

Family

ID=84003586

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210991441.7A Pending CN115357490A (en) 2022-08-18 2022-08-18 Interface scaling defect detection method for mobile application and electronic device

Country Status (1)

Country Link
CN (1) CN115357490A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116541009A (en) * 2023-07-07 2023-08-04 成都中科合迅科技有限公司 User interface creation and updating method and system based on component tree

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116541009A (en) * 2023-07-07 2023-08-04 成都中科合迅科技有限公司 User interface creation and updating method and system based on component tree
CN116541009B (en) * 2023-07-07 2023-09-08 成都中科合迅科技有限公司 User interface creation and updating method and system based on component tree

Similar Documents

Publication Publication Date Title
US10866997B2 (en) Determining functional and descriptive elements of application images for intelligent screen automation
US10191889B2 (en) Systems, apparatuses and methods for generating a user interface by performing computer vision and optical character recognition on a graphical representation
US10572725B1 (en) Form image field extraction
US6226407B1 (en) Method and apparatus for analyzing computer screens
Yanikoglu et al. Pink Panther: a complete environment for ground-truthing and benchmarking document page segmentation
CN103714338B (en) Image processing apparatus and image processing method
KR20190123790A (en) Extract data from electronic documents
US12086728B2 (en) Form structure extraction by predicting associations
CN111738252B (en) Text line detection method, device and computer system in image
CN111985462B (en) Ancient character detection, identification and retrieval system based on deep neural network
WO2020071558A1 (en) Business form layout analysis device, and analysis program and analysis method therefor
CN105260428A (en) Picture processing method and apparatus
RU2605078C2 (en) Image segmentation for data verification
CN114549993A (en) Method, system and device for scoring line segment image in experiment and readable storage medium
CN111078979A (en) Method and system for identifying network credit website based on OCR and text processing technology
CN115240213A (en) Form image recognition method and device, electronic equipment and storage medium
CN111460355A (en) Page parsing method and device
CN115357490A (en) Interface scaling defect detection method for mobile application and electronic device
KR102572180B1 (en) text classification
CN112784932A (en) Font identification method and device and storage medium
Bao et al. Enhancing developer interactions with programming screencasts through accurate code extraction
CN104598289A (en) Recognition method and electronic device
CN115631374A (en) Control operation method, control detection model training method, device and equipment
CN113033333B (en) Entity word recognition method, entity word recognition device, electronic equipment and storage medium
JP6896260B1 (en) Layout analysis device, its analysis program and its analysis 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