CN113094287B - Page compatibility detection method, device, equipment and storage medium - Google Patents
Page compatibility detection method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN113094287B CN113094287B CN202110518989.5A CN202110518989A CN113094287B CN 113094287 B CN113094287 B CN 113094287B CN 202110518989 A CN202110518989 A CN 202110518989A CN 113094287 B CN113094287 B CN 113094287B
- Authority
- CN
- China
- Prior art keywords
- target
- node
- determining
- page
- update
- 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
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 64
- 239000011159 matrix material Substances 0.000 claims abstract description 134
- 238000000034 method Methods 0.000 claims abstract description 70
- 238000012360 testing method Methods 0.000 claims abstract description 34
- 238000010586 diagram Methods 0.000 claims description 40
- 238000013519 translation Methods 0.000 claims description 38
- 230000006978 adaptation Effects 0.000 claims description 26
- 238000013507 mapping Methods 0.000 claims description 23
- 238000010276 construction Methods 0.000 claims description 3
- 238000000605 extraction Methods 0.000 claims description 2
- 230000006870 function Effects 0.000 description 7
- 230000008569 process Effects 0.000 description 6
- 238000012545 processing Methods 0.000 description 6
- 238000009877 rendering Methods 0.000 description 6
- 238000012549 training Methods 0.000 description 5
- 238000004891 communication Methods 0.000 description 4
- 238000004590 computer program Methods 0.000 description 4
- 238000012015 optical character recognition Methods 0.000 description 4
- 230000004044 response Effects 0.000 description 4
- 238000001914 filtration Methods 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 238000013499 data model Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000002360 preparation method Methods 0.000 description 2
- 238000010998 test method Methods 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000010367 cloning Methods 0.000 description 1
- 230000007717 exclusion Effects 0.000 description 1
- 230000002085 persistent effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000011895 specific detection Methods 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The application discloses a page compatibility detection method, device, equipment and storage medium, wherein the method comprises the following steps: displaying a target area for inputting page address information; responding to a trigger instruction to the target area, and determining page address information to be detected; acquiring target model identification information of a terminal to be detected; displaying a target page matched with the address information of the page to be tested in a test browser matched with the target model identification information; marking elements in the target page, and constructing a node tree; determining a first matrix area occupied by a first node and a second matrix area occupied by a corresponding second node in the node tree; and when the first matrix area is in the second matrix area, determining that the target page is compatible with the terminal to be detected. By adopting the technical scheme, the page compatibility detection accuracy and detection efficiency are improved.
Description
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a method, an apparatus, a device, and a storage medium for detecting page compatibility.
Background
For page compatibility detection, an existing detection scheme is provided with an image recognition matching scheme, and the similarity corresponding to the plurality of pictures is obtained according to a pre-configured data model, wherein the data model is obtained by training according to a plurality of pre-configured data sets, and each data set comprises a plurality of pictures with similarity of a preset value; comparing the similarity corresponding to the plurality of pictures with a preset threshold value; and under the condition that the similarity corresponding to the plurality of pictures exceeds the threshold value, determining that the compatibility test of the webpage corresponding to the plurality of pictures passes. Because of different page complexity, for relatively complex pages, the conventional image recognition and detection accuracy is lower; image recognition model training is needed, and more image sources are relied on.
For the detection of the abnormal screen pages and the internationalization detection of the pages, no effective automatic test scheme exists at present, the verification test is carried out manually, and the detection efficiency is low.
Therefore, it is necessary to provide a method, an apparatus, a device and a storage medium for detecting page compatibility, so as to improve the accuracy and the efficiency of page compatibility detection.
Disclosure of Invention
The application provides a page compatibility detection method, device, equipment and storage medium, which can improve the page compatibility detection accuracy and detection efficiency and reduce the detection cost.
In one aspect, the present application provides a method for detecting page compatibility, where the method includes:
displaying a target area for inputting page address information;
responding to a trigger instruction to the target area, and determining page address information to be detected;
acquiring target model identification information of a terminal to be detected;
displaying a target page matched with the address information of the page to be tested in a test browser matched with the target model identification information;
marking elements in the target page, and constructing a node tree;
determining a first matrix area occupied by a first node and a second matrix area occupied by a corresponding second node in the node tree; the corresponding second node is a father node of the first node;
and when the first matrix area is in the second matrix area, determining that the target page is compatible with the terminal to be detected.
Another aspect provides a page compatibility detection apparatus, the apparatus comprising:
The target area input module is used for displaying a target area for inputting page address information;
the page address information determining module to be tested is used for responding to the trigger instruction to the target area to determine the page address information to be tested;
the identification information acquisition module is used for acquiring the identification information of the target machine type of the terminal to be detected;
the target page display module is used for displaying a target page matched with the address information of the page to be tested in a test browser matched with the target model identification information;
the node tree construction module is used for marking elements in the target page and constructing a node tree;
a matrix region determining module, configured to determine a first matrix region occupied by a first node and a second matrix region occupied by a corresponding second node in the node tree; the corresponding second node is a father node of the first node;
and the compatibility determining module is used for determining that the target page is compatible with the terminal to be detected when the first matrix area is in the second matrix area.
In another aspect, a page compatibility detection device is provided, the device including a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement a page compatibility detection method as described above.
Another aspect provides a computer storage medium storing at least one instruction or at least one program loaded and executed by a processor to implement a page compatibility detection method as described above.
Another aspect provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions so that the computer device performs the page compatibility detection method as described above.
The page compatibility detection method, device, equipment and storage medium provided by the application have the following technical effects:
according to the method, the target area is displayed, and the page address information to be detected is determined in response to a trigger instruction to the target area; displaying a target page matched with the address information of the page to be tested in a test browser matched with the target model identification; therefore, the target page can be displayed quickly; marking elements in a target page, constructing a node tree, thus obtaining a matrix area occupied by each node in the node number, and determining that the target page is compatible with a terminal to be detected when a first matrix area occupied by a first node is in a second matrix area occupied by a corresponding second node; therefore, the page compatibility is determined through the overlapping condition of the two matrix areas, model training is not needed, and the page compatibility detection accuracy and detection efficiency are improved.
Drawings
In order to more clearly illustrate the technical solutions and advantages of embodiments of the present application or of the prior art, the following description will briefly introduce the drawings that are required to be used in the embodiments or the prior art descriptions, it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram of a page compatibility detection system according to an embodiment of the present application;
fig. 2 is a flow chart of a method for detecting page compatibility according to an embodiment of the present application;
fig. 3 is a flowchart of a method for determining a first matrix area occupied by a first update node and a second matrix area occupied by a corresponding second update node in an update node tree according to an embodiment of the present application;
FIG. 4 is a flowchart of a method for determining an updated node tree according to an embodiment of the present application;
FIG. 5 is a schematic diagram of body nodes in a node tree according to an embodiment of the present disclosure;
FIG. 6 is a flow chart of a method for determining a filtered node tree provided by an embodiment of the present application;
FIG. 7 is a schematic diagram of non-page rendering elements in a node tree provided by an embodiment of the present application;
FIG. 8 is a schematic diagram of a font tag in a node tree according to an embodiment of the present application;
fig. 9 is a flowchart of a method for determining that a target page is compatible with a terminal to be detected according to an embodiment of the present application;
fig. 10 is a flowchart of a page compatibility detection method provided in an embodiment of the present application;
FIG. 11 is a flowchart of a method for setting resolution of a special-shaped screen vector diagram according to an embodiment of the present application;
fig. 12 is a vector diagram of a special-shaped area in a special-shaped screen provided in an embodiment of the present application;
fig. 13 is a flowchart of a method for determining an adaptation relationship between a target special-shaped screen and a terminal to be detected according to an embodiment of the present application;
fig. 14 is a flow chart of a method for detecting an adaptation relationship between a target special-shaped screen and a terminal to be detected, which is provided in an embodiment of the present application;
fig. 15 is a flowchart of a method for determining an adaptation relationship between a language to be tested and a terminal to be tested according to an embodiment of the present application;
fig. 16 is a flow chart of a method for testing the adaptation of languages and terminals according to an embodiment of the present application;
FIG. 17 is a flowchart illustrating another method for detecting page compatibility according to an embodiment of the present disclosure;
FIG. 18 is a schematic diagram of a setup interface for page addresses, languages to be tested, and resolutions provided in embodiments of the present application;
fig. 19 is a schematic view of a setting interface of a model to be tested according to an embodiment of the present application;
FIG. 20 is a schematic diagram of a preview interface of a language to be tested provided in an embodiment of the present application;
FIG. 21 is a block diagram of a prompt for performing a test provided by an embodiment of the present application;
FIG. 22 is a schematic diagram of the detection result of the output provided by the embodiment of the present application;
FIG. 23 is a schematic diagram of a blockchain system provided in an embodiment of the present application;
FIG. 24 is a block diagram of an embodiment of the present disclosure;
fig. 25 is a schematic structural diagram of a page compatibility detecting device according to an embodiment of the present application;
fig. 26 is a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present application based on the embodiments herein.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or server that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or apparatus, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Referring to fig. 1, fig. 1 is a schematic diagram of a page compatibility detection system provided in an embodiment of the present application, and as shown in fig. 1, the page compatibility detection system may at least include a server 01 and a client 02.
Specifically, in the embodiment of the present disclosure, the server 01 may include a server that operates independently, or a distributed server, or a server cluster that is formed by a plurality of servers, and may also be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network ), and basic cloud computing services such as big data and artificial intelligence platforms. The server 01 may include a network communication unit, a processor, a memory, and the like. Specifically, the server 01 may be configured to perform page compatibility detection.
Specifically, in the embodiment of the present disclosure, the client 02 may include a smart phone, a desktop computer, a tablet computer, a notebook computer, a digital assistant, an intelligent wearable device, an on-vehicle terminal, or other types of entity devices, or may include software running in the entity devices, for example, web pages provided by some service providers to users, or may also provide applications provided by the service providers to users. Specifically, the client 02 may be configured to query, online, compatibility between a to-be-detected page and a to-be-detected terminal.
In the following, a method for detecting page compatibility of the present application is described, and fig. 2 is a schematic flow chart of a method for detecting page compatibility provided in an embodiment of the present application, where the method includes steps as described in the examples or the flow chart, but may include more or less steps based on conventional or non-inventive labor. The order of steps recited in the embodiments is merely one way of performing the order of steps and does not represent a unique order of execution. When implemented in a real system or server product, the methods illustrated in the embodiments or figures may be performed sequentially or in parallel (e.g., in a parallel processor or multithreaded environment). As shown in fig. 2, the method may include:
S201: a target area for inputting page address information is shown.
In the embodiment of the present specification, page address information input by a user may be received through a target area. The target area may be, but is not limited to, presented in the form of a client, for example: the user opens a client installed on a control end of the webpage compatibility test, a target area is selected to be opened in the client, and the client displays the target area on a screen of the control end.
S203: and responding to the trigger instruction to the target area, and determining the page address information to be tested.
In this embodiment of the present disclosure, the trigger instruction for the target area may be a voice instruction or a text instruction, for example, the user may manually input the address information of the page to be tested in the target area. The page address information to be tested can be an IP address or a domain name address.
S205: and acquiring the target model identification information of the terminal to be detected.
In the embodiment of the specification, each terminal has corresponding unique model identification information, and one or more models can be detected in the page compatibility detection process; accordingly, the target model identification information may be one or more. For an apple mobile terminal, the model identification information can be iPhone6/7/8, iPhone6/7/8Plus, iPhoneX, iPad and the like.
In practical application, multiple machine types of the same brand can be detected in batches, and multiple machine types of different brands can be detected. When the target machine type identification information is multiple, each target machine type identification information can be traversed, and page compatibility test is performed.
In this embodiment of the present disclosure, after obtaining the target model identification information of the terminal to be detected, the method may further include:
and acquiring a test browser matched with the target machine type identification information.
Specifically, in the embodiment of the present disclosure, different models correspond to different browsers, and the mapping relationship between the model identification information and the browser may be stored in advance, where one model corresponds to one browser, that is, one model identification information corresponds to one browser.
S207: and displaying the target page matched with the address information of the page to be tested in the test browser matched with the target machine type identification information.
In the embodiment of the present specification, a target page that matches the address information of the page to be tested is displayed in the test browser, and the target page may include a plurality of elements, such as text, pictures, and the like.
S209: and marking elements in the target page, and constructing a node tree.
In the embodiment of the present disclosure, after the target page is acquired, all elements in the target page may be marked to construct a node tree, which may be an HTML DOM (Document Object Mode) tree. The node tree comprises a first node and a second node, the second node is a father node of the first node, and the first node and the second node can be multiple; the coordinate matrix of the area occupied by each node can be constructed through the node tree, so that the compatibility of the target page can be conveniently detected through the overlapping condition of the child node and the matrix area occupied by the corresponding father node.
S2011: determining a first matrix area occupied by a first node in a node tree and a second matrix area occupied by a corresponding second node; the corresponding second node is the parent node of the first node.
In this embodiment of the present disclosure, as shown in fig. 3, determining a first matrix area occupied by a first update node and a second matrix area occupied by a corresponding second update node in an update node tree includes:
s20111: determining a first matrix area occupied by each first updating node according to the attribute information of each first updating node;
s20113: and determining a second matrix area occupied by the second updating node corresponding to each first updating node according to the attribute information of the second updating node corresponding to each first updating node.
In this embodiment of the present disclosure, as shown in fig. 4, before determining the first matrix area occupied by the first node and the second matrix area occupied by the corresponding second node in the node tree, the method further includes:
s20101: traversing nodes of each level in the node tree, and determining text nodes;
in the embodiment of the present description, recursive traversal is performed starting from a body node in a node tree; as shown in fig. 5, the body node 03 is a starting node of the content area of the whole page, defines the body of the page, and includes all the display contents of the page; recursive traversal is a layer-by-layer traversal of child nodes and nested nodes of more layers under a body node.
In the embodiment of the present disclosure, the text node determining method determines whether the nodeType of the dom node is 3, and if it is 3, it is the text node; the calculation method of the text matrix area is that the upper left corner x and y coordinates of the text node are obtained through dom, then the height and width of the text node are obtained, and the area occupied by the text node is further obtained.
The mapping relation table of the nodeType is shown in the following table 1:
TABLE 1
Node type | Description of the invention |
1 | Element(s) |
2 | Attributes of |
3 | Text content in elements or attributes |
4 | CDATA in a document (text not parsed by a parser) |
5 | Entity reference |
6 | Entity |
7 | Processing instructions |
8 | Annotating |
9 | Whole document (root node of DOM tree) |
10 | Providing interfaces to entities defined for documents |
11 | Lightweight Document objects capable of holding a portion of a Document |
12 | Notation declared in Document Type Definition (DTD) |
In this embodiment of the present disclosure, as shown in fig. 6, before traversing the nodes at each level in the node tree to determine the text node, the method further includes:
s201001: determining non-page rendering elements in the node tree;
s201003: and filtering non-page rendering elements in the node tree to obtain a filtered node tree.
Specifically, in the embodiment of the present specification, the non-page rendering element is a script tag, an annotation text, or the like; in a specific embodiment, the non-page rendering elements are shown as 04, 05 in fig. 7, where 04 is annotation text and 05 is script tag; by filtering these elements, the speed of subsequent determination of text nodes can be increased.
Correspondingly, traversing nodes of each level in the node tree, determining text nodes, including:
and traversing nodes of each level in the filtered node tree, and determining text nodes.
S20103: and adding a target label to the text node to obtain an updated node tree.
In the embodiment of the present disclosure, the target tag is a font tag, and the < font > tag is a tag that sets a text style, and may set a font style, a font size, and a font color of the text. As shown in fig. 8, 06 in fig. 8 is a font tag. Adding a font label to the text node is convenient for calculating a matrix area of the text, and if the label is not added, a matrix coordinate cannot be calculated; but the tag need not be added for the empty string.
In the embodiment of the present specification, adding a target label to a text node to obtain an updated node tree includes:
s201031: cloning the text nodes to obtain cloned nodes;
s201033: constructing an updated text node based on the clone node and the target label;
s201035: and replacing the text node with the updated text node to obtain an updated node tree.
In the embodiment of the specification, clone copying is performed on the node to which the font label is added, the cloned object is added under the newly built font node, and then the original node is replaced by the new node after the creation processing. The clone copy is carried out instead of directly carrying out direct operation on the original node, so that on one hand, the pollution to the original node structure can be avoided, and the node display disorder is caused; on the other hand, the execution complexity is lower, the upper node is not required to be searched and positioned, and the purpose of replacement is to inject the font label.
In an embodiment of the present disclosure, determining a first matrix area occupied by a first node and a second matrix area occupied by a corresponding second node in a node tree includes:
and determining a first matrix area occupied by a first updating node and a second matrix area occupied by a corresponding second updating node in the updating node tree, wherein the corresponding second updating node is a father node of the first updating node.
In this embodiment of the present disclosure, the update node tree includes a plurality of first update nodes and a plurality of corresponding second update nodes, and before determining a first matrix area occupied by the first update nodes and a second matrix area occupied by the corresponding second update nodes in the update node tree, the method further includes:
traversing the update node tree, acquiring attribute information of each first update node, and acquiring attribute information of a second update node corresponding to each first update node.
In the embodiment of the present disclosure, all nodes in the updated node tree, such as < a >, < img >, < input >, < iframe >, < label >, < p >, < ul >, < td >, < tr >, < textarea >, etc., are traversed, and the x, y coordinates and w (width), h (height) of the area matrix where each node is located are obtained through the dom interface.
In this embodiment of the present disclosure, before traversing the update node tree, obtaining attribute information of each first update node, and obtaining attribute information of a second update node corresponding to each first update node, the method further includes:
a determination is made to update the undisplayed nodes in the node tree.
In the embodiment of the present disclosure, the node that is not shown may be a hidden node, or may be a node with any one of height or width being 0. The hidden node means that the node display attribute is set to none, and this node is not displayed and therefore does not participate in detection.
In the embodiment of the present disclosure, if the display attribute of the first update node is not none and the display attribute of the second update node is not none, and at the same time, the width and height of the first update node and the second update node are not 0, then detection is performed, otherwise, exclusion is performed.
The code is as follows:
if ($ (el), -css ('display') ∈ = "none" & $ (parentEl), -css ('display') = "none" & w +=0) { execute detection } else { do not detect }
In the embodiment of the present specification, traversing the update node tree, obtaining attribute information of each first update node, and obtaining attribute information of a second update node corresponding to each first update node, includes:
And acquiring attribute information of all other nodes except the node which is not displayed in the updated node tree.
In the embodiment of the present specification, if the display (display) attribute of the first update node is not none and the display attribute of the second update node is not none, and the width and height of the nodes are not 0, the update node tree is traversed, the attribute information of each first update node is acquired, and the attribute information of the second update node corresponding to each first update node is acquired.
S2013: and when the first matrix area is in the second matrix area, determining that the target page is compatible with the terminal to be detected.
In the present embodiment, the first matrix area being within the second matrix area means that the first matrix area is completely surrounded by the second matrix area.
In this embodiment of the present disclosure, as shown in fig. 9, before determining that the target page is compatible with the terminal to be detected when the first matrix area is within the second matrix area, the method further includes:
s20121: judging whether the first matrix area is in the second matrix area or not;
s20123: if not, determining that the target page is incompatible with the terminal to be detected.
In this embodiment of the present disclosure, when the first matrix area is within the second matrix area, determining that the target page is compatible with the terminal to be detected includes:
And when the first matrix area occupied by each first updating node is in the second matrix area occupied by the second updating node corresponding to each first updating node, determining that the target page is compatible with the terminal to be detected.
In this embodiment of the present disclosure, when the first matrix area occupied by any one of the first update nodes is not within the second matrix area occupied by the corresponding second update node, that is, the first matrix area occupied by any one of the first update nodes is not surrounded by the second matrix area occupied by the corresponding second update node, it is determined that the target page is incompatible with the terminal to be detected.
Specifically, in the embodiment of the present disclosure, for the incompatible detection result, an incompatible node name and node coordinate may be output, and a screenshot of an incompatible matrix area may also be output.
Specifically, in the embodiment of the present disclosure, determining a first matrix area occupied by a first node and a second matrix area occupied by a corresponding second node in a node tree includes:
acquiring the coordinate of the upper left corner of the first node and the width and height of the first node, and obtaining a first matrix area occupied by the first node;
acquiring the coordinate of the left upper corner of the second node and the width and height of the second node to obtain a second matrix area occupied by the second node;
When the first matrix area is not completely in the second matrix area, namely the first matrix area is not completely surrounded by the second matrix area, judging that the target page overflows, namely the target page is not compatible with the terminal to be detected; for example, the area occupied by text on a button exceeds the size of the area of the button, resulting in overflow.
In the embodiment of the present specification, specific detection codes are as follows:
var pX=$(parentEl).offset().left;
var pY=$(parentEl).offset().top;
var pW=$(parentEl).width();
var pH=$(parentEl).height();
var x=$(el).offset().left;
var y=$(el).offset().top;
var w=$(el).width();
var h=$(el).height();
detection conditions: pX < = x & x+w < = px+pw+1 < = y < = y+h < = py+ph+1; when this condition is not satisfied, it is determined that the overflow is performed.
In a specific embodiment, the page compatibility detection method is shown in fig. 10, and includes the following steps:
s1001: obtaining HTML DOM structure information of a target page, and constructing a node tree;
s1003: pointing to a body node in the node tree;
s1005: performing recursive traversal of each level of nodes from the body node;
s1007: filtering the non-page rendering elements;
s1009: adding a font label for the text node;
s10011: traversing coordinates, height and width of each node in the updated node tree;
s10013: comparing the matrix area occupied by each node with the matrix area occupied by the corresponding father node;
s10015: obtaining a page compatibility detection result according to the comparison result; when the matrix area occupied by each node is in the matrix area occupied by the corresponding father node, determining that the target page is compatible with the terminal to be tested; otherwise, the two are not compatible.
In this embodiment of the present disclosure, after the terminal to be detected is a special screen and the target model identification information of the terminal to be detected is obtained, as shown in fig. 11, the method further includes:
s2061: acquiring target resolution of a terminal to be detected;
s2063: determining a target special-shaped screen vector diagram matched with target model identification information according to a mapping relation between preset model identification information and the special-shaped screen vector diagram;
s2065: and setting the resolution of the target special-shaped screen vector diagram as the target resolution.
In the embodiment of the present specification, the target model identification information and the target resolution of the terminal to be detected may be obtained simultaneously.
In an embodiment of the present disclosure, the method further includes:
and drawing a vector diagram of the special-shaped area in the special-shaped screen.
In the embodiment of the present specification, the drawing is typically performed on a graphics software according to model data provided by a handset manufacturer, for example, a software tool such as adobe illustrator, corel drawing. And constructing a vector diagram of the special-shaped area once for the same model identification information. In a specific embodiment, as shown in fig. 12, fig. 12 is a shaped screen vector diagram 07, including a shaped region vector diagram 08.
In this embodiment of the present disclosure, the target shaped screen includes a shaped area, and after setting the resolution of the vector diagram of the target shaped screen to the target resolution, as shown in fig. 13, the method further includes:
S1301: acquiring attribute information of the special-shaped region;
in the embodiment of the present specification, the attribute information of the shaped area includes coordinate and size information of the shaped area.
S1303: determining a special-shaped matrix area occupied by the special-shaped area according to the attribute information of the special-shaped area;
s1305: traversing a node tree, and determining a target matrix area occupied by target nodes in the node tree, wherein the target nodes are nodes corresponding to target elements in a target page;
in the embodiment of the present specification, the target element is a main element such as a button, a text, a form, etc. in the page.
S1307: judging whether an overlapping area exists between the target matrix area and the special matrix area;
s1309: and determining the adaptation relation between the target special-shaped screen and the terminal to be detected according to the judgment result.
In the embodiment of the present specification, determining, according to a determination result, an adaptation relationship between a target special-shaped screen and a terminal to be detected includes:
s13091: when the target matrix area and the special matrix area have an overlapping area, determining that the target special screen is not matched with the terminal to be detected;
s13093: and when the target matrix area and the special matrix area do not have an overlapping area, determining that the target special screen is matched with the terminal to be detected.
In the embodiment of the specification, a plurality of types of special-shaped screen models can be selected at a time for detection, and then the special-shaped screens corresponding to each type of the selected models are traversed for detection one by one.
In the embodiment of the specification, the method for detecting the adaptation relation between the special-shaped screen and the terminal can greatly improve the test efficiency compared with manual test, and meanwhile saves the cost generated by purchasing a large number of entity devices.
In a specific embodiment, the method for detecting the adaptation relation between the target special-shaped screen and the terminal to be detected is shown in fig. 14, and includes the following steps:
s1401: basic data preparation: drawing a vector diagram of the special-shaped screen comprising the special-shaped area;
s1403: selecting the machine type and the corresponding resolution ratio which need to be tested by the special-shaped screen in batches;
s1405: traversing the selected model for testing;
s1407: adjusting the resolution of the test browser to the resolution of the special-shaped screen model to be tested;
s1409: loading an active page;
s14011: acquiring page HTML DOM structure information;
s14013: the resolution of the vector diagram of the special-shaped screen is adjusted to the resolution of the model to be tested;
s14015: acquiring coordinates and size information of the special-shaped area;
s14017: traversing the HTML DOM structure;
S14019: detecting whether an overlapping area exists between an area of main elements such as buttons, characters and forms and a special-shaped screen area;
s14021: outputting a detection result; when the overlapping area exists, determining that the special-shaped screen is incompatible with the model to be tested; otherwise, it is determined that the two are compatible.
In this embodiment of the present disclosure, after obtaining the target resolution of the terminal to be detected, the method further includes:
obtaining the language to be tested;
the language of the test browser is set as the language to be tested.
In this embodiment of the present disclosure, after marking elements in the target page and constructing the node tree, as shown in fig. 15, the method further includes:
s1501: extracting characters in the target page layer by layer according to the node tree;
in an embodiment of the present disclosure, when the target page includes a picture, the method further includes:
and recognizing and extracting characters in the picture through character recognition software.
Specifically, in the embodiment of the present disclosure, the text recognition software may employ optical character recognition (Optical Character Recognition, OCR) technology to directly convert the text content on the picture into editable text.
S1503: determining a target character list matched with the language to be tested according to a preset mapping relation between the language and the character list;
In the embodiment of the present specification, different languages are composed of different characters, and this step is to enumerate the characters of each language to form a list table; this step is not required for every test, and can be used all the time later for this language test.
S1505: determining standard translation characters corresponding to the characters in the target page according to the target character list;
in this embodiment of the present disclosure, after determining, according to the target character list, standard translation characters corresponding to characters in the target page, the method further includes:
judging whether a translation mapping table exists in the terminal to be detected;
if the voice is not available, determining that the language to be tested is not matched with the terminal to be tested.
S1507: acquiring target translation characters corresponding to characters in a target page according to a translation mapping table in a terminal to be detected;
in the embodiment of the present disclosure, the translation mapping table is a translation table dynamically loaded in an activity, typically a js file or json file, and whether the translation mapping table exists or not can be automatically determined in the detection process.
S1509: comparing the target translation characters with the standard translation characters to obtain a comparison result;
s15011: and determining the adaptation relation between the language to be tested and the terminal to be tested according to the comparison result.
In the embodiment of the present specification, determining, according to the comparison result, an adaptation relationship between a language to be tested and a terminal to be tested includes:
s150111: when the target translation characters are consistent with the standard translation characters in comparison, determining that the language to be tested is matched with the terminal to be tested;
s150113: and when the comparison of the target translation characters and the standard translation characters is inconsistent, determining that the language to be tested is not suitable for the terminal to be tested.
In the embodiment of the specification, the adaptation test method of the language and the terminal can greatly improve the test efficiency compared with manual test, and meanwhile detail items which are easy to be missed manually can be found easily.
In a specific embodiment, as shown in fig. 16, fig. 16 is a language and terminal adaptation test method, which includes:
s1601: basic data preparation: constructing character list tables of different languages;
s1603: selecting languages to be tested in batches;
s1605: traversing the selected languages for testing;
s1607: the language of the test browser is adjusted to be the language to be tested;
s1609: loading an active page;
s16011: acquiring page HTML DOM structure information;
s16013: extracting all displayed characters in the page;
s16015: extracting all characters in the page picture through OCR recognition;
S16017: traversing the HTML DOM structure;
s16019: matching the character list table with the literal characters;
s16021: judging whether a translation mapping table exists in the terminal to be tested;
s16023: if a translation mapping table exists, comparing the translation characters with the translation mapping table, and when the comparison is consistent, determining that the language to be tested is matched with the terminal to be tested, otherwise, the language to be tested is not matched with the terminal to be tested;
s16025: and if the translation mapping table does not exist, outputting an unfit detection result.
In a specific embodiment, as shown in fig. 17, fig. 17 is a flow chart of a method for detecting page compatibility, which includes the following steps:
s1701: inputting an active URL address;
s1703: setting the resolution/model of a terminal to be tested;
s1705: setting the language to be tested;
s1707: detecting page compatibility;
s1709: detecting the adaptation of the special-shaped screen;
s17011: detecting the adaptation of the language to be tested;
s17013: outputting the detection result.
In a specific embodiment, as shown in the figure, fig. 18 is a schematic diagram of a page address, a language to be tested, and a setting interface for resolution; input setting can be performed on the display interface; FIG. 19 is a setup interface for a model to be tested; FIG. 20 is a preview interface of a language to be tested; FIG. 21 is a prompt box for performing a test; fig. 22 shows the output detection results, which include a page compatibility detection result, a special-shaped screen adaptation detection result, and a to-be-tested language adaptation detection result.
In the embodiment of the present disclosure, the method for detecting page compatibility of the present application may be applied to, but not limited to, detection of a web page in a game application.
In an embodiment of the present disclosure, the method may further include:
the block chain system is based on the mapping relation between the model identification information and the special-shaped screen vector diagram and/or the mapping relation between languages and character lists, and comprises a plurality of nodes, and a point-to-point network is formed among the nodes.
In some embodiments, the blockchain system may be the structure shown in fig. 23, where a plurality of nodes form a Peer-To-Peer (P2P) network, and the P2P protocol is an application layer protocol that runs on top of a transmission control protocol (TCP, transmission Control Protocol) protocol. In a blockchain system, any machine, such as a server, a terminal, may join to become a node, including a hardware layer, a middle layer, an operating system layer, and an application layer.
The functions of each node in the blockchain system shown in fig. 23 include:
1) The routing, the node has basic functions for supporting communication between nodes.
Besides the routing function, the node can also have the following functions:
2) The application is used for being deployed in a block chain to realize specific service according to actual service requirements, recording data related to the realization function to form recorded data, carrying a digital signature in the recorded data to represent the source of task data, sending the recorded data to other nodes in the block chain system, and adding the recorded data into a temporary block when the source and the integrity of the recorded data are verified by the other nodes.
3) The blockchain comprises a series of blocks (blocks) which are connected with each other according to the generated sequence time, the new blocks are not removed once being added into the blockchain, and record data submitted by nodes in the blockchain system are recorded in the blocks.
In some embodiments, a Block Structure (Block Structure) may be the Structure shown in fig. 24, where each Block includes a hash value of the transaction record stored in the Block (hash value of the Block) and a hash value of a previous Block, and the blocks are connected by the hash values to form a blockchain. In addition, the block may include information such as a time stamp at the time of block generation. The blockchain (Block chain), which is essentially a de-centralized database, is a string of data blocks that are generated in association using cryptographic methods, each of which contains associated information for verifying the validity of its information (anti-counterfeiting) and generating the next Block.
As can be seen from the technical solutions provided in the embodiments of the present specification, by displaying a target area, determining address information of a page to be tested in response to a trigger instruction to the target area; displaying a target page matched with the address information of the page to be tested in a test browser matched with the target model identification; therefore, the target page can be displayed quickly; marking elements in a target page, constructing a node tree, thus obtaining a matrix area occupied by each node in the node number, and determining that the target page is compatible with a terminal to be detected when a first matrix area occupied by a first node is in a second matrix area occupied by a corresponding second node; therefore, the page compatibility is determined through the overlapping condition of the two matrix areas, model training is not needed, and the page compatibility detection accuracy and detection efficiency are improved.
The embodiment of the application also provides a device for detecting page compatibility, as shown in fig. 25, the device includes:
a target area input module 2501 for presenting a target area for inputting page address information;
a page address information to be tested determining module 2502 for determining page address information to be tested in response to a trigger instruction to the target region;
An identification information acquisition module 2503 for acquiring target model identification information of a terminal to be detected;
a target page display module 2504, configured to display, in a test browser that matches the target model identification information, a target page that matches the page address information to be tested;
a node tree construction module 2505 for marking elements in the target page and constructing a node tree;
a matrix area determining module 2506, configured to determine a first matrix area occupied by a first node and a second matrix area occupied by a corresponding second node in the node tree; the corresponding second node is a father node of the first node;
a compatibility determining module 2507, configured to determine that the target page is compatible with the terminal to be detected when the first matrix region is within the second matrix region.
In some embodiments, the apparatus may further comprise:
the text node determining module is used for traversing the nodes of each level in the node tree and determining text nodes;
and the updated node tree determining module is used for adding a target label to the text node to obtain an updated node tree.
In some embodiments, the matrix region determination module comprises:
The matrix area determining unit is used for determining a first matrix area occupied by a first updating node and a second matrix area occupied by a corresponding second updating node in the updating node tree, wherein the corresponding second updating node is a father node of the first updating node.
In some embodiments, the update node tree includes a plurality of first update nodes and a plurality of corresponding second update nodes, and the apparatus may further include:
the attribute information acquisition module is used for traversing the update node tree, acquiring attribute information of each first update node and acquiring attribute information of a second update node corresponding to each first update node.
In some embodiments, the matrix region determination module comprises:
a first matrix area determining unit, configured to determine, according to attribute information of each first update node, a first matrix area occupied by each first update node;
and the second matrix area determining unit is used for determining a second matrix area occupied by the second updating node corresponding to each first updating node according to the attribute information of the second updating node corresponding to each first updating node.
In some embodiments, the compatibility determination module includes:
And the compatibility determining unit is used for determining that the target page is compatible with the terminal to be detected when the first matrix area occupied by each first updating node is in the second matrix area occupied by the second updating node corresponding to each first updating node.
In some embodiments, the apparatus may further comprise:
and the undisplayed node determining module is used for determining undisplayed nodes in the updated node tree.
In some embodiments, the attribute information acquisition module includes:
and the attribute information acquisition unit is used for acquiring attribute information of each node except the non-displayed node in the updated node tree.
In some embodiments, the terminal to be detected is a shaped screen, and the apparatus may further include:
the target resolution obtaining module is used for obtaining the target resolution of the terminal to be detected;
the special-shaped screen vector diagram determining module is used for determining a special-shaped screen vector diagram matched with the special-shaped screen model identification information according to the mapping relation between the preset model identification information and the special-shaped screen vector diagram;
and the target resolution setting module is used for setting the resolution of the target special-shaped screen vector diagram to be the target resolution.
In some embodiments, the target special-shaped screen includes a special-shaped area therein, and the device may further include:
the special-shaped region attribute information acquisition module is used for acquiring attribute information of the special-shaped region;
the special-shaped matrix region determining module is used for determining a special-shaped matrix region occupied by the special-shaped region according to the attribute information of the special-shaped region;
the target matrix area determining module is used for traversing the node tree, determining a target matrix area occupied by target nodes in the node tree, wherein the target nodes are nodes corresponding to target elements in the target page;
the overlapping region judging module is used for judging whether an overlapping region exists between the target matrix region and the special matrix region;
and the first adaptation relation determining module is used for determining the adaptation relation between the target special-shaped screen and the terminal to be detected according to the judging result.
In some embodiments, the apparatus may further comprise:
the language to be tested obtaining module is used for obtaining the language to be tested;
and the language setting module is used for setting the language of the test browser as the language to be tested.
In some embodiments, the apparatus may further comprise:
The text extraction module is used for extracting the text in the target page layer by layer according to the node tree;
the target character list determining module is used for determining a target character list matched with the language to be tested according to the mapping relation between the preset language and the character list;
the standard translation character determining module is used for determining standard translation characters corresponding to the characters in the target page according to the target character list;
the target translation text acquisition module is used for acquiring target translation text corresponding to text in the target page according to the translation mapping table in the terminal to be detected;
the comparison result determining module is used for comparing the target translation characters with the standard translation characters to obtain a comparison result;
and the second adaptation relation determining module is used for determining the adaptation relation between the language to be tested and the terminal to be tested according to the comparison result.
The apparatus and method embodiments described above in the apparatus embodiments are based on the same inventive concept.
The embodiment of the application provides page compatibility detection equipment, which comprises a processor and a memory, wherein at least one instruction or at least one section of program is stored in the memory, and the at least one instruction or the at least one section of program is loaded and executed by the processor to realize the page compatibility detection method provided by the embodiment of the method.
Embodiments of the present application also provide a computer storage medium that may be provided in a terminal to store at least one instruction or at least one program related to a method for implementing the page compatibility detection method in the method embodiments, where the at least one instruction or at least one program is loaded and executed by the processor to implement the page compatibility detection method provided in the method embodiments above.
Embodiments of the present application also provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The computer instructions are read from the computer-readable storage medium by a processor of a computer device, and executed by the processor, cause the computer device to perform the methods provided in the various alternative implementations described above.
Alternatively, in the present description embodiment, the storage medium may be located in at least one network server among a plurality of network servers of the computer network. Alternatively, in the present embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The memory according to the embodiments of the present disclosure may be used to store software programs and modules, and the processor executes the software programs and modules stored in the memory to perform various functional applications and data processing. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, application programs required for functions, and the like; the storage data area may store data created according to the use of the device, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory may also include a memory controller to provide access to the memory by the processor.
The page compatibility detection method provided by the embodiment of the application can be executed in a mobile terminal, a computer terminal, a server or similar computing devices. Taking the operation on the server as an example, fig. 26 is a block diagram of the hardware structure of the server of a page compatibility detection method provided in the embodiment of the present application. As shown in fig. 26, the server 2600 may vary considerably in configuration or performance, and may include one or more central processing units (Central Processing Units, CPU) 2610 (the processor 2610 may include, but is not limited to, a microprocessor MCU, a programmable logic device FPGA, etc.) memory 2630 for storing data, one or more storage mediums 2620 (e.g., one or more mass storage devices) for storing applications 2623 or data 2622. Wherein the memory 2630 and storage medium 2620 may be transitory or persistent storage. The program stored on the storage medium 2620 may include one or more modules, each of which may include a series of instruction operations on a server. Still further, the central processor 2610 may be configured to communicate with a storage medium 2620 to execute a series of instruction operations on the server 2600 in the storage medium 2620. The server 2600 can also include one or more power sources 2660, one or more wired or wireless network interfaces 2650, one or more input output interfaces 2640, and/or one or more operating systems 2621, such as Windows server (tm), mac OS XTM, unixTM, linuxTM, freeBSDTM, and the like.
The input-output interface 2640 may be used to receive or transmit data via a network. Specific examples of networks described above may include wireless networks provided by the communication provider of server 2600. In one example, the input-output interface 2640 includes a network adapter (Network Interface Controller, NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the input-output interface 2640 may be a Radio Frequency (RF) module for communicating with the internet wirelessly.
It will be appreciated by those of ordinary skill in the art that the configuration shown in fig. 26 is merely illustrative and is not intended to limit the configuration of the electronic device described above. For example, the server 2600 may also include more or fewer components than shown in fig. 26, or have a different configuration than shown in fig. 26.
According to the embodiment of the page compatibility detection method, the device, the equipment or the storage medium, the target area is displayed, and the page address information to be detected is determined in response to a trigger instruction to the target area; displaying a target page matched with the address information of the page to be tested in a test browser matched with the target model identification; therefore, the target page can be displayed quickly; marking elements in a target page, constructing a node tree, thus obtaining a matrix area occupied by each node in the node number, and determining that the target page is compatible with a terminal to be detected when a first matrix area occupied by a first node is in a second matrix area occupied by a corresponding second node; therefore, the page compatibility is determined through the overlapping condition of the two matrix areas, model training is not needed, and the page compatibility detection accuracy and detection efficiency are improved.
It should be noted that: the foregoing sequence of the embodiments of the present application is only for describing, and does not represent the advantages and disadvantages of the embodiments. And the foregoing description has been directed to specific embodiments of this specification. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
In this specification, each embodiment is described in a progressive 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, device, storage medium embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and references to the parts of the description of the method embodiments are only required.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, where the program may be stored in a computer storage medium, and the storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The foregoing description of the preferred embodiments of the present application is not intended to limit the invention to the particular embodiments of the present application, but to limit the scope of the invention to the particular embodiments of the present application.
Claims (12)
1. A method for detecting page compatibility, the method comprising:
displaying a target area for inputting page address information;
responding to a trigger instruction to the target area, and determining page address information to be detected;
acquiring target model identification information of a terminal to be detected;
displaying a target page matched with the address information of the page to be tested in a test browser matched with the target model identification information;
marking elements in the target page, and constructing a node tree;
traversing nodes of each level in the node tree, and determining text nodes;
adding a target label to the text node to obtain an updated node tree; the update node tree comprises a plurality of first update nodes and a plurality of corresponding second update nodes, wherein the corresponding second update nodes are father nodes of the first update nodes;
traversing the update node tree, obtaining attribute information of each first update node, and obtaining attribute information of a second update node corresponding to each first update node;
Determining a first matrix area occupied by each first updating node according to the attribute information of each first updating node;
determining a second matrix area occupied by the second update node corresponding to each first update node according to the attribute information of the second update node corresponding to each first update node;
and when the first matrix area occupied by each first updating node is in the second matrix area occupied by the second updating node corresponding to each first updating node, determining that the target page is compatible with the terminal to be detected.
2. The method of claim 1, wherein before traversing the update node tree, obtaining attribute information of each first update node, and obtaining attribute information of a second update node corresponding to each first update node, the method further comprises:
determining undisplayed nodes in the updated node tree;
correspondingly, traversing the update node tree, obtaining attribute information of each first update node, and obtaining attribute information of a second update node corresponding to each first update node, including:
and acquiring attribute information of all nodes except the non-displayed node in the updated node tree.
3. The method according to any one of claims 1-2, wherein the terminal to be detected is a shaped screen, and after the obtaining the target model identification information of the terminal to be detected, the method further includes:
acquiring target resolution of the terminal to be detected;
determining a target special-shaped screen vector diagram matched with the target model identification information according to a mapping relation between the preset model identification information and the special-shaped screen vector diagram;
and setting the resolution of the target special-shaped screen vector diagram as the target resolution.
4. A method according to claim 3, wherein the target shaped screen comprises shaped areas therein, and wherein after setting the resolution of the target shaped screen vector diagram to the target resolution, the method further comprises:
acquiring attribute information of the special-shaped area;
determining a special-shaped matrix area occupied by the special-shaped area according to the attribute information of the special-shaped area;
traversing the node tree, and determining a target matrix area occupied by target nodes in the node tree, wherein the target nodes are nodes corresponding to target elements in the target page;
judging whether an overlapping area exists between the target matrix area and the special matrix area;
And determining the adaptation relation between the target special-shaped screen and the terminal to be detected according to the judgment result.
5. A method according to claim 3, wherein after the obtaining the target resolution of the terminal to be detected, the method further comprises:
obtaining the language to be tested;
setting the language of the test browser as the language to be tested;
correspondingly, after the marking the elements in the target page and constructing the node tree, the method further comprises:
extracting characters in the target page layer by layer according to the node tree;
determining a target character list matched with the language to be tested according to a preset mapping relation between the language and the character list;
determining standard translation characters corresponding to the characters in the target page according to the target character list;
acquiring target translation characters corresponding to the characters in the target page according to the translation mapping table in the terminal to be detected;
comparing the target translation characters with the standard translation characters to obtain a comparison result;
and determining the adaptation relation between the language to be tested and the terminal to be tested according to the comparison result.
6. A page compatibility detection device, the device comprising:
the target area input module is used for displaying a target area for inputting page address information;
the page address information determining module to be tested is used for responding to the trigger instruction to the target area to determine the page address information to be tested;
the identification information acquisition module is used for acquiring the identification information of the target machine type of the terminal to be detected;
the target page display module is used for displaying a target page matched with the address information of the page to be tested in a test browser matched with the target model identification information;
the node tree construction module is used for marking elements in the target page and constructing a node tree;
a matrix region determining module, configured to determine a first matrix region occupied by a first node and a second matrix region occupied by a corresponding second node in the node tree; the corresponding second node is a father node of the first node;
the compatibility determining module is used for determining that the target page is compatible with the terminal to be detected when the first matrix area is in the second matrix area;
the text node determining module is used for traversing the nodes of each level in the node tree and determining text nodes;
The updated node tree determining module is used for adding a target label to the text node to obtain an updated node tree; the update node tree comprises a plurality of first update nodes and a plurality of corresponding second update nodes, wherein the corresponding second update nodes are father nodes of the first update nodes;
the attribute information acquisition module is used for traversing the update node tree, acquiring attribute information of each first update node and acquiring attribute information of a second update node corresponding to each first update node;
the matrix region determination module includes: a first matrix area determining unit, configured to determine, according to attribute information of each first update node, a first matrix area occupied by each first update node; a second matrix area determining unit, configured to determine, according to attribute information of a second update node corresponding to each first update node, a second matrix area occupied by the second update node corresponding to each first update node;
the compatibility determination module includes: and the compatibility determining unit is used for determining that the target page is compatible with the terminal to be detected when the first matrix area occupied by each first updating node is in the second matrix area occupied by the second updating node corresponding to each first updating node.
7. The apparatus of claim 6, wherein the apparatus further comprises:
the undisplayed node determining module is used for determining undisplayed nodes in the updated node tree;
the attribute information acquisition module includes:
and the attribute information acquisition unit is used for acquiring attribute information of each node except the non-displayed node in the updated node tree.
8. The apparatus according to any one of claims 6-7, wherein the terminal to be detected is a shaped screen, the apparatus further comprising:
the target resolution obtaining module is used for obtaining the target resolution of the terminal to be detected;
the special-shaped screen vector diagram determining module is used for determining a special-shaped screen vector diagram matched with the special-shaped screen model identification information according to the mapping relation between the preset model identification information and the special-shaped screen vector diagram;
and the target resolution setting module is used for setting the resolution of the target special-shaped screen vector diagram to be the target resolution.
9. The apparatus of claim 8, wherein the target shaped screen includes a shaped region therein, the apparatus further comprising:
the special-shaped region attribute information acquisition module is used for acquiring attribute information of the special-shaped region;
The special-shaped matrix region determining module is used for determining a special-shaped matrix region occupied by the special-shaped region according to the attribute information of the special-shaped region;
the target matrix area determining module is used for traversing the node tree, determining a target matrix area occupied by target nodes in the node tree, wherein the target nodes are nodes corresponding to target elements in the target page;
the overlapping region judging module is used for judging whether an overlapping region exists between the target matrix region and the special matrix region;
and the first adaptation relation determining module is used for determining the adaptation relation between the target special-shaped screen and the terminal to be detected according to the judging result.
10. The apparatus of claim 8, wherein the apparatus further comprises:
the language to be tested obtaining module is used for obtaining the language to be tested;
the language setting module is used for setting the language of the test browser as the language to be tested;
the text extraction module is used for extracting the text in the target page layer by layer according to the node tree;
the target character list determining module is used for determining a target character list matched with the language to be tested according to the mapping relation between the preset language and the character list;
The standard translation character determining module is used for determining standard translation characters corresponding to the characters in the target page according to the target character list;
the target translation text acquisition module is used for acquiring target translation text corresponding to text in the target page according to the translation mapping table in the terminal to be detected;
the comparison result determining module is used for comparing the target translation characters with the standard translation characters to obtain a comparison result;
and the second adaptation relation determining module is used for determining the adaptation relation between the language to be tested and the terminal to be tested according to the comparison result.
11. A page compatibility detection device, characterized in that it comprises a processor and a memory, in which at least one instruction or at least one program is stored, which is loaded and executed by the processor to implement the page compatibility detection method according to any one of claims 1-5.
12. A computer storage medium having stored therein at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by a processor to implement the page compatibility detection method of any one of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110518989.5A CN113094287B (en) | 2021-05-12 | 2021-05-12 | Page compatibility detection method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110518989.5A CN113094287B (en) | 2021-05-12 | 2021-05-12 | Page compatibility detection method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113094287A CN113094287A (en) | 2021-07-09 |
CN113094287B true CN113094287B (en) | 2024-03-15 |
Family
ID=76665456
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110518989.5A Active CN113094287B (en) | 2021-05-12 | 2021-05-12 | Page compatibility detection method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113094287B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113742217B (en) * | 2021-08-03 | 2024-06-11 | 北京达佳互联信息技术有限公司 | Performance test method, device and storage medium |
CN113918267B (en) * | 2021-12-15 | 2022-04-12 | 腾讯科技(深圳)有限公司 | Map interaction method and device, electronic equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107678937A (en) * | 2017-07-26 | 2018-02-09 | 上海壹账通金融科技有限公司 | Page compatibility detection method, device, server and medium |
CN110597584A (en) * | 2019-08-15 | 2019-12-20 | 香港乐蜜有限公司 | Page adaptation testing method and device, electronic equipment and storage medium |
CN112306838A (en) * | 2019-07-23 | 2021-02-02 | 北京京东尚科信息技术有限公司 | Page layout compatibility testing method, device and equipment and readable storage medium |
CN112667330A (en) * | 2020-12-18 | 2021-04-16 | 中国平安人寿保险股份有限公司 | Page display method and computer equipment |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10534830B2 (en) * | 2011-06-23 | 2020-01-14 | Microsoft Technology Licensing, Llc | Dynamically updating a running page |
-
2021
- 2021-05-12 CN CN202110518989.5A patent/CN113094287B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107678937A (en) * | 2017-07-26 | 2018-02-09 | 上海壹账通金融科技有限公司 | Page compatibility detection method, device, server and medium |
CN112306838A (en) * | 2019-07-23 | 2021-02-02 | 北京京东尚科信息技术有限公司 | Page layout compatibility testing method, device and equipment and readable storage medium |
CN110597584A (en) * | 2019-08-15 | 2019-12-20 | 香港乐蜜有限公司 | Page adaptation testing method and device, electronic equipment and storage medium |
CN112667330A (en) * | 2020-12-18 | 2021-04-16 | 中国平安人寿保险股份有限公司 | Page display method and computer equipment |
Also Published As
Publication number | Publication date |
---|---|
CN113094287A (en) | 2021-07-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11899681B2 (en) | Knowledge graph building method, electronic apparatus and non-transitory computer readable storage medium | |
CN106294816B (en) | Page information processing method and device | |
US10872236B1 (en) | Layout-agnostic clustering-based classification of document keys and values | |
CN111767228B (en) | Interface testing method, device, equipment and medium based on artificial intelligence | |
US8718369B1 (en) | Techniques for shape-based search of content | |
CN109783094A (en) | Front end page generation method, device, computer equipment and storage medium | |
CN113094287B (en) | Page compatibility detection method, device, equipment and storage medium | |
US20200117944A1 (en) | Key value extraction from documents | |
CN109040960A (en) | A kind of method and apparatus for realizing location-based service | |
CN112882947B (en) | Interface testing method, device, equipment and storage medium | |
US20140279803A1 (en) | Disambiguating data using contextual and historical information | |
JP2019520662A (en) | Content-based search and retrieval of trademark images | |
EP3853761A1 (en) | Converting an image into a structured table | |
CN111079043A (en) | Key content positioning method | |
CN105721629A (en) | User identifier matching method and device | |
US9305226B1 (en) | Semantic boosting rules for improving text recognition | |
CN106603690A (en) | Data analysis device, data analysis processing system and data analysis method | |
CN111338693A (en) | Target file generation method based on model construction, server and storage medium | |
CN113283432A (en) | Image recognition and character sorting method and equipment | |
CN113822521B (en) | Method, device and storage medium for detecting quality of question library questions | |
CN108809896A (en) | A kind of information calibration method, device and electronic equipment | |
CN116263659A (en) | Data processing method, apparatus, computer program product, device and storage medium | |
CN113268232B (en) | Page skin generation method and device and computer readable storage medium | |
CN110968584B (en) | Portrait generation system, method, electronic device and readable storage medium | |
CN110134920A (en) | Draw the compatible display methods of text, device, terminal and computer readable 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 |