A method, apparatus, device, and storage medium for determining the scene category of a page.

By obtaining and comparing the node tree corresponding to the XML document, and calculating the similarity based on the node arrangement and type information, the problem of inaccurate determination of page scene categories in automated testing is solved, and more accurate testing results are achieved.

CN115904977BActive Publication Date: 2026-03-10DOUYIN VISION CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-25
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing technologies cannot accurately determine the scene category of a page during automated testing, resulting in poor test results.

Method used

By obtaining the node trees corresponding to the first and second Extensible Markup Language documents, the set of nodes within the comparison range is determined, and the similarity of the node sets is calculated based on the arrangement and type information of the nodes to determine the scene category of the page.

Benefits of technology

This paper provides a technical solution for accurately determining the page scene category under automated testing and other similar conditions, which meets the needs of automated testing and improves the testing effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115904977B_ABST
    Figure CN115904977B_ABST
Patent Text Reader

Abstract

This disclosure provides a method, apparatus, electronic device, and computer storage medium for determining the scene category of a page, addressing the problem of accurately determining the scene category of a page. The method includes: obtaining a first node tree corresponding to a first Extensible Markup Language (XML) document and a second node tree corresponding to a second XML document; the first and second XML documents respectively describing the layout of a first page and the layout of a second page; determining a first set of nodes within the comparison range on the first node tree and a second set of nodes within the comparison range on the second node tree; determining a similarity comparison result of the arrangement positions of nodes of the same type in the first and second node sets based on the arrangement positions and type information of nodes in the first and second node sets respectively on the first and second node trees; and determining the scene category of the first page and / or the second page based on the similarity comparison result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of Internet technology, and in particular to a method, apparatus, electronic device, and computer-readable storage medium for determining the scene category of a page. Background Technology

[0002] Currently, in the process of automatically testing applications (APPs), automated testing tools have a type of testing requirement that triggers corresponding operations based on the current page context of the APP, thereby completing the relevant tests.

[0003] In this process, determining the scene category of the current page plays a decisive role in the test results. Specifically, if the scene category of the page is determined incorrectly, the operations triggered by the automated testing tool based on the determined scene category will not match the interface to which the page belongs, which will greatly affect the test results.

[0004] In automated testing and other similar situations, accurately determining the scenario category of the current page is a technical problem that urgently needs to be solved. Summary of the Invention

[0005] This disclosure provides a method for determining the scene category of a page, thereby solving the problem of how to accurately determine the scene category of a page in the prior art under automated testing and other similar circumstances.

[0006] This disclosure also provides an apparatus, electronic device, and computer storage medium for determining the scene category of a page.

[0007] The embodiments disclosed herein employ the following technical solutions:

[0008] A method for determining the scene category of a page, the method comprising:

[0009] Obtain the first node tree corresponding to the first Extensible Markup Language (XML) document and the second node tree corresponding to the second XML document; the first XML document is used to describe the layout of the first page; the second XML document is used to describe the layout of the second page.

[0010] Determine a first set of nodes on the first node tree that are within the comparison range, and a second set of nodes on the second node tree that are within the comparison range; the comparison range corresponds at least to the basic structure of the first node tree or the second node tree used to characterize the basic functions of the page;

[0011] Based on the arrangement positions of nodes in the first node set on the first node tree, the arrangement positions of nodes in the second node set on the second node tree, the type information of nodes in the first node set, and the type information of nodes in the second node set, the similarity comparison results of the arrangement positions of nodes of the same type in the first node set and the second node set are determined.

[0012] Based on the similarity comparison results, the scene category of the first page and / or the second page is determined.

[0013] An apparatus for determining the scene category of a page, the apparatus comprising:

[0014] The node tree acquisition unit is used to acquire a first node tree corresponding to a first Extensible Markup Language (XML) document and a second node tree corresponding to a second XML document; the first XML document is used to describe the layout of a first page; the second XML document is used to describe the layout of a second page.

[0015] A node determination unit is used to determine a first set of nodes in the first node tree that are within a comparison range, and a second set of nodes in the second node tree that are within the comparison range; the comparison range corresponds at least to the basic structure of the first node tree or the second node tree used to characterize the basic functions of the page;

[0016] The comparison unit is used to determine the similarity comparison result of the arrangement positions of the same type of nodes in the first node set and the second node set based on the arrangement positions of the nodes in the first node set in the first node tree, the arrangement positions of the nodes in the second node set in the second node tree, the type information of the nodes in the first node set, and the type information of the nodes in the second node set.

[0017] The scene category determination unit is used to determine the scene category of the first page and / or the second page based on the similarity comparison result.

[0018] An electronic device includes: a memory and a processor, wherein,

[0019] The memory is used to store programs;

[0020] The processor, coupled to the memory, is used to execute the program stored in the memory for performing the method as described above.

[0021] A computer-readable storage medium storing a computer program that, when executed by a computer, enables the implementation of the methods described above.

[0022] The above-described at least one technical solution adopted in the embodiments of this disclosure can achieve the following beneficial effects:

[0023] Since the comparison range corresponds at least to the basic structure of the first node tree or the second node tree used to characterize the basic functions of the page, the scheme provided by the embodiments of this disclosure determines the scene category of the first page and / or the second page by comparing the similarity of the arrangement positions of the same type of nodes in the first node set and the second node set within the comparison range. This is equivalent to determining the scene category of the page based on the similarity of "page functions", which meets the needs of determining the scene category of the page under automatic testing and other similar conditions. This provides a technical solution for accurately determining the scene category of the page under automatic testing and other similar conditions. Attached Figure Description

[0024] The accompanying drawings, which are included to provide a further understanding of this disclosure and form part of this disclosure, illustrate exemplary embodiments of the present disclosure and are used to explain the disclosure, but do not constitute an undue limitation of the disclosure. In the drawings:

[0025] Figure 1a A flowchart illustrating the specific implementation of a method for determining the scene category of a page, as provided in this embodiment of the disclosure;

[0026] Figure 1b This is a schematic diagram of the node tree structure corresponding to a page in Embodiment 1 of this disclosure, which serves as an example.

[0027] Figure 1c This is a schematic diagram of a template page used as an example in Embodiment 1 of this disclosure;

[0028] Figure 1d For Figure 1c The diagram shows the structure of the node tree obtained by parsing the XML document of the template page.

[0029] Figure 1e This is a schematic diagram of the first and second pages used as examples in Embodiment 1 of this disclosure;

[0030] Figure 1f This is a schematic diagram of the first node tree and the first node set as an example in Embodiment 1 of this disclosure;

[0031] Figure 1g This is a schematic diagram of the second node tree and the second node set as an example in Embodiment 1 of this disclosure;

[0032] Figure 2a A schematic diagram illustrating the specific implementation process of the method provided in Embodiment 1 of this disclosure in practice;

[0033] Figure 2bThis is a schematic diagram of a portion of the pages to be clustered in Embodiment 2 of this disclosure;

[0034] Figure 3 A schematic diagram of the specific structure of a device for determining the scene category of a page, provided in Embodiment 3 of this disclosure;

[0035] Figure 4 This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of this disclosure. Detailed Implementation

[0036] To make the objectives, technical solutions, and advantages of this disclosure clearer, the technical solutions of this disclosure will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without creative effort are within the scope of protection of this disclosure.

[0037] As will be known to those skilled in the art, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of this disclosure are also applicable to similar technical problems.

[0038] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same properties in the description of embodiments of this disclosure. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements but may include other elements not expressly listed or inherent to those processes, methods, products, or apparatuses.

[0039] The following is an explanation of some terms used in the embodiments of this disclosure:

[0040] Pages:

[0041] This refers to the content displayed on the screen of a computing device. Generally speaking, the B / S structure has pages, while the C / S structure has another similar term called "window".

[0042] Extensible Markup Language (XML):

[0043] XML is a source language that allows users to define their own markup language, which can be used to mark up data, define data types, etc. An XML document is in plain text format and contains XML elements. Each XML element includes a start tag, an end tag, and content between the two tags.

[0044] XML documents can be used to lay out the components (such as buttons and text boxes) contained on a page. Therefore, the relationship between XML documents and pages can be described as follows: XML documents can be used to describe the layout of a page.

[0045] Node tree:

[0046] An XML parser can be used to parse an XML document into a tree structure, which can be called a node tree.

[0047] Example 1

[0048] To address the problem of accurately determining the scene category of a page in existing technologies under automated testing and other similar conditions, Embodiment 1 of this disclosure provides a method for determining the scene category of a page.

[0049] The executing entity of this method can be a server or a server cluster, which can be local or cloud-based. The executing entity can also be, for example, a test device, a mobile phone, a personal computer, a wearable device, or other user device. That is, the executing entity of this method can be any computing device capable of implementing the method; this disclosure does not limit the type of computing device used as the executing entity.

[0050] Furthermore, different steps of the method can be implemented by different computing devices. This disclosure does not limit which computing device is used to implement which step.

[0051] For ease of description, the following uses the test device as the execution subject of this method as an example to provide a detailed description of the method provided in Embodiment 1 of this disclosure.

[0052] Please refer to the attached instruction manual. Figure 1a The following is a flowchart illustrating the specific implementation of a method for determining the scene category of a page according to Embodiment 1 of this disclosure, including the following steps:

[0053] Step 11: The test device obtains the first node tree and the second node tree corresponding to the first XML document and the second XML document, respectively;

[0054] The first XML document describes the layout of the first page; the second XML document describes the layout of the second page.

[0055] The first page and the second page mentioned in step 11 can both be pages whose scene categories are to be determined, or only one of the first page and the second page can be a page whose scene category is to be determined, while the other page can be a page whose scene category has been determined.

[0056] The first page and the second page can be pages from the same app or pages from different apps; alternatively, the first page and the second page can be pages from the same website or pages from different websites; the first page and the second page can be pages contained within the same interface or pages contained within different interfaces. This disclosure does not limit the type of the first page and the second page, nor the relationship between them.

[0057] when Figure 1a When the execution subject of the method shown is a test device, the test device can obtain the two documents from the storage space that stores the first XML document and the second XML document respectively, and then parse them respectively by calling the XML parser to obtain the first node tree and the second node tree.

[0058] Alternatively, the first and second XML documents can be directly entered or sent to the test device.

[0059] Alternatively, an XML parser can be used to pre-process the first XML document and the second XML document to obtain the first node tree and the second node tree respectively, and store them in a specified storage space, so that the test device can directly obtain the first node tree and the second node tree from the specified storage space.

[0060] Alternatively, the first and second node trees can be directly input or sent to the test device.

[0061] This disclosure does not limit how the first node tree and the second node tree are obtained.

[0062] It should be noted that, in terms of the specific structure of the node tree, the entire XML document can correspond to the document object, the attributes of XML elements can correspond to the attribute object, the XML element itself can correspond to the Element object (such as controls, images, etc.), and the text in the XML document can correspond to the Text object.

[0063] All of the above objects can be parsed by the XML parser into nodes in the node tree. In other words, each node in the node tree corresponds to an object.

[0064] Each node stores at least some attribute information. This attribute information includes the node's type information. The node's type information represents the type of the object corresponding to the node. The object type can specifically include, but is not limited to: images, text, animations, videos, hyperlinks, tables, and controls, etc. For controls, further subcategories include windows, text boxes, buttons, drop-down menus, etc., or they can be divided into operable controls (such as buttons, drop-down menus, etc.) and non-operable controls (such as non-operable windows, non-operable text boxes, etc.).

[0065] In addition, some definitions related to node trees are as follows:

[0066] In a node tree, the node at the top is called the root node;

[0067] Every node except the root node has a parent node;

[0068] Any parent node can have any number of child nodes;

[0069] A leaf node is a node that has no children.

[0070] Sibling nodes (or sibling nodes) are nodes that share the same parent node.

[0071] To visually demonstrate the structure of the node tree, let's take a page displaying a book as an example. The content of the corresponding XML document for this page is as follows:

[0072] <bookstore> <book category="COOKING"> <title lang="en"> Everyday Italian< / title> <author> Giada De Laurentiis< / author> <year> 2005< / year> <price> 30.00< / price> < / book> <book category="CHILDREN"> <title lang="en"> Harry Potter< / title> <author> J. K. Rowling< / author> <year> 2005< / year> <price> 29.99< / price> < / book> <bookcategory="WEB"> <title lang="en"> Learning XML< / title> <author> Erik T. Ray< / author> <year> 2003< / year> <price> 39.95< / price> < / bookstore>

[0073] As can be seen from the above, the XML root element in an XML document is <bookstore>All of the documents in this XML document <book>All elements are contained within <bookstore>In the middle. And, <book>The element has 4 child XML elements: <title>、< / title> <author> 、 <year> 、 <price>.

[0074] If the above XML document is parsed into a node tree, the following can be obtained: Figure 1b The node tree shown.

[0075] exist Figure 1b In the node tree shown, the root node corresponds to the root element. <bookstore>The node in the next level below the root element corresponds to <book>element; <book>The node in the next level below the element's level corresponds to <book>The element has four child XML elements: <title>、< / title> <author> 、 <year> 、 <price>.

[0076] Generally speaking, the closer a level is to the root node, the greater the likelihood that the XML elements corresponding to the nodes it contains belong to the basic structure of the page; conversely, the further away a level is from the root node, the less likely that the XML elements corresponding to the nodes it contains belong to the basic structure of the page.

[0077] The basic structure of a page generally represents its basic functions. Different pages typically have different basic functions.

[0078] For example Figure 1b Taking the node tree shown as an example, the basic function of this page could include "displaying a book in the bookstore". The underlying infrastructure corresponding to this basic function could include the root node, the corresponding node, and so on. <book>The child nodes.

[0079] For example Figure 1c Taking the page shown as an example, its basic functions may include: "Display video content", "Watch World Cup themed videos (corresponding to the text "World Cup" at the top of the interface)", "Watch live streams of people you follow (corresponding to the text "Following" at the top of the interface)", "Enter the store (corresponding to the text "Store" at the top of the interface)", "Search (corresponding to the search icon in the upper right corner of the page)", "Click to enter the live stream room (corresponding to the shopping cart icon)", "Return to the homepage (corresponding to the 'Homepage' option at the bottom of the page)", "Enter the page to view friends' activities (corresponding to the 'Friends' option at the bottom of the page)", "Enter the message sending page (corresponding to the 'Messages' option at the bottom of the page)", "Enter the 'Me' page (corresponding to the 'Me' option at the bottom of the page)", etc. In the node tree corresponding to this page, these basic functions generally correspond to the root node and nodes at the node level that are close to the root node.

[0080] Step 12: The testing device determines the first set of nodes in the first node tree that are within the comparison range, and the second set of nodes in the second node tree that are within the comparison range;

[0081] The comparison range corresponds at least to the basic structure of the first node tree or the second node tree. This basic structure may include, for example, the level to which the root node belongs; and levels whose level difference with the level to which the root node belongs is less than a threshold.

[0082] In this embodiment of the disclosure, step 12 may be implemented in three ways, including but not limited to the following three:

[0083] The first method is as follows: Based on the business characteristics of the target page, query the pre-set correspondence between each business characteristic and the comparison range information; based on the queried comparison range information corresponding to the business characteristics of the target page, determine the comparison range; based on the comparison range, determine the first set of nodes in the first node tree that are within the comparison range, and the second set of nodes in the second node tree that are within the comparison range.

[0084] The target page is the first page and / or the second page.

[0085] In one optional implementation, for example, the correspondence between different business features and the threshold can be pre-set as shown in Table 1 below. Thus, the test device can determine the corresponding threshold by querying such correspondence based on the business features of the target page. Then, based on the determined threshold, the tree structure consisting of the level to which the root node belongs and the levels whose level difference with the level to which the root node belongs is less than the threshold can be used as the basic structure.

[0086] The threshold mentioned here is used to determine the comparison range, which is equivalent to the comparison range information mentioned above.

[0087] In one alternative implementation, the threshold can be set manually. Furthermore, the threshold can be adjusted based on the effectiveness of determining the scene categories for the first and second pages. For example, if a threshold of 3 is set for the business feature "video recommendation," and the classification accuracy is deemed insufficient based on subsequent determinations of the scene categories for pages with this business feature, then the threshold can be appropriately increased.

[0088] Table 1:

[0089]

[0090] In an optional implementation, the correspondence between business features and comparison range information can be established using the following sub-steps I-III:

[0091] Sub-step I: The testing equipment can receive input from technicians, including a page as a template page, the business characteristics of the template page, and an XML document describing the template page;

[0092] The information received by the testing equipment can be stored as expert knowledge in the "expert knowledge base".

[0093] In one example, the template page may be as shown in the appendix to the specification. Figure 1c As shown, this could specifically be a video recommendation page. The business characteristic of this video recommendation page could be, for example, "video recommendation".

[0094] Sub-step II: The test device can obtain the node tree corresponding to the template page by parsing the XML document of the template page;

[0095] Continuing with the previous example, let's assume that the instruction manual includes... Figure 1c Parsing the XML document corresponding to the video recommendation page shown can yield the corresponding node tree, as shown in the attached instruction manual. Figure 1d As shown.

[0096] Sub-step III: Based on the business characteristics of the template page and the tree structure (i.e., basic structure) in the corresponding node tree of the template page that can represent the business characteristics, establish the correspondence between the page characteristics and the comparison range of the node tree.

[0097] Pages with different business characteristics often have different tree structures in their node trees that represent those characteristics. For example, a page with business characteristic A might have a tree structure representing that characteristic that includes a root node (e.g., level 0 of the node tree) and level 1 nodes; a page with business characteristic B might have a tree structure representing that characteristic that includes a root node and level 1 and level 2 nodes; ... For example... Figure 1d The node tree shown can represent the business feature "video recommendation" in a tree structure, such as a root node, first-level nodes, and second-level nodes.

[0098] In real-world scenarios, the basic structure of the node tree can be determined based on actual needs. These needs—such as specifying the node layers for a page with a particular business characteristic or information like thresholds or comparison ranges—can be proposed by the requester and then input into the testing equipment by technical personnel. Alternatively, the testing equipment can analyze the types of nodes in the node tree to determine the levels of nodes other than those corresponding to control objects, thus defining the basic structure.

[0099] It should be noted that in this embodiment, a tree structure that can represent business characteristics is used as the basic structure because: the basic structure of a page can represent the basic functions of the page, and the basic functions of a page are strongly related to business characteristics—for example, a page whose business characteristic is video recommendation often has "recommendation" as its basic function—that is to say, the business characteristics of a page, the basic structure of the node tree corresponding to the page, and the basic functions of the page are strongly related. Therefore, in this embodiment, a tree structure that can represent business characteristics is used as the basic structure so that the subsequently determined page category is strongly related to the page function.

[0100] The second method is to directly determine the default comparison range as described in step 12; and then, based on the comparison range, determine the first set of nodes in the first node tree that are within the comparison range, and the second set of nodes in the second node tree that are within the comparison range.

[0101] The second method allows for the pre-setting of a default comparison range (e.g., level 0 to level 2 of the comparison tree) so that the testing device can obtain this default comparison range. The advantage of this method is its simplicity and ease of operation.

[0102] The third method: Use the entire first node tree and the entire second node tree as the comparison range described in step 12.

[0103] Step 13: The testing device determines the similarity comparison result of the arrangement positions of the same type of nodes in the first node set and the second node set based on the arrangement positions of the nodes in the first node set and the second node set in the first node tree, the type information of the nodes in the first node set and the type information of the nodes in the second node set.

[0104] Regarding the specific implementation of step 13, a concrete example is as follows:

[0105] Assuming the first page and the second page are respectively as follows: Figure 1e The pages located on the left and right sides are shown in the image, with the corresponding first node tree and first node set as follows: Figure 1f As shown, the second node tree and the second node set are as follows: Figure 1g As shown.

[0106] from Figure 1f and Figure 1g It can be seen that:

[0107] First, each node has its own designated position within the node tree. This position reflects the location of the corresponding object on the page—for example, relative to... Figure 1e The nodes corresponding to the "microphone," "camera," and "speaker" buttons in the control are arranged from left to right in the node tree—reflecting that the positions of these three controls on the page are also arranged from left to right.

[0108] Secondly, each node stores attribute information. This attribute information includes the node's type information. For example, the resource ID and class in the node's attribute information belong to the node's type information. The node's type information can characterize the type of the object corresponding to the node. The object type can specifically include, but is not limited to: images, text, animations, videos, hyperlinks, tables, and controls, etc.

[0109] In this embodiment of the disclosure, on the one hand, considering the "automatic testing and other similar situations" faced by the method proposed in this embodiment of the disclosure, the requirement for classifying the scene categories of the page in such cases will mainly consider "page functions" - that is, tending to classify pages with the same or similar functions into the same scene category.

[0110] On the other hand, considering the characteristics of the node tree, whether the functions of different pages are the same or similar can be reflected by whether the type information and arrangement position of the nodes in the corresponding node tree within the comparison range are the same.

[0111] Based on the above considerations, following step 13, for Figure 1f and Figure 1g In one optional implementation, the first and second node sets shown can be processed sequentially for each identical node layer in both sets, as follows:

[0112] First, determine which nodes in the layer have the same type of information. For example, for the third node layer, the nodes corresponding to the microphone button, the camera button, and the speaker button are nodes with the same type of information in two node sets.

[0113] Then, from the nodes of the same type in this layer, determine the number of nodes whose arrangement positions (generally referring to their order in the longest common subsequence of this layer) are consistent within this layer in both the first and second node trees. For example, in the third layer of the first and second node trees, the nodes corresponding to the microphone button, the camera button, and the speaker button are all arranged from left to right. Therefore, these three nodes have consistent arrangement positions within this layer. Furthermore, assuming there are no other nodes of the same type with consistent arrangement positions in the third layer, the number corresponding to this arrangement position in the third layer can be determined to be 3.

[0114] Finally, the ratio of the sum of this number in each layer to the average number of nodes contained in the first node set and the second node set is determined as the similarity comparison result of the arrangement positions of the same type of nodes in the first node set and the second node set.

[0115] For example, suppose Figure 1f and Figure 1g The two node trees shown have the same root node type, corresponding to a count of 1; the nodes in level 1 have the same type, corresponding to a count of 1; and the nodes in level 2, as mentioned above, have a count of 3. Therefore, the total count for levels 0 to 2 is 1 + 1 + 3 = 5. Also, as... Figure 1f and Figure 1g As shown, the average number of nodes in the first and second node sets is 7. Therefore, the similarity of the arrangement positions of nodes of the same type in the first and second node sets can be further calculated as 5 / 7.

[0116] The above content mentions the "longest common subsequence" at the same level on the node tree. The explanation of this concept is as follows:

[0117] For example, two node trees contain nodes bcdea and abce at the same level. The longest common subsequence (a node string can be understood as a set of nodes) between these two node trees is bc, with a maximum common part of 2. The longest common subsequence is bce, with a maximum common part of 3. It can be seen that the common subsequence does not require the nodes at the same level of the two node trees to be consecutively identical; rather, it only requires that some nodes are identical.

[0118] In this embodiment of the disclosure, the determination of the node arrangement position and type can be implemented using, but is not limited to, XPath. XPath is a tool that provides the ability to find nodes in a node tree based on an XML tree structure.

[0119] As can be seen from the above explanation of step 13, step 13 is essentially about finding the "common skeleton" of the two node trees and determining the size of the "common skeleton". When the comparison range is the entirety of the two node trees, the common skeleton of the two node trees is the common part of each level from the root node to the leaf node; when the comparison range is the nodes of some levels in the two node trees, the common skeleton of the two node trees is the common part of the nodes of those levels.

[0120] Generally speaking, the larger (deeper, wider) the "common skeleton" of two node trees, the more similar the structures of the two node trees, and the greater the likelihood that they belong to the same scene category.

[0121] Step 14: Determine the scene category of the first page and / or the second page based on the similarity comparison results of the arrangement positions of the same type of nodes in the first node set and the second node set.

[0122] Regarding the specific implementation of step 14, following the example above, in an optional implementation, by executing step 13, the number of nodes of the same type in the two node sets that are arranged in the same position on the first node tree and the second node tree can be determined. Then, the ratio of this number to the average number of nodes contained in the first node set and the second node set is determined as the similarity comparison result.

[0123] Therefore, when this ratio is greater than a preset ratio threshold, it can be determined that the scene categories of the first page and the second page are the same. When the first page is a page whose scene category is yet to be determined, while the second page belongs to a page whose scene category is known, the scene category of the second page can be determined as the scene category of the first page.

[0124] If the scene categories of both the first and second pages are unknown, then by executing step 14, it can be determined that the first and second pages can be classified into the same scene category. This conclusion can be used in scenarios where pages are clustered, to cluster the first and second pages into the same scene category.

[0125] When the ratio is not greater than the preset ratio threshold, it can be determined that the scene categories of the first page and the second page are different.

[0126] Using the method provided in the embodiments of this disclosure, since the "comparison range" corresponds to the basic structure of the node tree, and the basic structure of the node tree can reflect the basic functions of the page, the method provided in the embodiments of this disclosure determines the scene category of the first page and / or the second page by comparing the similarity of the arrangement positions of the same type of nodes in the first node set and the second node set within the comparison range. This is equivalent to determining the scene category of the page based on the similarity of "page functions", which meets the needs of determining the scene category of the page under automatic testing and other similar conditions, and provides a technical solution for accurately determining the scene category of the page under automatic testing and other similar conditions.

[0127] In an alternative implementation, to more accurately determine the scene category of the page, step 14 above can be further improved. Specifically, the improved step 14 may include the following technical features:

[0128] If the similarity comparison result obtained by performing step 13 indicates that the basic structures of the first node tree and the second node tree are similar, the similarity comparison result of the arrangement positions of the same type of nodes corresponding to "operable control objects" on the first node tree and the second node tree can be determined.

[0129] Based on the similarity comparison results of the arrangement positions of nodes of the same type corresponding to "operable control objects", the scene category of the first page and / or the second page is determined.

[0130] like Figure 1f The two node trees shown contain nodes that are not part of the infrastructure, as well as nodes that are outside the comparison scope, i.e., not part of the infrastructure. These nodes include at least one node corresponding to an "operable control object".

[0131] By further comparing the similarity of the arrangement positions of nodes of the same type corresponding to "operable control objects" on the first and second node trees, we can determine whether the non-basic structures are similar, given that the basic structures of the first and second node trees are similar. Obviously, if both the basic and non-basic structures of the two node trees are similar, then the overall architecture of the two trees is likely to be very similar, and therefore the corresponding pages are highly likely to belong to the same scene category.

[0132] In this embodiment of the disclosure, the similarity comparison result of the arrangement positions of nodes of the same type corresponding to the "operable control object" can be determined using a similar approach to step 13. Specifically, the similarity comparison result of the arrangement positions of nodes corresponding to the "operable control object" on the first node tree, the arrangement positions of nodes corresponding to the "operable control object" on the second node tree, the operable control object type information of the nodes corresponding to the "operable control object" on the first node tree, and the operable control object type information of the nodes corresponding to the "operable control object" on the second node tree can be determined.

[0133] The similarity comparison of the arrangement positions of nodes of the same type corresponding to "operable control objects" on the first node tree and the second node tree can be calculated as follows:

[0134] The similarity comparison result is calculated as follows: (Total number of nodes whose positions are identical in both the first and second node trees and whose corresponding operable control objects are the same) / (Average number of nodes contained in the first and second node sets).

[0135] The arrangement position here includes: the level in the node tree, and the order of arrangement in the longest common subsequence at the same level.

[0136] For details on how to determine the total number, please refer to the previous introduction on how to determine "the number of nodes of the same type in two node sets that are arranged in the same position in the first node tree and the second node tree". It will not be repeated here.

[0137] If the similarity comparison result calculated according to the above formula is greater than the predetermined similarity threshold, it means that the arrangement positions of the same type of nodes corresponding to the operable control objects are similar or the same, and thus it can be determined that the scene categories of the first page and the second page are the same; otherwise, it is determined that the scene categories of the two are different.

[0138] In an optional implementation, if the method provided in this disclosure is applied to the case of scene category clustering of the first page and the second page, then if the similarity comparison result of the arrangement positions of the same type of nodes corresponding to the operable control objects indicates that the arrangement positions of the same type of nodes corresponding to the operable control objects are similar or the same, then the first page and the second page can be clustered into the same scene category.

[0139] The method provided in this disclosure can also incorporate other technical features for determining node tree similarity to assist in determining the scene category of the first page and / or the second page. For example, in an optional implementation, the specific implementation of step 12 mentioned above may include:

[0140] Determine the edit distance between the first node tree and the second node tree (for ease of distinction, this is called the target edit distance);

[0141] If the target edit distance is greater than the edit distance threshold, then perform the operation to determine the first set of nodes and the second set of nodes;

[0142] If the target edit distance is not greater than the edit distance threshold, it indicates that the first node tree and the second node tree are similar, thus determining that the first page and the second page have the same scene category. In particular, if the scene category of the first page (or the second page) is known, the scene category of the first page (or the second page) can be determined as the scene category of the second page (or the first page).

[0143] It should be noted that edit distance refers to the minimum edit cost required to transform one node tree into another.

[0144] Typically, the transformation of a node tree involves three types of editing operations: deleting nodes, inserting nodes, and updating nodes. Given a defined editing cost for each operation, the edit distance can be calculated. Generally speaking, different editing orders result in different editing costs when transforming one node tree into another. Among these different editing orders, the one with the lowest editing cost represents the edit distance between the two trees.

[0145] By combining the edit distance and the similarity comparison of the arrangement positions of similar nodes, the scene category of the first page and / or the second page can be determined. This approach leverages the advantages of both techniques: edit distance allows for a relatively quick and easy determination of the page's scene category; the similarity comparison of the arrangement positions of similar nodes can supplement the edit distance technique. When it is difficult to determine the scene category based on edit distance alone, further comparison of the arrangement positions of similar nodes within the basic structure of different node trees can accurately determine the page's scene category and minimize misjudgment of the scene category.

[0146] In one optional implementation, the specific method for determining the target edit distance between the first node tree and the second node tree may include:

[0147] First, the first edit distance algorithm (such as Chawathe's algorithm) is used to calculate the edit distance between the first node tree and the second node tree—for ease of distinction, this is called the first edit distance;

[0148] If the first edit distance is not greater than the edit distance threshold, the first edit distance is determined as the target edit distance;

[0149] If the first edit distance is greater than the edit distance threshold, then a second edit distance algorithm (such as the ZSS algorithm) is used to calculate the second edit distance between the first node tree and the second node tree, which is taken as the target edit distance.

[0150] The first edit distance algorithm and the second edit distance algorithm satisfy the following conditions: the computational cost of the first edit distance algorithm is lower than that of the second edit distance algorithm; and the computational accuracy of the second edit distance algorithm is higher than that of the first edit distance algorithm.

[0151] For example, the first edit distance algorithm can be the Chawathe algorithm, and the second edit distance algorithm can be the ZSS algorithm. Both algorithms are used to calculate the edit distance between nodes in the tree. In terms of algorithm performance, the main difference between the two is that the Chawathe algorithm has a relatively small computational cost, resulting in relatively low computational complexity and relatively high computational efficiency; while the ZSS algorithm has relatively high computational accuracy.

[0152] In this embodiment, a first edit distance algorithm is first used to calculate a first edit distance. If the first edit distance is greater than an edit distance threshold, a second edit distance algorithm is then used to calculate a second edit distance. This approach leverages the advantage of the relatively low computational cost of the first edit distance algorithm—if the first edit distance calculated by this algorithm is not greater than the edit distance threshold, it is equivalent to obtaining a result with a relatively low computational cost. Simultaneously, if the first edit distance is greater than the edit distance threshold, the second edit distance algorithm, which has higher computational accuracy, can be used as a supplement, effectively correcting the accuracy of the result obtained by the first edit distance algorithm.

[0153] Example 2

[0154] To help readers better understand the method provided in Embodiment 1 of this disclosure, Embodiment 2 describes the specific implementation process of the method for determining the scene category of a page provided in Embodiment 1 in practice, in conjunction with a real-world scenario.

[0155] Please refer to the attached instructions. Figure 2a This is a schematic diagram illustrating the specific implementation process of this method in practice. The execution entity for each step in this process can be, for example, a device that determines the scene category of the scene page. The process mainly includes the following steps:

[0156] Step 21: Obtain the XML document corresponding to each page to be clustered across all scenarios, as well as the business characteristics of each page;

[0157] The full-scene clustering mentioned here refers to performing clustering operations on pages whose scene categories are unknown, to obtain pages corresponding to different scene categories.

[0158] In embodiment 2 of this disclosure, by way of example, it is assumed that each page includes, as follows: Figure 2b The set of pages shown.

[0159] Each of these pages has its own corresponding XML document, which describes the layout of the respective page.

[0160] Step 22: Parse each obtained XML document into a corresponding node tree;

[0161] Step 23: Preprocess each node tree obtained from the parsing to obtain the preprocessed node tree;

[0162] The preprocessing mentioned here may include:

[0163] Based on the content in the XML document describing the order of the objects corresponding to the nodes, the nodes with incorrect order in the parsed node tree are adjusted to obtain a node tree whose node order is consistent with the order described in the XML document.

[0164] For nodes in the node tree that have redundant relationships both horizontally and vertically, a deduplication operation is performed. For example, deduplication methods from related technologies can be used to achieve this.

[0165] Step 24: Based on the business characteristics of the page corresponding to the preprocessed node tree, select the template node tree from the database storing the template node tree by querying the pre-established correspondence between each business characteristic and the template node tree and the comparison range information, and determine the comparison range information.

[0166] The selected template node tree satisfies the following condition: the corresponding business characteristics are the same as the business characteristics of the page corresponding to the preprocessed node tree.

[0167] A template node tree refers to the node tree obtained after parsing the XML file corresponding to a page (which can be called a template page) provided by business personnel as a reference for categorizing scenario types. The template node tree can be stored in a database that stores template node trees.

[0168] The template pages correspond to specific business features, such as video recommendation, video upload, group chat creation, and so on.

[0169] Information about the comparison range may include, for example, the threshold used to determine the comparison range as described in Embodiment 1 of this disclosure.

[0170] Based on the information within the comparison range, the business characteristics corresponding to the template page, and the template node tree, a correspondence can be established between the comparison range information, business characteristics, and template node tree. This correspondence, along with the database storing the template node tree, can be stored in an expert database for querying and retrieval.

[0171] For ease of explanation, the following will begin from step 25, using "first node tree" to refer to a preprocessed node tree and "second node tree" to refer to the selected template node tree. The explanation will then use the first and second node trees as examples. Figure 2a The other steps are shown.

[0172] Step 25: Calculate the first edit distance between the first node tree and the second node tree using the Chawathe algorithm;

[0173] If the first edit distance is not greater than the edit distance threshold, then proceed to step 210: determine that the first page and the second page have the same scene category and can be clustered into the same scene category;

[0174] If the first edit distance is greater than the edit distance threshold, then proceed to step 26;

[0175] Step 26: Calculate the second edit distance between the first node tree and the second node tree using the ZSS algorithm;

[0176] If the second edit distance is not greater than the edit distance threshold, then proceed to step 210: determine that the first page and the second page have the same scene category and can be clustered into the same scene category;

[0177] If the second edit distance is greater than the edit distance threshold, then proceed to step 27;

[0178] Step 27: Based on the determined comparison range information, determine the nodes in the first node tree and the second node tree that are within the comparison range, and obtain the corresponding first node set and second node set;

[0179] For example, if the information for the comparison range is the threshold 3 in Table 1, then the level to which the root node of the node tree belongs (level 0), as well as levels 1 and 2, can be jointly determined as the comparison range, thereby obtaining the corresponding first node set and second node set.

[0180] Step 28: Based on the arrangement positions of nodes in the first node set on the first node tree, the arrangement positions of nodes in the second node set on the second node tree, the type information of nodes in the first node set, and the type information of nodes in the second node set, determine the similarity comparison results of the arrangement positions of nodes of the same type in the first node set and the second node set.

[0181] For the specific implementation process of step 28, please refer to the relevant description of Embodiment 1 of this disclosure, which will not be repeated here.

[0182] For step 28, assuming that the number of nodes of the same type in the two node sets that have the same arrangement position in the first node tree and the second node tree is 10, and the average number of nodes in the first node set and the second node set is 20, then the similarity comparison result can be obtained as: 10 / 20=50%.

[0183] Step 29: Determine whether the similarity comparison result is greater than the set similarity threshold;

[0184] For example, if the similarity comparison result is greater than or equal to 50%, then step 210 can be executed;

[0185] If the similarity comparison result is less than 50%, then step 211 can be executed.

[0186] Step 210: Determine that the first page and the second page have the same scene category, and can be clustered into the same scene category;

[0187] In one implementation, if the scene category of the second page, which serves as the template page, is known, then the scene category of the second page can be determined as the scene category of the first page.

[0188] Step 211: Determine that the first page and the second page have different scene categories.

[0189] The above description uses only the first and second node trees as examples to illustrate steps 25 to 211. Those skilled in the art will understand that similar steps 25 to 211 can be used to determine the scene category for other preprocessed node trees.

[0190] The technical solution provided in Embodiment 2 of this disclosure, since the comparison range corresponds to the basic structure of the node tree, and the basic structure of the node tree can reflect the basic functions of the page, the solution provided in Embodiment 2 of this disclosure determines the scene category of the first page and / or the second page by comparing the similarity of the arrangement positions of the same type of nodes in the first node set and the second node set within the comparison range. This is equivalent to determining the scene category of the page based on the similarity of "page functions", which meets the needs of determining the scene category of the page under automatic testing and other similar conditions. This provides a technical solution for accurately determining the scene category of the page under automatic testing and other similar conditions.

[0191] Example 3

[0192] To address the problem of accurately determining the scene category of a page in existing technologies under automated testing and other similar conditions, Embodiment 3 of this disclosure provides an apparatus for determining the scene category of a page.

[0193] A schematic diagram of the specific structure of the device is shown below. Figure 3 As shown, it includes the following functional units:

[0194] The node tree acquisition unit 31 is used to acquire the first node tree corresponding to the first XML document and the second node tree corresponding to the second XML document; the first XML document is used to describe the layout of the first page; the second XML document is used to describe the layout of the second page.

[0195] The node determination unit 32 is used to determine a first set of nodes in the first node tree that are within the comparison range, and a second set of nodes in the second node tree that are within the comparison range; the comparison range corresponds at least to the basic structure of the first node tree or the second node tree used to characterize the basic functions of the page;

[0196] The comparison unit 33 is used to determine the similarity comparison result of the arrangement positions of the same type of nodes in the first node set and the second node set based on the arrangement positions of the nodes in the first node set in the first node tree, the arrangement positions of the nodes in the second node set in the second node tree, the type information of the nodes in the first node set, and the type information of the nodes in the second node set.

[0197] Scene category determination unit 34 is used to determine the scene category of the first page and / or the second page based on the similarity comparison result.

[0198] In one optional implementation, the first comparison range includes at least: the level to which the root node belongs; and levels whose level difference with the level to which the root node belongs is less than a threshold.

[0199] In one alternative implementation, the node determination unit 32 may specifically be used for:

[0200] Determine the edit distance between the first node tree and the second node tree; if the edit distance is greater than the edit distance threshold, then determine the first node set and the second node set.

[0201] In one alternative implementation, the node determination unit 32 may specifically be used for:

[0202] The first edit distance between the first node tree and the second node tree is calculated using the first edit distance algorithm;

[0203] If the first edit distance is not greater than the edit distance threshold, the first edit distance is determined as the edit distance between the first node tree and the second node tree;

[0204] If the first edit distance is greater than the edit distance threshold, then the second edit distance algorithm is used to calculate the second edit distance between the first node tree and the second node tree, which is taken as the edit distance between the first node tree and the second node tree;

[0205] The first edit distance algorithm and the second edit distance algorithm satisfy the following conditions: the computational cost of the first edit distance algorithm is lower than that of the second edit distance algorithm; and the computational accuracy of the second edit distance algorithm is higher than that of the first edit distance algorithm.

[0206] In an optional implementation, the apparatus provided in this disclosure can be used to perform scene category clustering on the first page and the second page. Specifically, the scene category determination unit 34 can be used for:

[0207] When the similarity comparison result indicates that the basic structures of the first node tree and the second node tree are similar, the similarity comparison result of the same type of node arrangement position corresponding to the operable control object on the first node tree and the second node tree that is outside the comparison range is determined;

[0208] If the similarity comparison result of the arrangement positions of the same type of nodes corresponding to the operable control objects indicates that the arrangement positions of the same type of nodes corresponding to the operable control objects are similar or the same, then the first page and the second page are clustered into the same scene category.

[0209] In an optional implementation, the apparatus provided in this disclosure may further include: a comparison range determination unit, configured to:

[0210] Based on the business characteristics of the target page, query the correspondence between the pre-set business characteristics and the information of the comparison range; the target page is the first page and / or the second page;

[0211] The comparison range is determined based on the comparison range information corresponding to the business characteristics of the target page obtained from the query.

[0212] In one optional implementation, the information on each business feature and comparison range included in the correspondence is determined based on the template page in the expert knowledge base, the business features of the template page, and the XML document used to describe the template page.

[0213] The apparatus provided in this disclosure, since the comparison range corresponds to the basic structure of the node tree, and the basic structure of the node tree can reflect the basic functions of the page, determines the scene category of the first page and / or the second page by comparing the similarity of the arrangement positions of the same type of nodes in the first and second node sets within the comparison range. This is equivalent to determining the scene category of the page based on the similarity of "page functions", which meets the needs of determining the scene category of the page under automatic testing and other similar conditions. It provides a technical solution for accurately determining the scene category of the page under automatic testing and other similar conditions.

[0214] Example 4

[0215] Based on the same inventive concept as embodiments 1 to 3 of this disclosure, embodiment 4 of this disclosure provides an electronic device to solve the problem of how to accurately determine the scene category of a page in the prior art under automatic testing and other similar circumstances.

[0216] like Figure 4 As shown, the electronic device includes a memory 41 and a processor 42. The memory 41 can be configured to store various other data to support operation on the electronic device. Examples of such data include instructions for any application or method used to operate on the electronic device. The memory 41 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, 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 storage, flash memory, magnetic disk, or optical disk.

[0217] The processor 42, coupled to the memory 41, is configured to execute a program stored in the memory 41 for performing the method for determining the scene category of a page as described in embodiments of this disclosure.

[0218] When the processor 42 executes the program in the memory 41, in addition to the functions described above, it can also perform other functions, as detailed in the descriptions of the preceding embodiments.

[0219] Furthermore, such as Figure 4 As shown, the electronic device also includes: a display 44, a communication component 43, a power supply component 45, an audio component 46, and other components. Figure 4 The diagram only shows some components and does not mean that the electronic device includes only these components. Figure 4 The components shown.

[0220] Accordingly, this disclosure also provides a computer-readable storage medium storing a computer program, which, when executed by a computer, can implement the steps or functions of the methods provided in the above embodiments.

[0221] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort. Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments.

[0222] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this disclosure, and are not intended to limit them. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure.< / book> < / price> < / year> < / author> < / book> < / book> < / book> < / bookstore> < / price> < / year> < / author> < / book> < / bookstore> < / book> < / bookstore>

Claims

1. A method of determining a scene category of a page, characterized by, The method comprises: obtaining a first node tree corresponding to a first extensible markup language document and a second node tree corresponding to a second extensible markup language document; the first extensible markup language document is used to describe a layout of a first page; the second extensible markup language document is used to describe a layout of a second page; determining a first node set on the first node tree within a comparison range and a second node set on the second node tree within the comparison range; the comparison range at least corresponds to a basic structure of the first node tree or the second node tree for representing a basic function of a page; determining a similarity comparison result of arrangement positions of nodes of the same type in the first node set and the second node set according to arrangement positions of the nodes in the first node set on the first node tree, arrangement positions of the nodes in the second node set on the second node tree, type information of the nodes in the first node set and type information of the nodes in the second node set; the similarity comparison result is determined by determining a number of nodes of the same type having consistent arrangement positions on the first node tree and the second node tree, determining an average value of numbers of nodes contained in the first node set and the second node set, and determining a ratio of the number to the average value as the similarity comparison result; determining a scene category of the first page and / or the second page according to the similarity comparison result.

2. The method of claim 1, wherein, The comparison range at least comprises: a hierarchy to which a root node belongs; a hierarchy having a hierarchy difference from the hierarchy to which the root node belongs less than a threshold value.

3. The method of claim 1, wherein, Determining the first node set and the second node set comprises: determining an edit distance between the first node tree and the second node tree; if the edit distance is greater than an edit distance threshold value, determining the first node set and the second node set.

4. The method of claim 3, wherein, Determining the edit distance between the first node tree and the second node tree comprises: calculating a first edit distance between the first node tree and the second node tree by using a first edit distance algorithm; if the first edit distance is not greater than the edit distance threshold value, determining the first edit distance as the edit distance between the first node tree and the second node tree; if the first edit distance is greater than the edit distance threshold value, calculating a second edit distance between the first node tree and the second node tree by using a second edit distance algorithm as the edit distance between the first node tree and the second node tree; The first edit distance algorithm and the second edit distance algorithm satisfy: a calculation cost of the first edit distance algorithm is relatively lower than a calculation cost of the second edit distance algorithm; a calculation accuracy of the second edit distance algorithm is relatively higher than a calculation accuracy of the first edit distance algorithm.

5. The method of claim 4, wherein, The method further comprises: querying a pre-set correspondence between each business feature and information of a comparison range according to a business feature of a target page; the target page is the first page and / or the second page; determining the comparison range according to the information of the comparison range corresponding to the business feature of the target page which is queried.

6. The method of claim 5, wherein, The information of each service feature and comparison range contained in the correspondence is determined based on a template page in an expert knowledge base, a service feature of the template page, and an extensible markup language document used to describe the template page.

7. The method of claim 6, wherein, When the method is applied to scene category clustering of the first page and the second page, According to the similarity comparison result, a scene category of the first page and / or the second page is determined, and the determination specifically includes: When the similarity comparison result represents that the basic structures of the first node tree and the second node tree are similar, a similarity comparison result of the same type node arrangement positions corresponding to the operable control object outside the comparison range on the first node tree and the second node tree is determined. If the similarity comparison result of the same type node arrangement positions corresponding to the operable control object represents that the same type node arrangement positions corresponding to the operable control object are similar or identical, the first page and the second page are clustered into the same scene category.

8. An apparatus for determining a scene category of a page, the apparatus comprising: The device includes: A node tree obtaining unit is configured to obtain a first node tree corresponding to a first extensible markup language document and a second node tree corresponding to a second extensible markup language document; the first extensible markup language document is used to describe a layout of a first page; and the second extensible markup language document is used to describe a layout of a second page. A node determining unit is configured to determine a first node set on the first node tree within a comparison range and a second node set on the second node tree within the comparison range; the comparison range at least corresponds to a basic structure of the first node tree or the second node tree used to represent a basic function of a page. A comparison unit is configured to determine a similarity comparison result of same type node arrangement positions in the first node set and the second node set according to arrangement positions of nodes in the first node set on the first node tree, arrangement positions of nodes in the second node set on the second node tree, type information of the nodes in the first node set, and type information of the nodes in the second node set; the similarity comparison result is determined by determining a number of nodes of the same type nodes having consistent arrangement positions on the first node tree and the second node tree, determining an average value of the number of nodes contained in the first node set and the second node set, and determining a ratio of the number to the average value as the similarity comparison result. A scene category determining unit is configured to determine a scene category of the first page and / or the second page according to the similarity comparison result.

9. An electronic device, comprising: It includes: A memory and a processor, wherein The memory is configured to store a program; The processor, coupled with the memory, is configured to execute the program stored in the memory, so as to execute the method in any one of claims 1-7.

10. A computer readable storage medium storing a computer program, which, when executed by a computer, can implement the method in any one of claims 1-7.

Citation Information

Patent Citations

  • Web page information extraction method and web page information extraction device

    CN104484451A

  • Webpage clustering method and related device

    CN114611038A