CN111881049B - Acceptance method and device of application program interface and electronic equipment - Google Patents

Acceptance method and device of application program interface and electronic equipment Download PDF

Info

Publication number
CN111881049B
CN111881049B CN202010760904.XA CN202010760904A CN111881049B CN 111881049 B CN111881049 B CN 111881049B CN 202010760904 A CN202010760904 A CN 202010760904A CN 111881049 B CN111881049 B CN 111881049B
Authority
CN
China
Prior art keywords
layer
standard
checked
layers
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010760904.XA
Other languages
Chinese (zh)
Other versions
CN111881049A (en
Inventor
蔡宇
吴瑞卿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing IQIYI Science and Technology Co Ltd
Original Assignee
Beijing IQIYI Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing IQIYI Science and Technology Co Ltd filed Critical Beijing IQIYI Science and Technology Co Ltd
Priority to CN202010760904.XA priority Critical patent/CN111881049B/en
Publication of CN111881049A publication Critical patent/CN111881049A/en
Application granted granted Critical
Publication of CN111881049B publication Critical patent/CN111881049B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/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
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Quality & Reliability (AREA)
  • Computer Hardware Design (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Design And Manufacture Of Integrated Circuits (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the invention provides an acceptance method and device of an application program interface and electronic equipment, wherein the method comprises the following steps: acquiring attribute information of each layer to be checked in the interface to be checked, and acquiring attribute information of each standard layer in the standard interface; determining the corresponding relation between each layer to be checked and each standard layer based on the sizes, positions and types of each layer to be checked and each standard layer; determining adjacent layers and intervals of each standard layer according to the size and the position of each standard layer; determining adjacent layers and intervals of each layer to be checked according to the corresponding relation; and comparing the pattern and the interval of each layer to be checked with the pattern and the interval of the corresponding standard layer respectively based on the corresponding relation for each layer to be checked, and determining the checking result of each layer to be checked. The mode and the interval of each layer in the interface to be checked and the standard interface are not required to be manually measured for comparison, so that the checking and accepting efficiency of the application program interface can be improved.

Description

Acceptance method and device of application program interface and electronic equipment
Technical Field
The present invention relates to the field of application program development technologies, and in particular, to a method and an apparatus for checking and accepting an application program interface, and an electronic device.
Background
In the development process of the application program interface, the interface development is carried out according to the requirement of the design manuscript which is finished in advance, and after the development is finished, the application program interface needs to be checked and accepted in order to detect whether the application program interface meets the requirement of the design manuscript.
The current way of accepting an application program interface relies on manual work. Specifically, an image of an application program interface is firstly intercepted by a terminal, and the image is uploaded to a server. And then, using Sketch, photoShop and other tools to manually measure the patterns and the intervals among the layers in the image by using an acceptance person, and comparing the patterns and the intervals with corresponding interfaces in a design draft to mark layers with wrong patterns and/or intervals, thereby obtaining an acceptance result.
Therefore, in the current acceptance method, the patterns and the intervals of each layer in the intercepted image are required to be measured manually by using a Sketch, photoShop tool and the like, and the interfaces corresponding to the design manuscript are required to be compared manually, so that the acceptance efficiency is very low.
Disclosure of Invention
The embodiment of the invention aims to provide an acceptance method and device for an application program interface and electronic equipment, so as to improve the acceptance efficiency of the application program interface. The specific technical scheme is as follows:
In a first aspect, an embodiment of the present invention provides a method for accepting an application program interface, where the method includes:
acquiring attribute information of each layer to be checked in an interface to be checked, and acquiring attribute information of each standard layer in a standard interface, wherein the standard interface is defined by a design draft corresponding to the interface to be checked, and the attribute information comprises size, position, type and style;
determining the corresponding relation between each layer to be checked and each standard layer based on the sizes, positions and types of each layer to be checked and each standard layer;
determining adjacent layers of each standard layer and the distance between each standard layer and the corresponding adjacent layer according to the size and the position of each standard layer;
determining adjacent layers of each layer to be checked and the distance between each layer to be checked and the corresponding adjacent layer according to the corresponding relation and the size and the position of each layer to be checked;
and comparing the pattern and the interval of each layer to be checked with the pattern and the interval of the corresponding standard layer respectively based on the corresponding relation to determine the checking result of each layer to be checked.
Optionally, the step of determining the correspondence between each layer to be checked and each standard layer based on the sizes, positions and types of each layer to be checked and each standard layer includes:
sequencing each layer to be checked according to the position of each layer to be checked and a preset sequencing rule to obtain a sequencing result;
traversing each layer to be checked according to the sequencing result, and calculating the matching degree between the currently traversed layer to be checked and each currently unmatched standard layer according to the types and positions of each layer to be checked and each standard layer when traversing one layer to be checked;
determining a standard layer matched with the currently traversed layer to be checked based on the matching degree, recording the corresponding relation between the currently traversed layer to be checked and the standard layer, and determining that the standard layer is matched;
and continuing to traverse the next layer to be checked, returning to the step of calculating the matching degree between the currently traversed layer to be checked and each unmatched standard layer according to the types and the positions of the layers to be checked and the standard layers until the traversal of all the layers to be checked is finished, and obtaining the corresponding relation between the layers to be checked and the standard layers.
Optionally, before the step of traversing each layer to be checked according to the sorting result, the method further includes:
determining adjacent layers of each standard layer according to the positions of the standard layers;
the step of calculating the matching degree between the currently traversed layer to be checked and each currently unmatched standard layer according to the types and positions of the layers to be checked and the standard layers comprises the following steps:
determining adjacent layers of the currently traversed layers to be checked according to the positions of the layers to be checked;
and respectively calculating the matching degree between the currently traversed layer to be checked and each currently unmatched standard layer based on the type of the currently traversed layer to be checked and the adjacent layers and the type of each currently unmatched standard layer and the adjacent layers.
Optionally, the step of determining the adjacent layer of each standard layer and the distance between each standard layer and the corresponding adjacent layer according to the size and the position of each standard layer includes:
determining a layer row and/or a layer column to which each standard layer belongs according to the size and the position of each standard layer, and determining the layout relation of each standard layer in the standard interface based on the layer row and/or the layer column to which each standard layer belongs, wherein each standard layer in the layer row has an intersection area with at least one other standard layer after being transversely expanded, and each standard layer in the layer column has an intersection area with at least one other standard layer after being longitudinally expanded;
And determining adjacent layers of each standard layer and the distance between each standard layer and the corresponding adjacent layer according to the layout relation.
Optionally, the step of determining the layer row and/or layer column to which each standard layer belongs according to the size and the position of each standard layer, and determining the layout relationship of each standard layer in the standard interface based on the layer row and/or layer column to which each standard layer belongs includes:
determining a layer row to which each standard layer belongs according to the size and the position of each standard layer;
traversing each layer line which is not determined, calculating the distance between the layer line which is currently traversed and the determined layer line as well as the longitudinal boundary of the standard interface, and determining the layer line corresponding to the minimum distance as a target layer line;
traversing the target layer row, if the target layer row only comprises one standard layer, adding the identification of the standard layer into a dependency relation array, returning to each layer row which is not determined by traversing, and calculating the distance between the currently traversed layer row and the determined layer row as well as the boundary of the standard interface until all layer rows are traversed, wherein the identification of the standard layer which is included in the traversed layer row is recorded in the dependency relation array and is used for representing the layout relation of each standard layer in the standard interface;
If the target layer row comprises a plurality of standard layers, determining a layer column to which each standard layer belongs according to the sizes and the positions of the standard layers;
traversing each layer column which is not determined, calculating the distance between the currently traversed layer column and the determined layer column as well as the transverse boundary of the standard interface, and determining the layer column corresponding to the minimum distance as a target layer column;
traversing the target layer column, if the target layer column only comprises one standard layer, adding the identification of the standard layer into a dependency relation array, returning to each layer column which is not determined by the traversing, and calculating the distance between the currently traversed layer column and the determined layer column and the boundary of the standard interface until all layer columns are traversed;
if the target layer column comprises a plurality of standard layers, returning to the step of determining the layer row to which each standard layer belongs according to the size and the position of each standard layer until all layer columns corresponding to the target layer row are traversed;
the step of determining the adjacent layers of each standard layer and the distance between each standard layer and the corresponding adjacent layer according to the layout relation comprises the following steps:
Traversing each mark in the dependency relation array in sequence, and determining the distance between the standard layer corresponding to the currently traversed mark and the determined layer in the transverse direction and the longitudinal direction when traversing one mark;
determining the corresponding layer with the minimum horizontal and longitudinal distances as the adjacent layer of the standard layer corresponding to the currently traversed mark, determining the minimum distance as the distance between the standard layer and the adjacent layer, and determining the standard layer as the determined layer;
and continuing traversing the next mark, and returning to the step of determining the distance between the standard layer corresponding to the currently traversed mark and the determined layer in the transverse direction and the longitudinal direction until all mark traversals are finished.
Optionally, the step of obtaining attribute information of each layer to be checked in the interface to be checked and obtaining attribute information of each standard layer in the standard interface includes:
calling a preset view interface, and extracting attribute information of each layer to be checked in the interface to be checked;
analyzing each standard layer in the standard interface to obtain attribute information of each standard layer in the standard interface.
Optionally, before the step of obtaining the attribute information of each layer to be checked in the interface to be checked, the method further includes:
Acquiring operation condition parameters of an interface to be checked of an application program, and configuring an operation environment based on the operation condition parameters;
and starting the application program based on the running environment, and entering the interface to be checked.
Optionally, before the step of determining the correspondence between each layer to be checked and each standard layer based on the size, the position and the type of each layer to be checked and each standard layer, the method further includes:
and carrying out layer processing on each layer to be checked and accepted and each standard layer by adopting at least one of the following modes:
determining a redundant layer according to the patterns and the sizes of each layer to be checked and each standard layer, and removing the redundant layer; or alternatively, the first and second heat exchangers may be,
aiming at the layers to be checked and accepted and the standard layers with the text type, adjusting the heights of the layers with the same character size of the included characters to be the same height; or alternatively, the first and second heat exchangers may be,
for a plurality of layers belonging to the same icon, the plurality of layers are combined into one layer.
In a second aspect, an embodiment of the present invention provides an acceptance device of an application program interface, the device including:
the system comprises an attribute information acquisition module, a storage module and a storage module, wherein the attribute information acquisition module is used for acquiring attribute information of each layer to be checked in an interface to be checked and acquiring attribute information of each standard layer in a standard interface, wherein the standard interface is an interface defined by a design draft corresponding to the interface to be checked and comprises a size, a position, a type and a style;
The corresponding relation determining module is used for determining the corresponding relation between each layer to be checked and each standard layer based on the sizes, the positions and the types of each layer to be checked and each standard layer;
the first interval determining module is used for determining adjacent layers of each standard layer and intervals between each standard layer and the corresponding adjacent layers according to the sizes and the positions of the standard layers;
the second interval determining module is used for determining adjacent layers of each layer to be checked and the interval between each layer to be checked and the corresponding adjacent layer according to the corresponding relation and the size and the position of each layer to be checked;
and the layer acceptance module is used for comparing the pattern and the interval of each layer to be accepted with the pattern and the interval of the corresponding standard layer respectively based on the corresponding relation to determine the acceptance result of each layer to be accepted.
Optionally, the correspondence determining module includes:
the layer ordering unit is used for ordering the layers to be checked according to the positions of the layers to be checked and a preset ordering rule to obtain an ordering result;
The corresponding relation determining unit is used for traversing each layer to be checked according to the sequencing result, and calculating the matching degree between the currently traversed layer to be checked and each currently unmatched standard layer according to the types and positions of each layer to be checked and each standard layer when one layer to be checked is traversed;
determining a standard layer matched with the currently traversed layer to be checked based on the matching degree, recording the corresponding relation between the currently traversed layer to be checked and the standard layer, and determining that the standard layer is matched;
and continuing to traverse the next layer to be checked, returning to calculate the matching degree between the currently traversed layer to be checked and each unmatched standard layer according to the types and the positions of the layers to be checked and the standard layers until the traversal of all the layers to be checked is finished, and obtaining the corresponding relation between the layers to be checked and the standard layers.
Optionally, the first interval determining module includes:
the layout relation determining unit is used for determining a layer row and/or a layer column to which each standard layer belongs according to the size and the position of each standard layer, and determining the layout relation of each standard layer in the standard interface based on the layer row and/or the layer column to which each standard layer belongs, wherein each standard layer in the layer row has an intersection area with at least one other standard layer after being transversely expanded, and each standard layer in the layer column has an intersection area with at least one other standard layer after being longitudinally expanded;
And the distance determining unit is used for determining adjacent layers of each standard layer and the distance between each standard layer and the corresponding adjacent layer according to the layout relation.
Optionally, the layout relation determining unit includes:
the layer line dividing subunit is used for determining the layer line to which each standard layer belongs according to the size and the position of each standard layer;
the target line determining subunit is used for traversing each undetermined layer line, calculating the distance between the currently traversed layer line and the determined layer line and the longitudinal boundary of the standard interface, and determining the layer line corresponding to the minimum distance as the target layer line;
a layer line traversing subunit, configured to traverse the target layer line, if the target layer line includes only one standard layer, add the identifier of the standard layer to the dependency relationship array, return to each layer line that is not determined by the traversing, and calculate the distance between the currently traversed layer line and the determined layer line and the boundary of the standard interface until all layer lines traverse; if the target layer row comprises a plurality of standard layers, determining a layer column to which each standard layer belongs according to the sizes and the positions of the standard layers, wherein the dependency relation array records the mark of the standard layer which is included in the traversed layer row and is used for representing the layout relation of each standard layer in the standard interface;
A target column determining subunit, configured to traverse each layer column that is not determined, calculate a distance between the currently traversed layer column and the determined layer column and a lateral boundary of the standard interface, and determine a layer column corresponding to the minimum distance as a target layer column;
a layer column traversing subunit, configured to traverse the target layer column, if the target layer column includes only one standard layer, add the identifier of the standard layer to the dependency relationship array, return to each layer column that is not determined by the traversing, and calculate the distance between the currently traversed layer column and the determined layer column and the boundary of the standard interface until all layer columns are traversed; if the target layer column comprises a plurality of standard layers, returning to the step of determining the layer row to which each standard layer belongs according to the size and the position of each standard layer until all layer columns corresponding to the target layer row are traversed;
the pitch determination unit includes:
the mark traversing subunit is used for traversing each mark in the dependency relation array in sequence, and determining the distance between the standard layer corresponding to the currently traversed mark and the determined layer in the transverse direction and the longitudinal direction when traversing one mark each time; determining the corresponding layer with the minimum horizontal and longitudinal distances as the adjacent layer of the standard layer corresponding to the currently traversed mark, determining the minimum distance as the distance between the standard layer and the adjacent layer, and determining the standard layer as the determined layer; and continuing traversing the next mark, and returning to the step of determining the distance between the standard layer corresponding to the currently traversed mark and the determined layer in the transverse direction and the longitudinal direction until all mark traversals are finished.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing the checking and accepting method step of the application program interface in any one of the first aspect when executing the program stored in the memory.
In a fourth aspect, an embodiment of the present invention provides a computer readable storage medium, where a computer program is stored in the computer readable storage medium, and the computer program when executed by a processor implements the steps of the method for checking and accepting an application program interface according to any one of the first aspect.
In a fifth aspect, embodiments of the present invention provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform the steps of the acceptance method of an application program interface as described in any one of the first aspects above
In the scheme provided by the embodiment of the invention, the electronic equipment can acquire the attribute information of each layer to be checked in the interface to be checked, and acquire the attribute information of each standard layer in the standard interface, wherein the standard interface is defined by a design draft corresponding to the interface to be checked, the attribute information comprises the size, the position, the type and the style, the corresponding relation between each layer to be checked and each standard layer is determined based on the size, the position and the type of each layer to be checked and each standard layer, the adjacent layer of each standard layer and the interval between each standard layer and the corresponding adjacent layer are determined according to the size and the position of each standard layer, the layer to be checked and the interval between each adjacent layer and the corresponding adjacent layer are further determined according to the corresponding relation and the size and the position of each layer to be checked, and the style and the interval of each layer to be checked are respectively compared with the style and the interval of the corresponding standard layer to be checked based on the corresponding relation, and the result of each layer to be checked is determined. Because the patterns and the distances of all the layers in the interface to be checked and the standard interface are not required to be measured manually, and the interface to be checked and the interface corresponding to the design draft are not required to be compared manually, the checking and accepting efficiency of the application program interface can be greatly improved.
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 described below.
FIG. 1 is a flowchart of an acceptance method of an application program interface according to an embodiment of the present invention;
FIG. 2 is a specific flowchart of step S102 in the embodiment shown in FIG. 1;
FIG. 3 (a) is a schematic diagram of an interface to be checked provided by an embodiment of the present invention;
FIG. 3 (b) is a schematic diagram of a standard interface according to an embodiment of the present invention;
FIG. 4 is a specific flowchart of step S103 in the embodiment shown in FIG. 1;
FIG. 5 is another schematic illustration of a standard interface provided by an embodiment of the present invention;
FIG. 6 is a schematic diagram of an attribute information comparison interface according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an acceptance device of an application program interface according to an embodiment of the present invention;
FIG. 8 is a schematic diagram illustrating a specific structure of the correspondence determining module 720 in the embodiment shown in FIG. 7;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the accompanying drawings in the embodiments of the present invention.
In order to improve acceptance efficiency of an application program interface, embodiments of the present invention provide an acceptance method, an apparatus, an electronic device, a computer readable storage medium and a computer program product of the application program interface. The following describes an acceptance method of an application program interface provided by the embodiment of the invention.
The method for checking and accepting the application program interface provided by the embodiment of the invention can be applied to any electronic equipment which needs to check and accept the application program interface, and the electronic equipment can be a computer, a mobile phone, a tablet personal computer and the like, and is not particularly limited. For clarity of description, hereinafter, referred to as an electronic device.
As shown in fig. 1, a method for accepting an application program interface, the method comprising:
s101, acquiring attribute information of each layer to be checked in the interface to be checked, and acquiring attribute information of each standard layer in the standard interface;
the standard interface is an interface defined by a design draft corresponding to the interface to be checked, and the attribute information comprises size, position, type and style.
S102, determining the corresponding relation between each layer to be checked and each standard layer based on the sizes, positions and types of each layer to be checked and each standard layer;
S103, determining adjacent layers of each standard layer and the distance between each standard layer and the corresponding adjacent layer according to the size and the position of each standard layer;
s104, determining adjacent layers of each layer to be checked and the distance between each layer to be checked and the corresponding adjacent layer according to the corresponding relation and the size and the position of each layer to be checked;
s105, comparing the pattern and the space of each layer to be checked with the pattern and the space of the corresponding standard layer respectively based on the corresponding relation, and determining the checking result of each layer to be checked.
In the solution provided in the embodiment of the present invention, the electronic device may obtain attribute information of each layer to be inspected in the interface to be inspected, and obtain attribute information of each layer to be inspected in the standard interface, where the standard interface is an interface defined by a design draft corresponding to the interface to be inspected, the attribute information includes a size, a position, a type, and a style, based on the sizes, the positions, and the types of each layer to be inspected and each layer to be inspected, determine a correspondence between each layer to be inspected and a distance between each layer to be inspected and each layer to be inspected according to the sizes and the positions of each layer to be inspected, and further determine a distance between each layer to be inspected and each layer to be inspected according to the correspondence and the sizes and the positions of each layer to be inspected, and the style and the distance of each layer to be inspected and the corresponding layer to be inspected are compared with the style and the distance of each layer to be inspected and each layer to be inspected based on the correspondence, and each layer to be inspected result is determined. Because the patterns and the distances of all the layers in the interface to be checked and the standard interface are not required to be measured manually, and the interface to be checked and the interface corresponding to the design draft are not required to be compared manually, the checking and accepting efficiency of the application program interface can be greatly improved.
When the application program interface is required to be checked, the electronic device may execute the step S101, that is, obtain attribute information of each layer to be checked in the interface to be checked, and obtain attribute information of each standard layer in the standard interface, where the standard interface is an interface defined by a design draft corresponding to the interface to be checked. The attribute information of the layer may include the size, position, type, style, etc. of the layer, and the style may include information of font, font size, frame shape, color, etc. The types of layers may include text types and picture types.
The layer to be checked is a layer in the interface to be checked, and the standard layer is a layer in the standard interface defined by the design draft, which is only for conveniently distinguishing the layers in the two interfaces, and has no other limiting meaning.
After the attribute information is obtained, the electronic device may determine the correspondence between each layer to be checked and each standard layer based on the size, the position and the type of each layer to be checked and each standard layer, that is, execute the step S102.
Since it is desired to determine whether the layer to be checked in the application program interface satisfies the requirements of the standard layer in the corresponding interface in the design draft, it is necessary to determine according to which standard layer the layer to be checked is designed and developed, that is, it is necessary to determine with which standard layer the layer to be checked corresponds.
The size, the position and the type of the layers can represent the area, the display position and the display text or picture of the layers in the interface, and according to the attribute information, the corresponding relation between the layers to be checked and the standard layers can be determined.
Because the patterns of the layers and the spacing between the layers and the adjacent layers can represent the display effect of the layers in the interface, the application program interface can be checked and accepted from the two aspects of the patterns of the layers and the spacing between the layers and the adjacent layers, so that the display effect of the application program interface is consistent with the effect of a standard interface in a design draft.
The electronic device may perform the above step S103 to determine the adjacent layers of each standard layer and the spacing between each standard layer and the corresponding adjacent layer. Specifically, since the size and position of each standard layer have been determined, the electronic device can determine the positional relationship between each standard layer according to the size and position of each standard layer, for example, layer a on the left side of layer B, or the like. And further, adjacent layers of each standard layer, and the spacing therebetween, can be determined. Wherein, the adjacent layers can be the layers with the smallest spacing with the standard layers.
In one embodiment, the electronic device may calculate a distance between every two standard layers in each standard layer, and for each standard layer, determine, as its adjacent layer, the other standard layer having the smallest distance between the two standard layers, where the smallest distance is the distance between the two standard layers.
Because the corresponding relation between each layer to be checked and each standard layer is already determined, after the adjacent layers of the standard layers and the distances between each standard layer and the corresponding adjacent layers are determined, the adjacent layers of each layer to be checked can be determined according to the corresponding relation.
For example, the correspondence between each layer to be checked and each standard layer is shown in the following table:
sequence number Layer to be checked Standard layer
1 Layer a to be checked Standard layer a
2 Layer b to be checked Standard layer B
3 Layer c to be checked Standard layer C
4 Layer d to be checked Standard layer D
n Layer n to be checked Standard layer N
Then, if the electronic device determines that the adjacent layer of the standard layer C is the standard layer B, the electronic device may determine that the adjacent layer of the layer to be accepted C is the layer to be accepted B according to the correspondence shown in the table.
Further, the electronic device may calculate a spacing between each layer to be accepted and a corresponding adjacent layer. As an implementation mode, the image layer is generally rectangular and has 4 boundaries, namely, the upper boundary, the lower boundary, the left boundary and the right boundary, the pixel positions of the boundaries can be determined by the electronic equipment according to the positions and the sizes of the image layer to be checked, and then the distance between the image layer to be checked and the corresponding adjacent image layer can be calculated. For example, if layer 1 is to the left of its corresponding adjacent layer 2, then the spacing between layer 1 and adjacent layer 2 may be the pixel abscissa value of the boundary adjacent to layer 2 to the left and the pixel abscissa value of the boundary adjacent to layer 1 to the right.
After determining the spacing, the electronic device may compare the pattern and spacing of each layer to be inspected with the pattern and spacing of the corresponding standard layer based on the corresponding relationship, to determine the inspection result of each layer to be inspected, that is, execute the step S105.
Specifically, the electronic device may compare the pattern and the corresponding pitch of each layer to be checked with the pattern and the corresponding pitch of the standard layer corresponding to the pattern and the pitch of each layer to be checked, and if the pattern and the pitch are consistent, it is indicated that the display effect of the layer to be checked is consistent with the effect that the design draft wants to achieve, then it may be determined that the checking result of the layer to be checked is passing the checking.
If at least one of the pattern and the space is inconsistent, which indicates that the display effect of the layer to be checked is inconsistent with the effect expected by the design manuscript, the checking result of the layer to be checked can be determined to be failed. Thus, the acceptance result of each layer to be accepted can be obtained, and the acceptance of the application program interface is completed.
As shown in fig. 2, the step of determining the correspondence between each layer to be inspected and each standard layer based on the size, the position and the type of each layer to be inspected and each standard layer may include:
S201, sorting the layers to be inspected according to the positions of the layers to be inspected and a preset sorting rule to obtain a sorting result;
in order to facilitate subsequent traversal, the electronic device may sort the layers to be inspected according to a preset sorting rule and the positions of the layers to be inspected, so as to obtain a sorting result. The preset ordering rule may be to order the positions in the interface from top to bottom, from left to right, and the like, which is all reasonable.
S202, traversing each layer to be checked according to the sequencing result, and calculating the matching degree between the currently traversed layer to be checked and each currently unmatched standard layer according to the types and the positions of each layer to be checked and each standard layer when traversing one layer to be checked;
after the sorting result is obtained, the electronic device can traverse each layer to be checked according to the sorting result, namely the sorting result traverses from the first layer to be checked to the last layer to be checked. When one layer to be checked is traversed, the electronic equipment can calculate the matching degree between the currently traversed layer to be checked and each currently unmatched standard layer according to the types and the positions of each layer to be checked and each standard layer.
For the first traversal to-be-checked layer, the current unmatched standard layers are all standard layers, that is, for the first traversal to-be-checked layer, the matching degree between the to-be-checked layer and all standard layers needs to be calculated. For the non-first traversal layers to be checked, the standard layers which are not matched at present are the standard layers which are not determined corresponding relation at present in all the standard layers. That is, for the layer to be checked that is not the first traversal, the matching degree between the layer to be checked and each standard layer that is currently remaining and has not yet determined the correspondence needs to be calculated.
In one embodiment, the electronic device may determine the layers to be checked around the currently traversed layers to be checked according to the positions of the layers to be checked, and similarly, may determine the standard layers around each standard layer according to the positions of the standard layers. Furthermore, whether the type of the currently traversed layer to be checked is the same as the type of each currently unmatched standard layer can be compared, whether the type of the standard layer around the currently traversed layer to be checked is the same as the type of the standard layer around each unmatched standard layer can be also compared, and the matching degree is determined according to the two comparison results.
S203, determining a standard layer matched with the currently traversed layer to be checked based on the matching degree, recording the corresponding relation between the currently traversed layer to be checked and the standard layer, and determining that the standard layer is matched;
after the matching degree is determined, the electronic device can determine a standard layer matched with the currently traversed layer to be checked, and record a matching result, namely, the corresponding relation between the currently traversed layer to be checked and the standard layer.
As one implementation, the electronic device may determine the standard layer with the highest matching degree as the standard layer corresponding to the currently traversed layer to be checked. Then the standard layer, i.e. the matched standard layer, can not calculate the matching degree between the standard layer and the standard layer when traversing the next layer to be checked, so as to reduce the calculation amount and improve the matching efficiency.
And S204, continuously traversing the next layer to be checked and returning to the step of calculating the matching degree between the currently traversed layer to be checked and each unmatched standard layer according to the types and the positions of the layers to be checked and the standard layers until the traversal of all the layers to be checked is finished, and obtaining the corresponding relation between the layers to be checked and the standard layers.
And then, the electronic equipment can continue to traverse the next layer to be checked and return to the step of calculating the matching degree between the currently traversed layer to be checked and each currently unmatched standard layer according to the types and the positions of the layers to be checked and the standard layers until the traversal of all the layers to be checked is finished, so that the corresponding relation between the layers to be checked and the standard layers can be obtained.
It can be seen that, in this embodiment, the electronic device may sort the layers to be inspected according to the positions of the layers to be inspected and a preset sorting rule, so as to obtain a sorting result, traverse the layers to be inspected according to the sorting result, and calculate, according to the types and positions of the layers to be inspected and the standard layers, the matching degree between the layers to be inspected and each standard layer that is not currently matched, so as to determine the standard layer that is matched with the layers to be inspected based on the matching degree, so as to obtain the corresponding relationship between the layers to be inspected and the standard layers. Therefore, the corresponding relation between each layer to be checked and each standard layer can be accurately determined according to the matching degree, and the checking and accepting efficiency and accuracy of the application program interface are further improved.
As an implementation manner of the embodiment of the present invention, before the step of traversing each layer to be checked according to the sorting result, the method may further include:
and determining adjacent layers of each standard layer according to the positions of the standard layers.
Because the matching degree between the adjacent layers needs to be calculated when the matching degree between the layers is calculated, in order to improve the traversing efficiency, the electronic device can determine the adjacent layers of each standard layer according to the positions of the standard layers before traversing each layer to be checked according to the sequencing result. The adjacent layers can be layers adjacent to the standard layers in the 4 directions of up, down, left and right in the interface, or 2 or 3 layers adjacent to the standard layers in the four directions can be selected as the adjacent layers, which is reasonable.
Correspondingly, the step of calculating the matching degree between the currently traversed acceptance layer and each currently unmatched standard layer according to the types and positions of the layers to be accepted and the standard layers may include:
determining adjacent layers of the current layer to be checked according to the positions of the layers to be checked; and respectively calculating the matching degree between the currently traversed layer to be checked and each currently unmatched standard layer based on the type of the currently traversed layer to be checked and the adjacent layers and the type of each currently unmatched standard layer and the adjacent layers.
The electronic device may determine, according to the positions of the layers to be checked, adjacent layers of the currently traversed layer to be checked, where the adjacent layers may be layers that are adjacent to the currently traversed layer to be checked in the up-down, left-right, 4 directions in the interface, or may select 2 or 3 layers that are adjacent in the four directions as the adjacent layers. In order to facilitate the determination of the degree of matching, the number of adjacent layers of the currently traversed layers to be accepted and the standard layers and the corresponding directions in the interface may remain consistent.
After determining the adjacent layers of the currently traversed to-be-inspected layer, the electronic device can calculate the matching degree between the currently traversed to-be-inspected layer and each currently unmatched standard layer based on the types of the currently traversed to-be-inspected layer and the adjacent layers and the types of each currently unmatched standard layer and the adjacent layers.
If the type of the currently traversed layer to be checked is the same as the type of the standard layer, and the type of the adjacent layer of the currently traversed layer to be checked is also the same as the type of the adjacent layer of the standard layer, the highest matching degree between the currently traversed layer to be checked and the standard layer can be determined, for example, the matching degree can be recorded as 1.
If the type of the currently traversed layer to be checked is different from the type of the standard layer, then it may be determined that the matching degree between the currently traversed layer to be checked and the standard layer is the lowest, for example, may be recorded as 0.
If the type of the currently traversed layer to be checked is the same as the type of the standard layer and the type of the adjacent layer of the currently traversed layer to be checked is the same as the type of the adjacent layer of the standard layer and different from the type of the adjacent layer, the matching degree between the currently traversed layer to be checked and the standard layer can be determined according to the number of the adjacent layers with the same type, for example, the matching degree can be a numerical value between 0 and 1. In one embodiment, the greater the number of adjacent layers of the same type, the higher the degree of matching between the currently traversed layer to be accepted and the standard layer may be.
For example, in the acceptance interface 300 shown in fig. 3 (a), adjacent layers of the currently traversed acceptance layer 310 include an adjacent layer 311, an adjacent layer 312 and an adjacent layer 313. As shown in fig. 3 (b), in the standard interface 301, the unmatched standard layers include a standard layer 320, a standard layer 321, a standard layer 322, and a standard layer 323. The electronic device may determine the degree of matching between the currently traversed layer under inspection 310 and standard layer 320, standard layer 321, standard layer 322, and standard layer 323, respectively.
When calculating the matching degree between the currently traversed layer 310 to be checked and the standard layer 320, it may be determined whether the type of the currently traversed layer 310 to be checked is the same as the type of the standard layer 320, and whether the types of the adjacent layer 311, the adjacent layer 312 and the adjacent layer 313 are the same as the types of the standard layer 321, the standard layer 322 and the standard layer 323 respectively, so as to obtain the matching degree.
It can be seen that, in this embodiment, the electronic device may determine, according to the positions of the to-be-inspected layers, the adjacent layers of the currently traversed to-be-inspected layer, and calculate, based on the type of the currently traversed to-be-inspected layer and its adjacent layers, and the type of each currently unmatched standard layer and its adjacent layers, the matching degree between the currently traversed to-be-inspected layer and each currently unmatched standard layer, so that the types of the currently traversed to-be-inspected layer and its adjacent layers may be considered simultaneously, and accuracy of the matching degree calculation may be ensured.
As an implementation manner of the embodiment of the present invention, the step of determining the adjacent layer of each standard layer and the distance between each standard layer and the corresponding adjacent layer according to the size and the position of each standard layer may include:
Determining a layer row and/or a layer column to which each standard layer belongs according to the size and the position of each standard layer, and determining the layout relation of each standard layer in the standard interface based on the layer row and/or the layer column to which each standard layer belongs; and determining adjacent layers of each standard layer and the distance between each standard layer and the corresponding adjacent layer according to the layout relation.
And each standard layer in the layer row has an intersection area with at least one other standard layer after being expanded along the transverse direction, and each standard layer in the layer column has an intersection area with at least one other standard layer after being expanded along the longitudinal direction. The electronic device may determine whether each standard layer has an overlapping portion in a horizontal direction (lateral direction) and an overlapping portion in a vertical direction (longitudinal direction), and the electronic device may determine a layer row to which each standard layer belongs based on whether each standard layer has an overlapping portion in a horizontal direction and/or determine a layer column to which each standard layer belongs based on whether each standard layer has an overlapping portion in a vertical direction (longitudinal direction).
Because the layer row and/or layer column to which the standard layer belongs can represent the position relationship of the standard layer in the standard interface, the electronic device can determine the layout relationship of each standard layer in the standard interface, namely the position relationship of the standard layer in the standard interface.
The electronic device may then determine adjacent layers of each standard layer and a distance between each adjacent layer according to the positional relationship of the standard layer in the standard interface. Wherein, adjacent layers can be other standard layers with minimum spacing between the adjacent layers and the standard layers in the transverse direction and the longitudinal direction respectively.
In this embodiment, the electronic device may determine, according to the size and the position of each standard layer, a layer row and/or a layer column to which each standard layer belongs, and determine, based on the layer row and/or the layer column to which each standard layer belongs, a layout relationship of each standard layer in a standard interface, and further determine, according to the layout relationship, a neighboring layer of each standard layer and a distance between each standard layer and a corresponding neighboring layer, so as to accurately and quickly determine the neighboring layer and the corresponding distance of each standard layer.
As shown in fig. 4, the step of determining, according to the size and the position of each standard layer, a layer row and/or a layer column to which each standard layer belongs, and determining, based on the layer row and/or the layer column to which each standard layer belongs, a layout relationship of each standard layer in the standard interface may include:
S401, determining a layer row to which each standard layer belongs according to the size and the position of each standard layer;
when determining the spacing between layers, first, the electronic device may determine, according to the size and position of each standard layer, the layer row to which each standard layer belongs. Wherein, each standard layer in the layer row has an intersection area with at least one other standard layer after being expanded along the transverse direction.
That is, the electronic device may determine whether each standard layer has an overlapping portion in the horizontal direction (lateral direction), determining the row to which the standard layer belongs. The lateral direction may be a width direction of the application program interface. If an intersection area exists between a standard image layer and at least one other standard image layer after the standard image layer is expanded along the transverse direction, the standard image layer with the intersection area is divided into the same image layer row.
For example, in the standard interface 500 shown in fig. 5, since the standard layer a and the standard layer B have an intersection area after being expanded in the lateral direction, the two standard layers are divided into the same layer row. Since the standard layer C-standard layer G has an intersection area after being expanded in the lateral direction, the standard layer C-standard layer G is divided into a layer row.
S402, traversing each layer line which is not determined, calculating the distance between the currently traversed layer line and the determined layer line as well as the longitudinal boundary of the standard interface, and determining the layer line corresponding to the minimum distance as a target layer line;
After each layer line is obtained by dividing, the electronic device can traverse each layer line which is not determined, calculate the distance between the currently traversed layer line and the determined layer line as well as the longitudinal boundary of the standard interface, and determine the layer line corresponding to the minimum distance as the target layer line.
When the first traversed layer row of the currently traversed layer row does not exist in the first traversed layer row, only the distance between the layer row and the longitudinal boundary of the standard interface can be calculated. Further, the electronic device may determine a row of all the layer rows having a smallest spacing from a longitudinal boundary of the standard interface as a first target layer row. Where there is typically one layer in the standard interface that is the same size as the standard interface, which layer may be referred to as the parent layer, the electronic device may determine the row of all layer rows that has the smallest spacing from the longitudinal boundary of the parent layer as the first target layer row.
When determining the second target layer row, the electronic device may calculate the distance between the currently undetermined layer row and the first target layer row and the longitudinal boundary of the standard interface, further determine the layer row corresponding to the minimum distance as the second target layer row, and so on, may determine the sequence of all the layer rows.
S403, traversing the target layer row, if the target layer row only comprises one standard layer, adding the identification of the standard layer into a dependency relation array, returning to each layer row which is not determined by the traversing, and calculating the distance between the currently traversed layer row and the determined layer row as well as the boundary of the standard interface until all layer rows are traversed;
after determining a target layer row, the target layer row can be traversed, if the currently traversed target layer row only comprises a standard layer, the identification of the standard layer is added into the dependency relationship array, each layer row which is not determined by the traversing is returned, and the distance between the currently traversed layer row and the determined layer row as well as the boundary of the standard interface is calculated until all layer rows are traversed.
If the currently traversed target layer row only comprises one standard layer, which indicates that the standard layer in the target layer row only belongs to one layer column, the relative position relationship between the standard layer and the standard layer in the traversed layer row can be determined, and then the identification of the standard layer can be added into the dependency relationship array.
The dependency relation array records the mark of the standard layer included in the traversed layer row, and is used for representing the layout relation of each standard layer in the standard interface, namely the up, down, left and right relation of one standard layer and other standard layers in the standard interface. For a standard layer, the location of the standard layer in the interface may depend on the standard layer determination in the dependency array prior to the identification of the standard layer.
S404, if the currently traversed target layer row comprises a plurality of standard layers, determining a layer column to which each standard layer belongs according to the sizes and the positions of the standard layers;
wherein, each standard layer in the layer column has an intersection area with at least one other standard layer after being extended along the longitudinal direction. It should be noted that, the layer columns herein are for the standard layers in the target layer row, and not all the layer columns to which the standard layers belong in the standard interface are determined.
For example, as shown in fig. 5, when the currently traversed target layer behavior includes layer rows of the standard layer a and the standard layer B, the electronic device may determine, according to the sizes and positions of the standard layer a and the standard layer B, that there is no intersection area after the standard layer a and the standard layer B are extended in the longitudinal direction, so that the standard layer a and the standard layer B are divided into two layer columns.
S405, traversing each layer column which is not determined, calculating the distance between the currently traversed layer column and the determined layer column as well as the transverse boundary of the standard interface, and determining the layer column corresponding to the minimum distance as a target layer column;
after each layer column is obtained through division, the electronic device can traverse each layer column which is not determined, calculate the distance between the currently traversed layer column and the determined layer column as well as the transverse boundary of the standard interface, and determine the layer column corresponding to the minimum distance as the target layer column.
When the currently traversed layer column is the first traversed layer column, and no determined layer column exists, only the distance between the layer column and the lateral boundary of the standard interface may be calculated. Further, the electronic device may determine a column having a smallest spacing from a lateral boundary of the standard interface among all the layer columns as the first target layer column.
When determining the second target layer column, the electronic device may calculate the distance between the currently undetermined layer column and the first target layer column and the lateral boundary of the standard interface, further determine the layer column corresponding to the minimum distance as the second target layer column, and so on, may determine the order of all layer columns.
S406, traversing the target layer column, if the target layer column only comprises one standard layer, adding the identification of the standard layer into a dependency relation array, returning to each layer column which is not determined by the traversing, and calculating the distance between the currently traversed layer column and the determined layer column as well as the boundary of the standard interface until all layer columns are traversed;
after determining a target layer column, the target layer column can be traversed, if the target layer column only comprises a standard layer, the identification of the standard layer is added into the dependency relationship array, each layer column which is not determined by the traversing is returned, and the distance between the currently traversed layer column and the determined layer column and the boundary of the standard interface is calculated until all layer columns are traversed.
For example, as shown in fig. 5, when traversing the layer row to which the standard layer C-standard layer G belongs, the distance between the standard layer C-standard layer G and the lateral boundary of the parent layer is calculated, and since the distance between the standard layer G and the right boundary of the parent layer is the smallest, the column in which the standard layer G is located is the first target layer column, and the target layer column is traversed, and since the target layer column includes only one target layer G, the identification of the standard layer G can be added to the dependency relationship array. The current dependent array is (A, B), then the dependent array is (A, B, G) after addition.
S407, if the target layer column comprises a plurality of standard layers, returning to the step of determining the layer row to which each standard layer belongs according to the size and the position of each standard layer until all layer columns corresponding to the target layer row are traversed.
If the currently traversed target layer column includes a plurality of standard layers, illustrating that the standard layers in the target layer column may belong to a plurality of layer rows, in order to determine the positional relationship between the plurality of standard layers and the standard layers in the traversed layer column and layer row, the electronic device may return to the step of determining the layer row to which each standard layer belongs according to the size and the position of each standard layer.
That is, the electronic device may divide the layer row to which the standard layer belongs according to the size and the position of the currently traversed target layer column including a plurality of standard layers, for example, as shown in fig. 5, for the target layer column including the standard layer D and the standard layer E, the standard layer D and the standard layer E may be respectively divided into different layer rows according to the size and the position of the standard layer D and the standard layer E.
Next, the electronic device may traverse each layer row that is not determined, calculate a distance between the currently traversed layer row and the determined layer row and a longitudinal boundary of the standard interface, and determine a layer row corresponding to the minimum distance as a target layer row. It should be noted that, each layer row that is not currently determined is a layer row included in the currently traversed target column, for example, a layer row to which the standard layer D and the standard layer E shown in fig. 5 respectively belong.
Furthermore, the electronic device may perform the processing according to the above steps until the layer row or layer column obtained by dividing does not include multiple standard layers, so as to obtain a final dependency array. That is, the electronic device may determine the layout relationship of the standard layers in the standard interface in a row-column staggered manner.
For example, as shown in fig. 5, when traversing the layer columns of the standard layer D and the standard layer E, since the standard layer D and the standard layer E respectively belong to two layer rows, the electronic device may determine the current target layer row according to the distance between the standard layer D and the standard layer E and the determined longitudinal boundaries of the layer row and the parent layer respectively, and since the upper boundaries of the standard layer D and the standard layer C are the same, the distance between the second row in the layer row determined by the standard layer D, that is, the layer row where the second row is located is 0, is the smallest, so that the standard layer D is the current target layer row, and the electronic device may traverse the target layer row, and since only the standard layer D is included therein, the identifier of the standard layer D may be added to the dependency array to obtain the dependency array as (a, B, G, F, C, D).
Then, the electronic device may traverse the layer row where the standard layer E is located, and since only the standard layer E is included therein, the identifier of the standard layer E may be added to the dependency relationship array, so as to obtain the dependency relationship array as (a, B, G, F, C, D, E).
If the layer row where the standard layer E is located includes a plurality of standard layers, then the step S404 is continued until all the identifiers of the standard layers are added to the dependency array.
In the above process, the layer rows and layer columns may be exchanged, that is, in step S401, the layer column to which each standard layer belongs may be determined according to the size and position of each standard layer, and in step S402-step S407, it is reasonable to replace the layer row with the layer column and replace the layer column with the layer row, which is not described again because of the consistent specific implementation manner.
Accordingly, the step of determining the adjacent layer of each standard layer and the distance between each standard layer and the corresponding adjacent layer according to the layout relationship may include:
step A: traversing each mark in the dependency relation array in sequence, and determining the horizontal and longitudinal distances between a standard layer corresponding to the currently traversed mark and a layer with a determined distance when traversing one mark;
After traversing all the layer rows and layer columns in the above manner, a final dependency array can be determined, and the sequence of each identifier in the dependency array characterizes the dependency of each standard layer in the standard interface on the position. And the electronic device can sequentially traverse each identifier in the dependency relationship array to determine the corresponding distance of each standard layer.
Specifically, each time an identifier is traversed, the distance between the standard layer corresponding to the currently traversed identifier and the layer with the determined distance in the transverse direction and the longitudinal direction is determined. When the currently traversed mark is the first mark, at this time, there may not be a layer with a determined distance, so the electronic device may determine the distance corresponding to the first mark according to the following manner: the distance between the boundary of the standard image layer and the standard interface in the horizontal direction and the vertical direction can be used as the corresponding interval; the calculation datum line can also be preset, and the distance between the standard image layer and the calculation datum line is used as the corresponding distance; the distance between the standard layer and the boundary of the layer (parent layer) with the largest area in the horizontal direction and the vertical direction can be taken as the corresponding distance, which is reasonable.
When the horizontal and vertical distances between the standard layer corresponding to the currently traversed mark and the layer with the determined distance are determined, the horizontal and vertical distances between the standard layer corresponding to the currently traversed mark and all layers with the determined distance can be calculated, and the horizontal and vertical distances between the standard layer corresponding to the currently traversed mark and the preset number of layers with the determined distance can also be calculated, which is not particularly limited.
And (B) step (B): determining the corresponding horizontal and longitudinal layers with the minimum spacing as adjacent layers of the standard layers corresponding to the currently traversed mark, determining the minimum spacing as the spacing between the standard layers and the adjacent layers, and determining the standard layers as the layers with the determined spacing;
after the horizontal and vertical distances are obtained, the electronic device can determine the corresponding layer with the smallest horizontal and vertical distances as the adjacent layer of the standard layer corresponding to the currently traversed mark, determine the smallest distance as the distance between the standard layer and the adjacent layer, and determine that the standard layer is the layer with the determined distance.
For example, the dependency relationship array corresponding to the standard interface shown in fig. 5 is (a, B, G, F, C, D, E). When traversing the identifier D, the layers with the currently determined pitches are the standard layer a, the standard layer B, the standard layer G, the standard layer E and the standard layer C, respectively, and then the electronic device calculates the horizontal 5 pitches and the vertical 5 pitches.
If the minimum distance between the standard layer D and the standard layer C in the transverse direction is the standard layer C, the adjacent layer of the standard layer D in the transverse direction can be determined to be the standard layer C, and the distance between the standard layer D and the standard layer C in the transverse direction is determined to be the distance between the standard layer D and the standard layer C. If the distance between the standard layer D and the standard layer A in the longitudinal direction is the minimum, the adjacent layer of the standard layer D in the longitudinal direction can be determined to be the standard layer A, and the distance is the distance between the standard layer D and the standard layer A in the longitudinal direction.
Step C: and continuing to traverse the next mark, and returning to the step of determining the distance between the standard layer corresponding to the mark currently traversed and the layer with the determined distance in the horizontal direction and the vertical direction until all mark traversals are finished.
And then, the electronic equipment can continue to traverse the next mark, and return to the step of determining the distances between the standard layers corresponding to the mark traversed currently and the layers with determined distances in the horizontal direction and the vertical direction until all mark traversal is finished, and then the adjacent layers and the corresponding distances of all standard layers are determined.
Therefore, in this embodiment, the electronic device may accurately determine the adjacent layers of the standard layers in the horizontal direction and the vertical direction and the distances between the adjacent layers by adopting the above method, so that no manual measurement is required, and acceptance efficiency of the application program interface may be improved.
As an implementation manner of the embodiment of the present invention, the step of obtaining attribute information of each layer to be inspected in the interface to be inspected and obtaining attribute information of each standard layer in the standard interface may include:
calling a preset view interface, and extracting attribute information of each layer to be checked in the interface to be checked; analyzing each standard layer in the standard interface to obtain attribute information of each standard layer in the standard interface.
Because the interface to be checked is a developed executable application program interface, the electronic equipment can call the preset view interface to extract the attribute information of each layer to be checked in the interface to be checked. The preset view interface may be any interface capable of providing a function of analyzing attribute information of a layer in the interface, which is not specifically limited herein.
The standard interface is an interface in a design draft, which is a draft drawn by a design institute and used for guiding development, and is generally a file in the formats of psd, sketch and the like, so that attribute information of a standard layer in the standard interface cannot be extracted through a preset view interface. In order to obtain the attribute information of the standard layers, the electronic device may analyze each standard layer in the standard interface through image processing software or the like, so as to obtain the attribute information of each standard layer in the standard interface. The image processing software may be PhotoShop, sketch, figma or the like, and is not particularly limited herein.
It can be seen that, in this embodiment, the electronic device may call the preset view interface, extract attribute information of each layer to be checked in the interface to be checked, and parse each standard layer in the standard interface to obtain attribute information of each standard layer in the standard interface. Thus, the attribute information of the image layer can be accurately obtained for the interface to be checked or the standard interface.
As an implementation manner of the embodiment of the present invention, before the step of obtaining the attribute information of each layer to be inspected in the interface to be inspected, the method may further include:
acquiring operation condition parameters of an interface to be checked of an application program, and configuring an operation environment based on the operation condition parameters; and starting the application program based on the running environment, and entering the interface to be checked.
When starting to check, the check person can input operation condition parameters of the interface to be checked, wherein the operation condition parameters can comprise an entering path of the interface to be checked, a testing environment configuration parameter of the interface to be checked and the like. Furthermore, the electronic equipment can acquire the operation condition parameters input by the acceptance personnel, and the operation environment is configured through the automatic test script based on the operation condition parameters.
Then, an application program can be started based on the configured running environment, an interface to be checked is entered, and then attribute information of each layer to be checked in the interface to be checked is obtained, so that other checking operations can be continuously executed.
It can be seen that, in this embodiment, the electronic device may obtain an operation condition parameter of an interface to be checked of the application program, configure an operation environment based on the operation condition parameter, and then start the application program based on the operation environment, and enter the interface to be checked. The manual operation of an acceptance person is not needed in the process of configuring the running environment and entering the interface to be accepted after the application program is started, so that the automation degree and the efficiency of the acceptance of the application program interface are further improved.
As an implementation manner of the embodiment of the present invention, in order to further improve the acceptance efficiency of the application program interface, before the step of determining the correspondence between each layer to be accepted and each standard layer based on the size, the position and the type of each layer to be accepted and each standard layer, the method may further include:
and carrying out layer processing on each layer to be checked and accepted and each standard layer by adopting at least one of the following modes:
The first way is: and determining a redundant layer according to the patterns and the sizes of each layer to be checked and each standard layer, and removing the redundant layer.
Since there may be some redundant layers in each layer to be accepted and each standard layer, for example, a layer with a transparency of 100%, a layer completely covered by other layers, etc., which are not visually visible to the user when the application interface is displayed in the screen of the electronic device, the redundant layers are removed to improve the acceptance efficiency.
The first way is: and aiming at the layers to be checked and accepted and the standard layers with the text types, adjusting the heights of the layers with the same word size to be the same height.
Because the height of each layer can influence the calculation of the distance between the layers, in order to facilitate the subsequent calculation of the distance between the layers and ensure the accuracy of the distance calculation result, for the layers to be checked and accepted which are of the text type and the standard layers, the electronic equipment can adjust the heights of the layers with the same word size of the included words to the same height.
Third mode: for a plurality of layers belonging to the same icon, the plurality of layers are combined into one layer.
In the standard interface corresponding to the design draft, some icons are composed of a plurality of layers, which are basically one layer corresponding to the icon, so that a plurality of layers belonging to the same icon can be combined into one layer for convenience of processing.
Therefore, in this embodiment, the electronic device may perform layer processing on the layer to be checked and the standard layer in at least one of the three ways, so that the checking efficiency of the application program interface and the accuracy of the checking result may be further improved.
As an implementation manner of the embodiment of the present invention, the method may further include:
intercepting an image of the interface to be checked; and displaying the acceptance result and the image.
In order to facilitate the acceptance person to check the acceptance result, the electronic equipment can also intercept the image of the interface to be accepted, and then display the image while displaying the acceptance result. In one embodiment, the image may be marked with a layer to be checked that fails in the result of checking, so that the checking person can quickly locate the layer to be checked that fails in the result of checking.
Therefore, in this embodiment, the electronic device may further intercept the image of the interface to be checked and display the result and the image of the interface to be checked, so that the checking and accepting person may check the result conveniently and locate the layer to be checked that fails to pass the check and accepting quickly.
As an implementation manner of the embodiment of the present invention, after the step of obtaining the attribute information of each layer to be inspected in the interface to be inspected and obtaining the attribute information of each standard layer in the standard interface, the method may further include:
displaying the interface to be checked and the standard interface; when capturing a click operation, displaying attribute information of a layer to be checked corresponding to the click operation and attribute information of a standard layer; when the checking operation is captured, recording attribute information corresponding to the checking operation, and generating a checking result.
After the electronic device obtains the attribute information of each layer to be checked and the attribute information of each standard layer, the interface to be checked and the standard interface can be displayed, and at the moment, the checking person can click the layer to be checked and the standard layer to be compared. When the electronic equipment captures the clicking operation, the attribute information of the layer to be checked corresponding to the clicking operation and the attribute information of the standard layer are displayed.
Furthermore, the acceptance can quickly check the attribute information of the layer to be accepted and the attribute information of the standard layer, further determine whether the attribute information and the attribute information are consistent, and if wrong attribute information exists, the attribute information can be checked, and the electronic equipment can store the checked attribute information.
For example, the electronic device displays the to-be-inspected interface and the standard interface, at which point the inspected person clicks on the to-be-inspected layer and the standard layer that are desired to be compared. When the clicking operation is captured by the electronic equipment, an attribute information comparison interface shown in fig. 6 can be displayed, so that an acceptance person can quickly check whether the attribute information of the layer to be accepted is consistent with the attribute information of the standard layer. The attribute information comparison interface may display attribute information such as width, height, font size, shadow, etc. of the layer to be checked corresponding to the clicking operation in the development manuscript (interface to be checked), which is not limited herein.
It can be seen that, in this embodiment, the electronic device may display the interface to be accepted and the standard interface; when a clicking operation is captured, the attribute information of the layer to be checked corresponding to the clicking operation and the attribute information of the standard layer are displayed, and further when a checking operation is captured, the attribute information corresponding to the checking operation is recorded, and a checking result is generated. Therefore, the acceptance personnel only need to check the attribute information, the attribute information is not required to be acquired in a manual measurement mode, and the acceptance efficiency of the application program interface can be improved.
Corresponding to the acceptance method of the application program interface, the embodiment of the invention also provides an acceptance device of the application program interface. The following describes an acceptance device of an application program interface provided by the embodiment of the invention.
As shown in fig. 7, an acceptance device of an application program interface, the device comprising:
the attribute information obtaining module 710 is configured to obtain attribute information of each layer to be checked in the interface to be checked, and obtain attribute information of each standard layer in the standard interface;
the standard interface is an interface defined by a design draft corresponding to the interface to be checked, and the attribute information comprises size, position, type and style.
The correspondence determining module 720 is configured to determine a correspondence between each layer to be checked and each standard layer based on the sizes, positions, and types of each layer to be checked and each standard layer;
a first interval determining module 730, configured to determine, according to the size and the position of each standard layer, an adjacent layer of each standard layer and an interval between each standard layer and a corresponding adjacent layer;
the second interval determining module 740 is configured to determine, according to the correspondence and the size and the position of each layer to be inspected, an adjacent layer of each layer to be inspected and an interval between each layer to be inspected and the corresponding adjacent layer;
And the layer acceptance module 750 is configured to compare, for each layer to be accepted, the pattern and the pitch of the layer to be accepted with the pattern and the pitch of the corresponding standard layer based on the correspondence, and determine an acceptance result of each layer to be accepted.
In the solution provided in the embodiment of the present invention, the electronic device may obtain attribute information of each layer to be inspected in the interface to be inspected, and obtain attribute information of each layer to be inspected in the standard interface, where the standard interface is an interface in a design draft corresponding to each layer to be inspected, the attribute information includes a size, a position, a type, and a style, based on each layer to be inspected and the size, the position, and the type of each layer to be inspected, determine a correspondence between each layer to be inspected and each layer to be inspected, determine a distance between each layer to be inspected and each layer to be inspected according to the size and the position of each layer to be inspected, and further determine a distance between each layer to be inspected and each layer to be inspected according to the correspondence and the size and the position of each layer to be inspected, and the style and the distance of each layer to be inspected and the corresponding layer to be inspected are respectively compared with the style and the distance of each layer to be inspected based on the correspondence, and each layer to be inspected result is determined. Because the patterns and the distances of all the layers in the interface to be checked and the standard interface are not required to be measured manually, and the interface to be checked and the interface corresponding to the design draft are not required to be compared manually, the checking and accepting efficiency of the application program interface can be greatly improved.
As shown in fig. 8, as an implementation manner of the embodiment of the present invention, the correspondence determining module 720 may include:
the layer ordering unit 721 is configured to order the layers to be checked according to the positions of the layers to be checked and a preset ordering rule, so as to obtain an ordering result;
the correspondence determining unit 722 is configured to traverse each layer to be checked according to the sorting result, and calculate, when traversing one layer to be checked, a matching degree between the currently traversed layer to be checked and each currently unmatched standard layer according to types and positions of each layer to be checked and each standard layer;
determining a standard layer matched with the currently traversed layer to be checked based on the matching degree, recording the corresponding relation between the currently traversed layer to be checked and the standard layer, and determining that the standard layer is matched;
and continuing to traverse the next layer to be checked, returning to calculate the matching degree between the currently traversed layer to be checked and each unmatched standard layer according to the types and the positions of the layers to be checked and the standard layers until the traversal of all the layers to be checked is finished, and obtaining the corresponding relation between the layers to be checked and the standard layers.
As an implementation manner of the embodiment of the present invention, the foregoing apparatus may further include:
the adjacent layer determining module is used for determining the adjacent layer of each standard layer according to the position of each standard layer before traversing each layer to be checked according to the sequencing result;
the matching degree calculation unit may include:
the adjacent layer determining subunit is used for determining the adjacent layers of the currently traversed layer to be checked according to the positions of the layers to be checked;
and the matching degree calculating subunit is used for respectively calculating the matching degree between the currently traversed layer to be checked and each currently unmatched standard layer based on the type of the currently traversed layer to be checked and the adjacent layer and the type of each currently unmatched standard layer and the adjacent layer.
As an implementation manner of the embodiment of the present invention, the first pitch determining module 730 may include:
the layout relation determining unit is used for determining a layer row and/or a layer column to which each standard layer belongs according to the size and the position of each standard layer, and determining the layout relation of each standard layer in the standard interface based on the layer row and/or the layer column to which each standard layer belongs;
And each standard layer in the layer row has an intersection area with at least one other standard layer after being expanded along the transverse direction, and each standard layer in the layer column has an intersection area with at least one other standard layer after being expanded along the longitudinal direction.
And the distance determining unit is used for determining adjacent layers of each standard layer and the distance between each standard layer and the corresponding adjacent layer according to the layout relation.
As one implementation of the embodiment of the present invention, the above-described layout relationship determining unit may include:
the layer row and column dividing subunit is used for determining the layer row to which each standard layer belongs according to the size and the position of each standard layer;
the target line determining subunit is used for traversing each undetermined layer line, calculating the distance between the currently traversed layer line and the determined layer line and the longitudinal boundary of the standard interface, and determining the layer line corresponding to the minimum distance as the target layer line;
a layer line traversing subunit, configured to traverse the target layer line, if the target layer line includes only one standard layer, add the identifier of the standard layer to the dependency relationship array, return to each layer line that is not determined by the traversing, and calculate the distance between the currently traversed layer line and the determined layer line and the boundary of the standard interface until all layer lines traverse; if the target layer row comprises a plurality of standard layers, determining a layer column to which each standard layer belongs according to the sizes and the positions of the standard layers, wherein the dependency relation array records the mark of the standard layer which is included in the traversed layer row and is used for representing the layout relation of each standard layer in the standard interface;
A target column determining subunit, configured to traverse each layer column that is not determined, calculate a distance between the currently traversed layer column and the determined layer column and a lateral boundary of the standard interface, and determine a layer column corresponding to the minimum distance as a target layer column;
a layer column traversing subunit, configured to traverse the target layer column, if the target layer column includes only one standard layer, add the identifier of the standard layer to the dependency relationship array, return to each layer column that is not determined by the traversing, and calculate the distance between the currently traversed layer column and the determined layer column and the boundary of the standard interface until all layer columns are traversed; if the target layer column comprises a plurality of standard layers, returning to the step of determining the layer row to which each standard layer belongs according to the size and the position of each standard layer until all layer columns corresponding to the target layer row are traversed;
the above-described pitch determination unit may include:
the mark traversing subunit is used for traversing each mark in the dependency relation array in sequence, and determining the distance between the standard layer corresponding to the currently traversed mark and the determined layer in the transverse direction and the longitudinal direction when traversing one mark each time; determining the corresponding layer with the minimum horizontal and longitudinal distances as the adjacent layer of the standard layer corresponding to the currently traversed mark, determining the minimum distance as the distance between the standard layer and the adjacent layer, and determining the standard layer as the determined layer; and continuing traversing the next mark, and returning to the step of determining the distance between the standard layer corresponding to the currently traversed mark and the determined layer in the transverse direction and the longitudinal direction until all mark traversals are finished.
As one implementation of the embodiment of the present invention, the attribute information obtaining module 710 may include:
the first attribute information determining unit is used for calling a preset view interface and extracting attribute information of each layer to be checked in the interface to be checked;
and the second attribute information determining unit is used for analyzing each standard layer in the standard interface to obtain the attribute information of each standard layer in the standard interface.
As an implementation manner of the embodiment of the present invention, the foregoing apparatus may further include:
the running environment configuration module is used for acquiring running condition parameters of the to-be-checked interface of the application program before the attribute information of each to-be-checked layer in the to-be-checked interface is acquired, and configuring a running environment based on the running condition parameters;
and the application program starting module is used for starting the application program based on the running environment and entering the interface to be checked.
As an implementation manner of the embodiment of the present invention, the foregoing apparatus may further include:
the layer processing module is configured to perform layer processing on each layer to be inspected and each standard layer by adopting at least one of the following ways before determining the correspondence between each layer to be inspected and each standard layer based on the sizes, positions and types of each layer to be inspected and each standard layer:
Determining a redundant layer according to the patterns and the sizes of each layer to be checked and each standard layer, and removing the redundant layer; or alternatively, the first and second heat exchangers may be,
aiming at the layers to be checked and accepted and the standard layers with the text type, adjusting the heights of the layers with the same character size of the included characters to be the same height; or alternatively, the first and second heat exchangers may be,
for a plurality of layers belonging to the same icon, the plurality of layers are combined into one layer.
As an implementation manner of the embodiment of the present invention, the foregoing apparatus may further include:
the image intercepting module is used for intercepting the image of the interface to be checked;
and the result display module is used for displaying the acceptance result and the image.
As an implementation manner of the embodiment of the present invention, the foregoing apparatus may further include:
the interface display module is used for displaying the interface to be checked and the standard interface after the attribute information of each layer to be checked in the interface to be checked is obtained and the attribute information of each standard layer in the standard interface is obtained;
the attribute information display module is used for displaying attribute information of a layer to be checked corresponding to the clicking operation and attribute information of a standard layer when the clicking operation is captured;
And the acceptance result generation module is used for recording attribute information corresponding to the checking operation when the checking operation is captured, and generating an acceptance result.
The embodiment of the present invention also provides an electronic device, as shown in fig. 9, including a processor 901, a communication interface 902, a memory 903, and a communication bus 904, where the processor 901, the communication interface 902, and the memory 903 perform communication with each other through the communication bus 904,
a memory 903 for storing a computer program;
the processor 901 is configured to implement the steps of the acceptance method of the application program interface according to any one of the embodiments when executing the program stored in the memory 903.
In the solution provided in the embodiment of the present invention, the electronic device may obtain attribute information of each layer to be inspected in the interface to be inspected, and obtain attribute information of each layer to be inspected in the standard interface, where the standard interface is an interface defined by a design draft corresponding to the interface to be inspected, the attribute information includes a size, a position, a type, and a style, based on the sizes, the positions, and the types of each layer to be inspected and each layer to be inspected, determine a correspondence between each layer to be inspected and a distance between each layer to be inspected and each layer to be inspected according to the sizes and the positions of each layer to be inspected, and further determine a distance between each layer to be inspected and each layer to be inspected according to the correspondence and the sizes and the positions of each layer to be inspected, and the style and the distance of each layer to be inspected and the corresponding layer to be inspected are compared with the style and the distance of each layer to be inspected and each layer to be inspected based on the correspondence, and each layer to be inspected result is determined. Because the patterns and the distances of all the layers in the interface to be checked and the standard interface are not required to be measured manually, and the interface to be checked and the interface corresponding to the design draft are not required to be compared manually, the checking and accepting efficiency of the application program interface can be greatly improved.
The communication bus mentioned by the above electronic device may be a peripheral component interconnect standard (Peripheral Component Interconnect, abbreviated as PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, abbreviated as EISA) bus, or the like. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The memory may include random access memory (Random Access Memory, RAM) or non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one cache device located remotely from the processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but also digital signal processors (Digital Signal Processing, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field-programmable gate arrays (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In yet another embodiment of the present invention, a computer readable storage medium is provided, in which instructions are cached, which when executed on a computer, cause the computer to perform the steps of the method for validating an application program interface according to any one of the above embodiments.
It can be seen that, in the solution provided in the embodiment of the present invention, when the instructions cached in the computer readable storage medium run on the computer, the instructions can obtain attribute information of each layer to be inspected in the interface to be inspected, and obtain attribute information of each layer to be inspected in the standard interface, where the standard interface is an interface defined by a design draft corresponding to the interface to be inspected, the attribute information includes a size, a position, a type and a style, and based on the sizes, the positions and the types of each layer to be inspected and each layer to be inspected, the correspondence between each layer to be inspected and each layer to be inspected is determined, determining the adjacent layers of each standard layer and the distance between each standard layer and the corresponding adjacent layer according to the size and the position of each standard layer, further determining the adjacent layers of each layer to be checked and the distance between each layer to be checked and the corresponding adjacent layer according to the corresponding relation and the size and the position of each layer to be checked, and comparing the pattern and the distance of each layer to be checked with the pattern and the distance of the corresponding standard layer based on the corresponding relation for each layer to be checked, so as to determine the checking result of each layer to be checked. Because the patterns and the distances of all the layers in the interface to be checked and the standard interface are not required to be measured manually, and the interface to be checked and the interface corresponding to the design draft are not required to be compared manually, the checking and accepting efficiency of the application program interface can be greatly improved.
In yet another embodiment of the present invention, there is also provided a computer program product containing instructions that, when run on a computer, cause the computer to perform the steps of the acceptance method of the application interface of any of the above embodiments.
It can be seen that, in the solution provided in the embodiment of the present invention, when the computer program product runs on a computer, attribute information of each layer to be inspected in the interface to be inspected and attribute information of each layer to be inspected in the standard interface are obtained, where the standard interface is an interface defined by a design draft corresponding to the interface to be inspected, the attribute information includes a size, a position, a type and a style, based on the sizes, the positions and the types of each layer to be inspected and each layer to be inspected, a correspondence between each layer to be inspected and each layer to be inspected is determined, a distance between an adjacent layer of each layer to be inspected and each layer to be inspected to the corresponding layer to be inspected is determined according to the sizes and the positions of each layer to be inspected and the corresponding adjacent layer to be inspected, and the distance between each layer to be inspected and the corresponding layer to be inspected is determined according to the correspondence, and the style and the distance between each layer to be inspected and the corresponding layer to be inspected is determined. Because the patterns and the distances of all the layers in the interface to be checked and the standard interface are not required to be measured manually, and the interface to be checked and the interface corresponding to the design draft are not required to be compared manually, the checking and accepting efficiency of the application program interface can be greatly improved.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be cached in or transmitted from one computer-readable cache medium to another, for example, by wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means from one website, computer, server, or data center. The computer readable cache medium may be any available medium that can be accessed by a computer or a data caching device such as a server, data center, etc. that contains one or more integration of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the apparatus, electronic device, computer readable storage medium, and computer program product embodiments, the description is relatively simple, as relevant to the method embodiments being referred to in the section of the description of the method embodiments.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (13)

1. A method of acceptance of an application program interface, the method comprising:
acquiring attribute information of each layer to be checked in an interface to be checked, and acquiring attribute information of each standard layer in a standard interface, wherein the standard interface is defined by a design draft corresponding to the interface to be checked, and the attribute information comprises size, position, type and style;
determining the corresponding relation between each layer to be checked and each standard layer based on the sizes, positions and types of each layer to be checked and each standard layer;
determining adjacent layers of each standard layer and the distance between each standard layer and the corresponding adjacent layer according to the size and the position of each standard layer;
determining adjacent layers of each layer to be checked and the distance between each layer to be checked and the corresponding adjacent layer according to the corresponding relation and the size and the position of each layer to be checked;
And comparing the pattern and the interval of each layer to be checked with the pattern and the interval of the corresponding standard layer respectively based on the corresponding relation to determine the checking result of each layer to be checked.
2. The method of claim 1, wherein the step of determining the correspondence between each layer to be inspected and each standard layer based on the size, location, and type of each layer to be inspected and each standard layer comprises:
sequencing each layer to be checked according to the position of each layer to be checked and a preset sequencing rule to obtain a sequencing result;
traversing each layer to be checked according to the sequencing result, and calculating the matching degree between the currently traversed layer to be checked and each currently unmatched standard layer according to the types and positions of each layer to be checked and each standard layer when traversing one layer to be checked;
determining a standard layer matched with the currently traversed layer to be checked based on the matching degree, recording the corresponding relation between the currently traversed layer to be checked and the standard layer, and determining that the standard layer is matched;
And continuing to traverse the next layer to be checked, returning to the step of calculating the matching degree between the currently traversed layer to be checked and each unmatched standard layer according to the types and the positions of the layers to be checked and the standard layers until the traversal of all the layers to be checked is finished, and obtaining the corresponding relation between the layers to be checked and the standard layers.
3. The method of claim 2, wherein prior to the step of traversing the layers to be accepted in accordance with the ranking result, the method further comprises:
determining adjacent layers of each standard layer according to the positions of the standard layers;
the step of calculating the matching degree between the currently traversed layer to be checked and each currently unmatched standard layer according to the types and positions of the layers to be checked and the standard layers comprises the following steps:
determining adjacent layers of the currently traversed layers to be checked according to the positions of the layers to be checked;
and respectively calculating the matching degree between the currently traversed layer to be checked and each currently unmatched standard layer based on the type of the currently traversed layer to be checked and the adjacent layers and the type of each currently unmatched standard layer and the adjacent layers.
4. The method of claim 1, wherein the step of determining adjacent layers of each standard layer and the spacing between each standard layer and the corresponding adjacent layer based on the size and position of each standard layer comprises:
determining a layer row and/or a layer column to which each standard layer belongs according to the size and the position of each standard layer, and determining the layout relation of each standard layer in the standard interface based on the layer row and/or the layer column to which each standard layer belongs, wherein each standard layer in the layer row has an intersection area with at least one other standard layer after being transversely expanded, and each standard layer in the layer column has an intersection area with at least one other standard layer after being longitudinally expanded;
and determining adjacent layers of each standard layer and the distance between each standard layer and the corresponding adjacent layer according to the layout relation.
5. The method of claim 4, wherein the step of determining the layer row and/or layer column to which each standard layer belongs according to the size and the position of each standard layer, and determining the layout relationship of each standard layer in the standard interface based on the layer row and/or layer column to which each standard layer belongs comprises:
Determining a layer row to which each standard layer belongs according to the size and the position of each standard layer;
traversing each layer line which is not determined, calculating the distance between the layer line which is currently traversed and the determined layer line as well as the longitudinal boundary of the standard interface, and determining the layer line corresponding to the minimum distance as a target layer line;
traversing the target layer row, if the target layer row only comprises one standard layer, adding the identification of the standard layer into a dependency relation array, returning to each layer row which is not determined by traversing, and calculating the distance between the currently traversed layer row and the determined layer row as well as the boundary of the standard interface until all layer rows are traversed, wherein the identification of the standard layer which is included in the traversed layer row is recorded in the dependency relation array and is used for representing the layout relation of each standard layer in the standard interface;
if the target layer row comprises a plurality of standard layers, determining a layer column to which each standard layer belongs according to the sizes and the positions of the standard layers;
traversing each layer column which is not determined, calculating the distance between the currently traversed layer column and the determined layer column as well as the transverse boundary of the standard interface, and determining the layer column corresponding to the minimum distance as a target layer column;
Traversing the target layer column, if the target layer column only comprises one standard layer, adding the identification of the standard layer into a dependency relation array, returning to each layer column which is not determined by the traversing, and calculating the distance between the currently traversed layer column and the determined layer column and the boundary of the standard interface until all layer columns are traversed;
if the target layer column comprises a plurality of standard layers, returning to the step of determining the layer row to which each standard layer belongs according to the size and the position of each standard layer until all layer columns corresponding to the target layer row are traversed;
the step of determining the adjacent layers of each standard layer and the distance between each standard layer and the corresponding adjacent layer according to the layout relation comprises the following steps:
traversing each mark in the dependency relation array in sequence, and determining the distance between the standard layer corresponding to the currently traversed mark and the determined layer in the transverse direction and the longitudinal direction when traversing one mark;
determining the corresponding layer with the minimum horizontal and longitudinal distances as the adjacent layer of the standard layer corresponding to the currently traversed mark, determining the minimum distance as the distance between the standard layer and the adjacent layer, and determining the standard layer as the determined layer;
And continuing traversing the next mark, and returning to the step of determining the distance between the standard layer corresponding to the currently traversed mark and the determined layer in the transverse direction and the longitudinal direction until all mark traversals are finished.
6. The method of claim 1, wherein the step of obtaining attribute information of each layer to be accepted in the interface to be accepted and obtaining attribute information of each layer to be accepted in the standard interface comprises:
calling a preset view interface, and extracting attribute information of each layer to be checked in the interface to be checked;
analyzing each standard layer in the standard interface to obtain attribute information of each standard layer in the standard interface.
7. The method of claim 1, wherein prior to the step of obtaining attribute information for each layer to be accepted in the interface to be accepted, the method further comprises:
acquiring operation condition parameters of an interface to be checked of an application program, and configuring an operation environment based on the operation condition parameters;
and starting the application program based on the running environment, and entering the interface to be checked.
8. The method of any of claims 1-6, wherein prior to the step of determining the correspondence of the layers to be inspected to the standard layers based on the sizes, locations, and types of the layers to be inspected and the standard layers, the method further comprises:
And carrying out layer processing on each layer to be checked and accepted and each standard layer by adopting at least one of the following modes:
determining a redundant layer according to the patterns and the sizes of each layer to be checked and each standard layer, and removing the redundant layer; or alternatively, the first and second heat exchangers may be,
aiming at the layers to be checked and accepted and the standard layers with the text type, adjusting the heights of the layers with the same character size of the included characters to be the same height; or alternatively, the first and second heat exchangers may be,
for a plurality of layers belonging to the same icon, the plurality of layers are combined into one layer.
9. An acceptance device of an application program interface, the device comprising:
the system comprises an attribute information acquisition module, a storage module and a storage module, wherein the attribute information acquisition module is used for acquiring attribute information of each layer to be checked in an interface to be checked and acquiring attribute information of each standard layer in a standard interface, wherein the standard interface is an interface defined by a design draft corresponding to the interface to be checked and comprises a size, a position, a type and a style;
the corresponding relation determining module is used for determining the corresponding relation between each layer to be checked and each standard layer based on the sizes, the positions and the types of each layer to be checked and each standard layer;
The first interval determining module is used for determining adjacent layers of each standard layer and intervals between each standard layer and the corresponding adjacent layers according to the sizes and the positions of the standard layers;
the second interval determining module is used for determining adjacent layers of each layer to be checked and the interval between each layer to be checked and the corresponding adjacent layer according to the corresponding relation and the size and the position of each layer to be checked;
and the layer acceptance module is used for comparing the pattern and the interval of each layer to be accepted with the pattern and the interval of the corresponding standard layer respectively based on the corresponding relation to determine the acceptance result of each layer to be accepted.
10. The apparatus of claim 9, wherein the correspondence determination module comprises:
the layer ordering unit is used for ordering the layers to be checked according to the positions of the layers to be checked and a preset ordering rule to obtain an ordering result;
the corresponding relation determining unit is used for traversing each layer to be checked according to the sequencing result, and calculating the matching degree between the currently traversed layer to be checked and each currently unmatched standard layer according to the types and positions of each layer to be checked and each standard layer when one layer to be checked is traversed;
Determining a standard layer matched with the currently traversed layer to be checked based on the matching degree, recording the corresponding relation between the currently traversed layer to be checked and the standard layer, and determining that the standard layer is matched;
and continuing to traverse the next layer to be checked, returning to calculate the matching degree between the currently traversed layer to be checked and each unmatched standard layer according to the types and the positions of the layers to be checked and the standard layers until the traversal of all the layers to be checked is finished, and obtaining the corresponding relation between the layers to be checked and the standard layers.
11. The apparatus of claim 9, wherein the first spacing determination module comprises:
the layout relation determining unit is used for determining a layer row and/or a layer column to which each standard layer belongs according to the size and the position of each standard layer, and determining the layout relation of each standard layer in the standard interface based on the layer row and/or the layer column to which each standard layer belongs, wherein each standard layer in the layer row has an intersection area with at least one other standard layer after being transversely expanded, and each standard layer in the layer column has an intersection area with at least one other standard layer after being longitudinally expanded;
And the distance determining unit is used for determining adjacent layers of each standard layer and the distance between each standard layer and the corresponding adjacent layer according to the layout relation.
12. The apparatus of claim 11, wherein the layout relation determining unit comprises:
the layer line dividing subunit is used for determining the layer line to which each standard layer belongs according to the size and the position of each standard layer;
the target line determining subunit is used for traversing each undetermined layer line, calculating the distance between the currently traversed layer line and the determined layer line and the longitudinal boundary of the standard interface, and determining the layer line corresponding to the minimum distance as the target layer line;
a layer line traversing subunit, configured to traverse the target layer line, if the target layer line includes only one standard layer, add the identifier of the standard layer to the dependency relationship array, return to each layer line that is not determined by the traversing, and calculate the distance between the currently traversed layer line and the determined layer line and the boundary of the standard interface until all layer lines traverse; if the target layer row comprises a plurality of standard layers, determining a layer column to which each standard layer belongs according to the sizes and the positions of the standard layers, wherein the dependency relation array records the mark of the standard layer which is included in the traversed layer row and is used for representing the layout relation of each standard layer in the standard interface;
A target column determining subunit, configured to traverse each layer column that is not determined, calculate a distance between the currently traversed layer column and the determined layer column and a lateral boundary of the standard interface, and determine a layer column corresponding to the minimum distance as a target layer column;
a layer column traversing subunit, configured to traverse the target layer column, if the target layer column includes only one standard layer, add the identifier of the standard layer to the dependency relationship array, return to each layer column that is not determined by the traversing, and calculate the distance between the currently traversed layer column and the determined layer column and the boundary of the standard interface until all layer columns are traversed; if the target layer column comprises a plurality of standard layers, returning to the step of determining the layer row to which each standard layer belongs according to the size and the position of each standard layer until all layer columns corresponding to the target layer row are traversed;
the pitch determination unit includes:
the mark traversing subunit is used for traversing each mark in the dependency relation array in sequence, and determining the distance between the standard layer corresponding to the currently traversed mark and the determined layer in the transverse direction and the longitudinal direction when traversing one mark each time; determining the corresponding layer with the minimum horizontal and longitudinal distances as the adjacent layer of the standard layer corresponding to the currently traversed mark, determining the minimum distance as the distance between the standard layer and the adjacent layer, and determining the standard layer as the determined layer; and continuing traversing the next mark, and returning to the step of determining the distance between the standard layer corresponding to the currently traversed mark and the determined layer in the transverse direction and the longitudinal direction until all mark traversals are finished.
13. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for carrying out the method steps of any one of claims 1-8 when executing a program stored on a memory.
CN202010760904.XA 2020-07-31 2020-07-31 Acceptance method and device of application program interface and electronic equipment Active CN111881049B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010760904.XA CN111881049B (en) 2020-07-31 2020-07-31 Acceptance method and device of application program interface and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010760904.XA CN111881049B (en) 2020-07-31 2020-07-31 Acceptance method and device of application program interface and electronic equipment

Publications (2)

Publication Number Publication Date
CN111881049A CN111881049A (en) 2020-11-03
CN111881049B true CN111881049B (en) 2024-03-08

Family

ID=73204954

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010760904.XA Active CN111881049B (en) 2020-07-31 2020-07-31 Acceptance method and device of application program interface and electronic equipment

Country Status (1)

Country Link
CN (1) CN111881049B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113485707B (en) * 2021-07-26 2024-06-28 亿览在线网络技术(北京)有限公司 Automatic checking method for UI (user interface)
CN113778905B (en) * 2021-11-10 2022-02-08 腾讯科技(深圳)有限公司 UI design acceptance method, device, equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107015793A (en) * 2016-12-12 2017-08-04 阿里巴巴集团控股有限公司 Design original text adaptation method, apparatus and system
CN108763511A (en) * 2018-05-30 2018-11-06 腾讯科技(深圳)有限公司 Figure layer composition method, device, electronic equipment and storage medium in the page
CN111127543A (en) * 2019-12-23 2020-05-08 北京金山安全软件有限公司 Image processing method, image processing apparatus, electronic device, and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104516891B (en) * 2013-09-27 2018-05-01 北大方正集团有限公司 A kind of printed page analysis method and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107015793A (en) * 2016-12-12 2017-08-04 阿里巴巴集团控股有限公司 Design original text adaptation method, apparatus and system
CN108763511A (en) * 2018-05-30 2018-11-06 腾讯科技(深圳)有限公司 Figure layer composition method, device, electronic equipment and storage medium in the page
CN111127543A (en) * 2019-12-23 2020-05-08 北京金山安全软件有限公司 Image processing method, image processing apparatus, electronic device, and storage medium

Also Published As

Publication number Publication date
CN111881049A (en) 2020-11-03

Similar Documents

Publication Publication Date Title
US11016035B2 (en) Smart defect calibration system and the method thereof
CN111881049B (en) Acceptance method and device of application program interface and electronic equipment
TWI454956B (en) Methods and computer-readable medium for analyzing cells of a cell library
US9430606B2 (en) Failure analysis and inline defect characterization
KR101434827B1 (en) Recipe generating device, inspection assisting device, inspection system, and recording medium
US9836565B2 (en) Electronic design automation method and apparatus thereof
US8826209B2 (en) Automated inline defect characterization
CN113420355B (en) Floor processing method and device and electronic equipment
CN111857703B (en) Method and device for matching layers in interface and electronic equipment
CN108121648B (en) Interface error monitoring method
CN114611452A (en) Method for automatically generating Sub Cell in layout based on circuit schematic diagram
US8086985B2 (en) Automatic alignment of macro cells
CN111338629B (en) Data processing method and device for building tree graph
CN115965646B (en) Region dividing method, device, computer equipment and computer readable storage medium
JP2003086689A (en) Cad tool for failure analysis of semiconductor and failure analysis method of semiconductor
CN111240622A (en) Drawing method and device
CN110398681B (en) Double-strip-line inspection method and related device
US8370790B2 (en) Computer aided design system for checking dimensions of patterns and method
US9753901B1 (en) Identifying important document content using geometries of page elements
CN107992287B (en) Method and device for checking system demand priority ranking result
CN114780433A (en) Wiring detection method and device based on ATE project multi-site
CN114818604B (en) Method and device for correcting short-circuit defects on digital layout
CN117370436B (en) Method and system for quickly rechecking municipal road earthwork quantity
US20220146927A1 (en) Tag coordinate determination method and apparatus, computer-readable medium and electronic device
CN114283437A (en) Legend identification method, device, equipment and storage medium

Legal Events

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