CN109542776A - Page comparison method, device and equipment - Google Patents

Page comparison method, device and equipment Download PDF

Info

Publication number
CN109542776A
CN109542776A CN201811317317.2A CN201811317317A CN109542776A CN 109542776 A CN109542776 A CN 109542776A CN 201811317317 A CN201811317317 A CN 201811317317A CN 109542776 A CN109542776 A CN 109542776A
Authority
CN
China
Prior art keywords
compared
node
node path
page
path
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811317317.2A
Other languages
Chinese (zh)
Inventor
张钊
王雪
张菊元
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Longzhixin Technology Co ltd
Original Assignee
Beijing Panda Mutual Entertainment 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 Panda Mutual Entertainment Technology Co Ltd filed Critical Beijing Panda Mutual Entertainment Technology Co Ltd
Priority to CN201811317317.2A priority Critical patent/CN109542776A/en
Publication of CN109542776A publication Critical patent/CN109542776A/en
Pending legal-status Critical Current

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
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/194Calculation of difference between files

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the present application provides a kind of page comparison method, device and equipment.Wherein, method comprises the following steps that in the control tree of first page, chooses node path to be compared;The first node path that there is same position information with the node path to be compared is chosen in the control tree of second page;When the first node path and the node path difference to be compared, determine that the second page is different from the first page.By sampling fraction, to two node paths in the control tree of first page and second page with same position information, to compare first page and second page, the accuracy rate of page comparison can be improved in technical solution provided by the embodiments of the present application.

Description

Page comparison method, device and equipment
Technical Field
The present application relates to the field of electronic technologies, and in particular, to a page comparison method, apparatus, and device.
Background
In the application test process, a comparison between pages is usually involved to determine whether two pages are the same.
In the prior art, image recognition technology is usually adopted to compare two pages, specifically: and performing screen capture processing on the two pages to be compared to obtain two page screen captures, performing image recognition on the two page screen captures, and judging whether the two pages are the same according to an image recognition result. Taking live broadcasting as an example, video pictures played by the same live broadcasting page at different times are different, and if the video pictures are compared by adopting the existing image recognition technology, the following results can be judged by mistake: two pages of the same live broadcast page at different moments are two different pages.
Therefore, the judging accuracy of the page comparison method in the prior art is low.
Disclosure of Invention
In view of the above, the present application is provided to improve a page comparison method, apparatus and device that solve the above problems, or at least partially solve the above problems.
Thus, in one embodiment of the present application, a page matching method is provided. The method comprises the following steps:
selecting a node path to be compared in a control tree of a first page;
selecting a first node path with the same position information as the node path to be compared from a control tree of a second page;
and when the first node path is different from the node path to be compared, judging that the second page is different from the first page.
Further, the method further comprises:
respectively calculating hash values of the node path to be compared and the first node path;
when the hash values of the first node path and the node path to be compared are different, judging that the first node path is different from the node path to be compared;
and when the hash values of the first node path and the node path to be compared are the same, judging that the first node path and the node path to be compared are the same.
Further, respectively calculating hash values of the node path to be compared and the first node path, including:
calculating to obtain a hash value of the node path to be compared based on the attribute information of each node in the node path to be compared and the routing sequence of the node path to be compared;
and calculating to obtain a hash value of the first node path based on the attribute information of each node in the first node path and the routing sequence of the first node path.
Further, the method further comprises:
when the first node path is the same as the node path to be compared, judging whether the number of currently compared nodes of the control tree of the first page is equal to the total number of nodes of the control tree of the first page;
when the number of the compared nodes is equal to the total number of the nodes, finishing the comparison, and judging that the second page is the same as the first page;
and when the number of the compared nodes is smaller than the total number of the nodes, continuing to select a next node path to be compared in the control tree of the first page, and triggering the comparison process of the first page and the second page based on the next node path to be compared.
Further, continuing to select a next node path to be compared in the control tree of the first page, including:
when the node path to be compared comprises an intermediate node, selecting a brother node of the intermediate node;
judging whether a second node path which is not compared exists from the brother node or not;
and if so, taking the second node path as the next node path to be compared.
Further, continuing to select a next node path to be compared in the control tree of the first page, including:
and when the node path to be compared does not comprise the intermediate node, selecting the next node path to be compared which is not compared from the root node of the control tree of the first page.
Further, the position information of the node paths to be compared includes: the level of each node on the path of the nodes to be compared and the sequencing information of each node on the level of each node;
the location information of the first node path includes: and the level of each node on the first node path and the sequencing information of each node on the level.
In another embodiment of the present application, a page matching apparatus is provided. The device includes:
the first selection module is used for selecting a node path to be compared in a control tree of a first page;
the second selection module is used for selecting a first node path which has the same position information as the node path to be compared from the control tree of the second page;
and the first judging module is used for judging that the second page is different from the first page when the first node path is different from the node path to be compared.
Further, the above apparatus further includes:
the calculation module is used for respectively calculating hash values of the node path to be compared and the first node path;
the second judging module is used for judging that the first node path is different from the node path to be compared when the hash values of the first node path and the node path to be compared are different; and when the hash values of the first node path and the node path to be compared are the same, judging that the first node path and the node path to be compared are the same.
In yet another embodiment of the present application, an electronic device is provided. The electronic device includes: a memory and a processor; wherein,
the memory is used for storing programs;
the processor, coupled with the memory, to execute the program stored in the memory to:
selecting a node path to be compared in a control tree of a first page;
selecting a first node path with the same position information as the node path to be compared from a control tree of a second page;
and when the first node path is different from the node path to be compared, judging that the second page is different from the first page.
In the technical scheme provided by the embodiment of the application, since the control tree is used for showing the control layout of the page, and the control layouts of the two pages are different, it can be determined that the two pages are different. The two node paths with the same position information on the control trees of the first page and the second page are sampled and compared to compare the first page with the second page, so that the page comparison accuracy can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic flowchart of a page comparison method according to an embodiment of the present application;
FIG. 2 is an example of a control tree of a first page according to an embodiment of the present application;
FIG. 3 is an example of a control tree for a second page according to an embodiment of the present application;
fig. 4 is a block diagram illustrating a structure of a page comparison apparatus according to an embodiment of the present application;
fig. 5 is a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
In some of the flows described in the specification, claims, and above-described figures of the present application, a number of operations are included that occur in a particular order, which operations may be performed out of order or in parallel as they occur herein. The sequence numbers of the operations, e.g., 101, 102, etc., are used merely to distinguish between the various operations, and do not represent any order of execution per se. Additionally, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel. It should be noted that, the descriptions of "first", "second", etc. in this document are used for distinguishing different messages, devices, modules, etc., and do not represent a sequential order, nor limit the types of "first" and "second" to be different.
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 shows a schematic flowchart of a page comparison method provided in an embodiment of the present application. As shown in fig. 1, the method includes:
101. and selecting a node path to be compared in the control tree of the first page.
102. And selecting a first node path with the same position information as the node path to be compared in the control tree of the second page.
103. And when the first node path is different from the node path to be compared, judging that the second page is different from the first page.
In practical application, a getROOTInActiveWindow interface can be called to convert a page into a tree structure, namely a control tree, according to the control layout of the page. The control tree comprises the hierarchical relation of each control in the corresponding page and the control information corresponding to each control. Wherein, the control information includes but is not limited to: control name, control location information, control size, control attributes, and the like. The control attribute can be clickable, draggable and the like. Each node in the control tree (except its root node) corresponds to a control in the corresponding page.
In the foregoing 101, a path of a node to be compared may be randomly selected from the control tree of the first page, for example: as shown in fig. 2, starting from the node a1 (i.e., root node) of the control tree of the first page, sequentially passing through the node a2 and the node A3, and arriving at the node a4 (i.e., leaf node), the selected node path to be compared is: a1 → A2 → A3 → A4. For another example: as shown in fig. 2, the node a5 of the control tree of the first page passes through the node a2 to reach the node a1 (i.e., the root node), i.e., the path of the selected nodes to be compared is a5 → a2 → a1 (the path may be referred to as a reverse path).
In 102, the position information of the node paths to be compared includes: and comparing the hierarchy of each node on the node path to be compared and the sequencing information of each node on the hierarchy. The location information of the first node path includes: and the hierarchy of each node on the first node path and the sequencing information of each node on the hierarchy of each node. It should be noted that the branch tree on the path from the root node to a certain node in the tree is called the level of the node, the level of the root node is defined as 1, and the levels of the other nodes are equal to the level +1 of the parent node. A plurality of nodes at the same level are sequentially arranged from left to right, and the arrangement number of each node is the ordering information of each node, for example: as shown in fig. 2, the node A3 at the level of the level 3 has ranking information of 1, the node a5 has ranking information of 2, and the node A8 has ranking information of 3.
The node path to be compared and the first node path have the same position information means that: the two opposite nodes on the node path to be compared and the first node path have the same level and the respective ordering information at the level of the two opposite nodes is also the same. It should be noted that the two opposite nodes on the node path to be compared and the first node path include a node (referred to as a first node for the following description convenience) located on the node path to be compared and a node (referred to as a second node for the following description method) located on the first node path, and the routing order of the first node on the node path to be compared is the same as the routing order of the second node on the first node path.
For example, as shown in fig. 2, the node-to-be-compared path L1 is: a1 → a2 → A3 → a4, wherein the way rank of a1 is 1, the way rank of a2 is 2, the way rank of A3 is 3, and the way rank of a4 is 4; as shown in fig. 3, the first node path L2 is: b1 → B2 → B3 → B4, wherein the way rank of B1 is 1, the way rank of B2 is 2, the way rank of B3 is 3, and the way rank of B4 is 4. A1 and B1 are two opposite nodes, the levels of A1 and B1 are both 1, and the ordering information of the levels is 1; a2 and B2 are two opposite nodes, the levels of A2 and B2 are both 2, and the ordering information of the levels is 1; a3 and B3 are two opposite nodes, the levels of A3 and B3 are both 3, and the ordering information of the levels is 1; a4 and B4 are two opposite nodes, the hierarchy of A4 and B4 is 4, and the ordering information of the hierarchy of A4 and B4 is 1.
It should be noted that, if the first node path having the same position information as the path to be compared cannot be found in the control tree of the second page, it may also be directly determined that the second page is different from the first page.
In 103, whether the first node path is the same as the node path to be compared is determined by comparing the first node path with the node path to be compared. If the first node path is different from the node path to be compared, the second page can be directly judged to be different from the first page. If the two node paths are the same, two node paths which are not compared and have the same position information are continuously selected from the control tree of the first page and the control tree of the second page, and the comparison is carried out.
In the technical scheme provided by the embodiment of the application, since the control tree is used for showing the control layout of the page, and the control layouts of the two pages are different, it can be determined that the two pages are different. The two node paths with the same position information on the control trees of the first page and the second page are sampled and compared to compare the first page with the second page, so that the page comparison accuracy can be improved. Compared with the prior art, the method can effectively avoid the problems of misjudgment and the like caused by the change of certain dynamic page elements (such as videos and dynamic images) in the page.
In addition, the technical scheme provided by the embodiment of the application not only can reduce the calculation amount by sampling and comparing the node paths, but also can quickly distinguish different pages, thereby accelerating the page comparison speed and improving the comparison efficiency.
In order to improve the accuracy of the comparison result between the first node path and the node path to be compared, the hash values of the first node path and the node path to be compared may be calculated respectively, and whether the first node path and the node path to be compared are the same may be determined according to the comparison result of the hash values. Specifically, the method may further include:
104. and respectively calculating the hash values of the node path to be compared and the first node path.
105. And when the hash values of the first node path and the node path to be compared are different, judging that the first node path is different from the node path to be compared.
106. And when the hash values of the first node path and the node path to be compared are the same, judging that the first node path and the node path to be compared are the same.
In the step 104, a hash algorithm may be established in advance according to actual requirements, and the information of the node path to be calculated is used as the input of the hash algorithm, and the output of the hash algorithm is the hash value of the node path to be calculated. The hash algorithm establishment process can be referred to in the prior art, and is not described in detail herein.
In an implementation scheme, the hash value of the node path to be compared is calculated based on the attribute information of each node in the node path to be compared and the routing sequence of the node path to be compared. The hash value of the first node path can be calculated based on the attribute information of each node in the first node path and the routing sequence of the first node path. Specifically, the attribute information of each node in the node paths to be compared and the routing sequence of the node paths to be compared can be used as the input of the hash algorithm, and the output of the hash algorithm is the hash value of the node paths to be compared; and taking the attribute information of each node in the first node path and the routing sequence of the first node path as the input of a hash algorithm, wherein the output of the hash algorithm is the hash value of the first node path.
The attribute information of the node is also control information of the corresponding control, including but not limited to: control name, control location information, control size, control attributes, and the like.
And when the hash values of the first node path and the node path to be compared are different, judging that the first node path is different from the node path to be compared. And when the hash values of the first node path and the node path to be compared are the same, judging that the first node path and the node path to be compared are the same.
If the first node path is determined to be different from the node path to be compared in 103, the second page may be determined to be different from the second page, and the comparison process related to the first page and the second page may be ended; if the first node path is judged to be the same as the path of the node to be compared, whether comparison of other paths is continued or not is judged, whether all nodes in the control tree of the first page are compared or not is judged, if all nodes in the control tree of the first page are compared, the comparison process of the first page and the second page can be finished, and the first page and the second page are judged to be the same; if the control tree of the first page has nodes which are not compared, the comparison of other paths needs to be continued. Specifically, the method may further include:
107. and when the first node path is the same as the node path to be compared, judging whether the number of currently compared nodes of the control tree of the first page is equal to the total number of nodes of the control tree of the first page.
108. And when the number of the compared nodes is equal to the total number of the nodes, ending the comparison, and judging that the second page is the same as the first page.
109. And when the number of the compared nodes is smaller than the total number of the nodes, continuing to select a next node path to be compared in the control tree of the first page, and triggering the comparison process of the first page and the second page based on the next node path to be compared.
If the number of currently compared nodes of the control tree of the first page is equal to the total number of nodes of the control tree of the first page, it is indicated that all the nodes in the control tree of the first page are compared, and therefore, the comparison process needs to be ended, and it is determined that the second page is the same as the first page. If the number of the currently compared nodes of the control number of the first page is less than the total number of the nodes of the control tree of the first page, it is indicated that there are nodes which are not compared in the control tree of the first page, and it is necessary to continue to select the next node path to be compared in the control tree of the first page. And triggering the comparison process of the first page and the second page based on the next node path to be compared. The comparison process of the first page and the second page based on the next node path to be compared may be performed with reference to corresponding contents in the above embodiments, and details are not repeated here.
In an implementation scheme, in the step 109, "continue to select the next node path to be compared in the control tree of the first page", the following steps may be specifically adopted:
1091. and when the node path to be compared comprises the middle node, selecting a brother node of the middle node.
1092. And judging whether a second node path which is not compared exists from the brother node or not.
1093. And if so, taking the second node path as the next node path to be compared.
For example: as shown in fig. 2, the node-to-be-compared path L1 is: a1 → A2 → A3 → A4, wherein the intermediate node has A2 and A3; sibling node A5 of intermediate node A3 may be selected; from the sibling node a5, there are two node paths, which are: a5 → A2 → A1 and A5 → A6, judging the path A5 → A2 → A1 is compared and the path A5 → A6 is not compared by the log recorded with the compared node paths. Therefore, the path A5 → A6 is used as the next node path to be compared.
Further, the step 109 of "continuously selecting the next node path to be compared in the control tree of the first page" may further include the following steps:
1094. and when the node path to be compared does not comprise the intermediate node, selecting the next node path to be compared which is not compared from the root node of the control tree of the first page.
Compared with the prior art, the technical scheme provided by the embodiment of the application can effectively avoid the problems of misjudgment and the like caused by the change of certain dynamic page elements (such as videos and dynamic images) in the page. In addition, according to the technical scheme provided by the embodiment of the application, through node path sampling comparison, the calculation amount can be reduced, different pages can be rapidly distinguished, the page comparison speed is increased, and the comparison efficiency is improved.
Fig. 4 shows a block diagram of a page matching apparatus according to an embodiment of the present application. As shown in fig. 4, the page matching apparatus includes: a first selecting module 401, a second selecting module 402 and a first judging module 403. Wherein,
a first selection module 401, configured to select a node path to be compared from a control tree of a first page;
a second selecting module 402, configured to select, from a control tree of a second page, a first node path having the same position information as the node path to be compared;
a first determining module 403, configured to determine that the second page is different from the first page when the first node path is different from the node path to be compared.
In the technical scheme provided by the embodiment of the application, since the control tree is used for showing the control layout of the page, and the control layouts of the two pages are different, it can be determined that the two pages are different. The two node paths with the same position information on the control trees of the first page and the second page are sampled and compared to compare the first page with the second page, so that the page comparison accuracy can be improved. Compared with the prior art, the method can effectively avoid the problems of misjudgment and the like caused by the change of certain dynamic page elements (such as videos and dynamic images) in the page.
In addition, the technical scheme provided by the embodiment of the application not only can reduce the calculation amount by sampling and comparing the node paths, but also can quickly distinguish different pages, thereby accelerating the page comparison speed and improving the comparison efficiency.
Further, the above apparatus further includes:
the calculation module is used for respectively calculating hash values of the node path to be compared and the first node path;
the second judging module is used for judging that the first node path is different from the node path to be compared when the hash values of the first node path and the node path to be compared are different; and when the hash values of the first node path and the node path to be compared are the same, judging that the first node path and the node path to be compared are the same.
Further, the calculation module is specifically configured to:
calculating to obtain a hash value of the node path to be compared based on the attribute information of each node in the node path to be compared and the routing sequence of the node path to be compared;
and calculating to obtain a hash value of the first node path based on the attribute information of each node in the first node path and the routing sequence of the first node path.
Further, the above apparatus further includes:
the first judging module is used for judging whether the number of currently compared nodes of the control tree of the first page is equal to the total number of nodes of the control tree of the first page when the first node path is the same as the path of the node to be compared;
the second judging module is used for finishing the comparison when the number of the compared nodes is equal to the total number of the nodes, and judging that the second page is the same as the first page;
the first selecting module 401 is further configured to, when the number of currently compared nodes is smaller than the total number of nodes, continue to select a next node path to be compared in the control tree of the first page, and trigger a comparison process between the first page and the second page based on the next node path to be compared.
Further, the first selecting module 401 is specifically configured to:
when the node path to be compared comprises an intermediate node, selecting a brother node of the intermediate node;
judging whether a second node path which is not compared exists from the brother node or not;
and if so, taking the second node path as the next node path to be compared.
Further, the first selecting module 401 is further specifically configured to:
and when the node path to be compared does not comprise the intermediate node, selecting the next node path to be compared which is not compared from the root node of the control tree of the first page.
Further, the position information of the node paths to be compared includes: the level of each node on the path of the nodes to be compared and the sequencing information of each node on the level of each node;
the location information of the first node path includes: and the level of each node on the first node path and the sequencing information of each node on the level.
It should be noted that the page comparison device provided in this embodiment can implement the technical solutions provided in the above-mentioned embodiments of the page comparison method, and specific implementation principles can refer to corresponding contents in the above-mentioned embodiments, which are not described herein again.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application. The electronic device includes: a memory 1101, and a processor 1102. The memory 1101 may be configured to store other various data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device. The memory 1101 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The processor 1102, coupled to the memory 1101, is configured to execute the program stored in the memory 1101 to:
selecting a node path to be compared in a control tree of a first page;
selecting a first node path with the same position information as the node path to be compared from a control tree of a second page;
and when the first node path is different from the node path to be compared, judging that the second page is different from the first page.
When the processor 1102 executes the program in the memory 1101, the processor 1102 may also implement other functions in addition to the above functions, which may be specifically referred to the description of the foregoing embodiments.
Further, as shown in fig. 5, the electronic device further includes: communication components 1103, display 1104, power components 1105, audio components 1106, and the like. Only some of the components are schematically shown in fig. 5, and it is not meant that the electronic device comprises only the components shown in fig. 5.
Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, where the computer program, when executed by a computer, can implement the steps or functions of the page comparison method provided in each of the above embodiments.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (10)

1. A page comparison method is characterized by comprising the following steps:
selecting a node path to be compared in a control tree of a first page;
selecting a first node path with the same position information as the node path to be compared from a control tree of a second page;
and when the first node path is different from the node path to be compared, judging that the second page is different from the first page.
2. The method of claim 1, further comprising:
respectively calculating hash values of the node path to be compared and the first node path;
when the hash values of the first node path and the node path to be compared are different, judging that the first node path is different from the node path to be compared;
and when the hash values of the first node path and the node path to be compared are the same, judging that the first node path and the node path to be compared are the same.
3. The method according to claim 2, wherein calculating the hash values of the node path to be compared and the first node path respectively comprises:
calculating to obtain a hash value of the node path to be compared based on the attribute information of each node in the node path to be compared and the routing sequence of the node path to be compared;
and calculating to obtain a hash value of the first node path based on the attribute information of each node in the first node path and the routing sequence of the first node path.
4. The method of any of claims 1 to 3, further comprising:
when the first node path is the same as the node path to be compared, judging whether the number of currently compared nodes of the control tree of the first page is equal to the total number of nodes of the control tree of the first page;
when the number of the currently compared nodes is equal to the total number of the nodes, finishing the comparison, and judging that the second page is the same as the first page;
and when the number of the currently compared nodes is smaller than the total number of the nodes, continuing to select a next node path to be compared in the control tree of the first page, and triggering the comparison process of the first page and the second page based on the next node path to be compared.
5. The method of claim 4, wherein continuing to select a next node path to be compared in the control tree of the first page comprises:
when the node path to be compared comprises an intermediate node, selecting a brother node of the intermediate node;
judging whether a second node path which is not compared exists from the brother node or not;
and if so, taking the second node path as the next node path to be compared.
6. The method of claim 4, wherein continuing to select a next node path to be compared in the control tree of the first page comprises:
and when the node path to be compared does not comprise the intermediate node, selecting the next node path to be compared which is not compared from the root node of the control tree of the first page.
7. The method according to any one of claims 1 to 3,
the position information of the node paths to be compared comprises: the level of each node on the path of the nodes to be compared and the sequencing information of each node on the level of each node;
the location information of the first node path includes: and the level of each node on the first node path and the sequencing information of each node on the level.
8. A page comparison device, comprising:
the first selection module is used for selecting a node path to be compared in a control tree of a first page;
the second selection module is used for selecting a first node path which has the same position information as the node path to be compared from the control tree of the second page;
and the first judging module is used for judging that the second page is different from the first page when the first node path is different from the node path to be compared.
9. The apparatus of claim 8, further comprising:
the calculation module is used for respectively calculating hash values of the node path to be compared and the first node path;
the second judging module is used for judging that the first node path is different from the node path to be compared when the hash values of the first node path and the node path to be compared are different; and when the hash values of the first node path and the node path to be compared are the same, judging that the first node path and the node path to be compared are the same.
10. An electronic device, comprising: a memory and a processor; wherein,
the memory is used for storing programs;
the processor, coupled with the memory, to execute the program stored in the memory to:
selecting a node path to be compared in a control tree of a first page;
selecting a first node path with the same position information as the node path to be compared from a control tree of a second page;
and when the first node path is different from the node path to be compared, judging that the second page is different from the first page.
CN201811317317.2A 2018-11-07 2018-11-07 Page comparison method, device and equipment Pending CN109542776A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811317317.2A CN109542776A (en) 2018-11-07 2018-11-07 Page comparison method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811317317.2A CN109542776A (en) 2018-11-07 2018-11-07 Page comparison method, device and equipment

Publications (1)

Publication Number Publication Date
CN109542776A true CN109542776A (en) 2019-03-29

Family

ID=65846125

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811317317.2A Pending CN109542776A (en) 2018-11-07 2018-11-07 Page comparison method, device and equipment

Country Status (1)

Country Link
CN (1) CN109542776A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110704779A (en) * 2019-09-27 2020-01-17 杭州迪普科技股份有限公司 Website page access compliance detection method, device and equipment
CN111079403A (en) * 2019-12-10 2020-04-28 深圳市兴之佳科技有限公司 Page comparison method and device
CN114281454A (en) * 2021-12-17 2022-04-05 杭州逗酷软件科技有限公司 Information auxiliary processing method, device, equipment and computer readable storage medium
CN115098362A (en) * 2022-06-16 2022-09-23 北京百度网讯科技有限公司 Page testing method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102316081A (en) * 2010-06-30 2012-01-11 北京启明星辰信息技术股份有限公司 Method and device for identifying similar webpage
CN102682098A (en) * 2012-04-27 2012-09-19 北京神州绿盟信息安全科技股份有限公司 Method and device for detecting web page content changes
US8689189B1 (en) * 2008-02-15 2014-04-01 Amazon Technologies, Inc. Systems and methods for testing widgets
CN106960058A (en) * 2017-04-05 2017-07-18 金电联行(北京)信息技术有限公司 A kind of structure of web page alteration detection method and system
CN107566354A (en) * 2017-08-22 2018-01-09 北京小米移动软件有限公司 Web page contents detection method, device and storage medium
CN108052539A (en) * 2017-11-20 2018-05-18 烽火通信科技股份有限公司 A kind of browser page switching method and browser

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8689189B1 (en) * 2008-02-15 2014-04-01 Amazon Technologies, Inc. Systems and methods for testing widgets
CN102316081A (en) * 2010-06-30 2012-01-11 北京启明星辰信息技术股份有限公司 Method and device for identifying similar webpage
CN102682098A (en) * 2012-04-27 2012-09-19 北京神州绿盟信息安全科技股份有限公司 Method and device for detecting web page content changes
CN106960058A (en) * 2017-04-05 2017-07-18 金电联行(北京)信息技术有限公司 A kind of structure of web page alteration detection method and system
CN107566354A (en) * 2017-08-22 2018-01-09 北京小米移动软件有限公司 Web page contents detection method, device and storage medium
CN108052539A (en) * 2017-11-20 2018-05-18 烽火通信科技股份有限公司 A kind of browser page switching method and browser

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110704779A (en) * 2019-09-27 2020-01-17 杭州迪普科技股份有限公司 Website page access compliance detection method, device and equipment
CN111079403A (en) * 2019-12-10 2020-04-28 深圳市兴之佳科技有限公司 Page comparison method and device
CN111079403B (en) * 2019-12-10 2023-08-08 深圳市兴之佳科技有限公司 Page comparison method and device
CN114281454A (en) * 2021-12-17 2022-04-05 杭州逗酷软件科技有限公司 Information auxiliary processing method, device, equipment and computer readable storage medium
CN115098362A (en) * 2022-06-16 2022-09-23 北京百度网讯科技有限公司 Page testing method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109542776A (en) Page comparison method, device and equipment
US9003289B2 (en) Automatic detection of suggested video edits
US20240314398A1 (en) Video processing method and apparatus, and device and storage medium
CN111309424B (en) Page restoration method and related equipment
US20170168668A1 (en) Method and electronic device for displaying menu on apparatus
CN112100071B (en) Test case generation method and device, computer equipment and storage medium
CN106303740A (en) The desktop navigation system of intelligent television and the implementation method of this system
CN110457628A (en) Webpage edition correcting method, device, equipment and storage medium
CN110458875B (en) Abnormal point pair detection method, image splicing method, corresponding device and equipment
CN107609175A (en) Dom tree generation method and relevant device
CN114579912A (en) Page layout method, device, equipment and medium
CN103605696A (en) Method and device for acquiring audio-video file addresses
CN111258434A (en) Method, device, equipment and storage medium for inserting pictures into chat interface
CN115119014A (en) Video processing method, and training method and device of frame insertion quantity model
CN109240678B (en) Code generation method and device
US8655865B1 (en) Method and apparatus for indexing rich internet content using contextual information
CN114495190B (en) Training method of face-changing network model, image face-changing method and related equipment
US20180165290A1 (en) Media file browsing method and information processing device
US11574001B2 (en) Method and apparatus for generating unordered list, method for managing images and terminal device
CN114565767A (en) Image segmentation method and device
US20230124474A1 (en) Multimedia file playing method and apparatus for rotatable device
US11677929B2 (en) Apparatus and method for displaying multi-depth image
CN113656739A (en) Website data storage method and device
CN114328171A (en) Method, device and equipment for generating test case library and storage medium
CN109495772B (en) Video quality sequencing method and system

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20210310

Address after: 101300 309, 3rd floor, 60 Fuqian 1st Street, Tianzhu District, Shunyi District, Beijing

Applicant after: Beijing longzhixin Technology Co.,Ltd.

Address before: 100041 room 120, 4th floor, building 17, yard 30, Shixing street, Shijingshan District, Beijing

Applicant before: BEIJING PANDA MUTUAL ENTERTAINMENT TECHNOLOGY Co.,Ltd.

WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20190329