Page feature acquisition method, device, electronic device and readable storage medium

By analyzing page data, obtaining the attribute features and parent-child relationships of the layout object, and using the StatNode structure to express page features, solving the problem of inaccurate acquisition of page features in the existing technology, and achieving more accurate page detection and processing.

CN114996614BActive Publication Date: 2025-08-29BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210654879.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-10
Publication Date
2025-08-29
Estimated Expiration
2042-06-10

AI Technical Summary

Technical Problem

When the prior art acquires page features by statistical page text content, the page features cannot be accurately expressed, resulting in poor results when detecting problems such as dead links or bad advertisements and low accuracy.

Method used

By analyzing page data, obtaining data at multiple levels and their parent-child relationships, rendering and generating layout objects, obtaining page features based on the attribute characteristics of the layout object and the parent-child relationship, and expressing page features using the StatNode data structure.

Benefits of technology

The obtained page features are more accurate, which can better express page content and behavior, and improve the effectiveness of detecting dead links and blocking bad advertisements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114996614B_ABST
    Figure CN114996614B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method, device, electronic device and readable storage medium for obtaining page features, which relate to Internet technologies, and in particular to the fields of page rendering and page feature acquisition. The specific implementation scheme includes: obtaining page data of the target page, and obtaining data of multiple levels in the page and parent-child relationships between multiple levels based on the page data analysis. Generate a corresponding layout object based on the data rendering of each level, and the layout object includes the parent-child relationship of the corresponding level. Obtain the page features of the target page based on the attribute characteristics of the layout object and the parent-child relationship of the layout object. The page features of the target page obtained based on the attribute characteristics of the layout object and the parent-child relationship of the layout object include text features, non-text features, parent-child relationships, etc. in the page, retain the structure of the page, have more feature dimensions, and can more accurately represent the target page.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to Internet technologies, and in particular to the fields of page rendering and page feature acquisition. Background Art

[0002] Page features are extracted from live web pages. They can be used to detect broken links, consumer barriers, and advertisements. These issues can be addressed to improve content quality and user experience.

[0003] Currently, page features are mainly extracted by counting the text content in the page as page features. Summary of the Invention

[0004] The present disclosure provides a method, device, electronic device and readable storage medium for acquiring page features, which can obtain more accurate page features.

[0005] According to a first aspect of the present disclosure, a method for acquiring page features is provided. The method comprises: acquiring page data of a target page, parsing the page data to obtain data of multiple levels within the page and parent-child relationships between the multiple levels. Rendering the data for each level generates a corresponding layout object, the layout object including the parent-child relationships for the corresponding levels. Based on the attribute characteristics of the layout object and the parent-child relationships of the layout object, the page features of the target page are acquired.

[0006] According to a second aspect of the present disclosure, a device for acquiring page features is provided, the device comprising: an acquisition module for acquiring page data of a target page, and obtaining data of multiple levels in the page and parent-child relationships between the multiple levels based on the page data; a generation module for rendering and generating corresponding layout objects based on the data of each level, the layout objects including parent-child relationships of the corresponding levels; and the acquisition module for acquiring page features of the target page based on the attribute characteristics of the layout objects and the parent-child relationships of the layout objects.

[0007] According to a third aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method provided in the first aspect.

[0008] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, where the computer instructions are used to cause a computer to execute the method provided according to the first aspect.

[0009] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, which implements the method provided according to the first aspect when executed by a processor.

[0010] The present disclosure obtains page data for a target page and, based on the page data, parses the data to obtain data for multiple levels within the page and the parent-child relationships between the multiple levels. Based on the data for each level, a corresponding layout object is rendered, the layout object including the parent-child relationships for the corresponding levels. Based on the attribute characteristics of the layout object and the parent-child relationships of the layout object, page features of the target page are obtained. The identified page features can more accurately represent the content and behavior of the target page.

[0011] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.

[0013] Figure 1 A flowchart of a method for obtaining page features according to an embodiment of the present disclosure;

[0014] Figure 2 A schematic diagram of a process for implementing S130 in the page feature acquisition method provided in an embodiment of the present disclosure;

[0015] Figure 3 A schematic diagram of a process for implementing S130 in the page feature acquisition method provided in an embodiment of the present disclosure;

[0016] Figure 4 A schematic diagram of a pop-up page provided in an embodiment of the present disclosure;

[0017] Figure 5 A schematic diagram of a process for implementing S130 in the page feature acquisition method provided in an embodiment of the present disclosure;

[0018] Figure 6 A schematic diagram of a window page portrait provided in an embodiment of the present disclosure;

[0019] Figure 7 A schematic diagram of the composition of a page rendering device provided in an embodiment of the present disclosure;

[0020] Figure 8 A schematic block diagram of an example electronic device 800 is shown, which may be used to implement embodiments of the present disclosure. DETAILED DESCRIPTION

[0021] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0022] When users browse the web, they often encounter problems such as broken links and inappropriate advertisements. By extracting features from the web pages they browse, detecting broken links and blocking inappropriate advertisements based on page characteristics, we can address these issues in a targeted manner, thereby improving content quality and user experience.

[0023] Currently, page features are mainly extracted by counting the text content in the page as page features.

[0024] However, the page features cannot be accurately expressed only through the text on the page. Inaccurate expression of the page will also lead to poor results and low accuracy in detecting problems such as broken links or bad advertisements.

[0025] To this end, the present application provides a method for acquiring page features, the method comprising: acquiring page data of a target page, parsing the page data to obtain data of multiple levels in the page and the parent-child relationships between the multiple levels. Rendering the data of each level generates a corresponding layout object, the layout object including the parent-child relationships of the corresponding levels. Based on the attribute characteristics of the layout object and the parent-child relationships of the layout object, the page features of the target page are acquired.

[0026] Because the present disclosure obtains the attribute features of the rendered layout objects and the parent-child relationships of the layout objects, the page features of the target page obtained based on the attribute features of the layout objects and the parent-child relationships of the layout objects include the text features, non-text features, parent-child relationships, etc. in the page, preserving the structure of the page, with more feature dimensions, and capable of more accurately representing the target page.

[0027] In some embodiments, the page feature acquisition provided by the present disclosure can be applied to electronic devices, such as personal computers, laptops, smartphones, tablet computers, and the like. The operating systems of these devices can be Android, Windows, iOS, Mac OS, Harmony OS, Linux, etc., and the present disclosure does not limit this.

[0028] Figure 1 This is a flow chart of a method for acquiring page features provided by an embodiment of the present disclosure. This method can be applied to the above-mentioned electronic devices, such as Figure 1 As shown, the page feature acquisition method includes:

[0029] S110 , obtaining page data of a target page, and obtaining data of multiple levels in the page and parent-child relationships between the multiple levels according to the page data analysis.

[0030] In some embodiments, the page data may be a pre-compiled Hypertext Markup Language (HTML) file stored in a database. When the electronic device executing the page feature acquisition method receives a user operation instructing to access a target page based on a URL or Internet Protocol (IP) address, the electronic device may download and acquire the HTML file of the target page based on the URL or IP address, thereby acquiring the page data of the target page.

[0031] In some implementations, after parsing the HTML file, an HTML tree can be created, in which data including multiple levels can be obtained, each level of data including its own parent-child relationship. Each level of data can be rendered to obtain a layout object (LayoutObject).

[0032] S120 , generating a corresponding layout object according to the data rendering of each level, where the layout object includes a parent-child relationship of the corresponding level.

[0033] In some implementations, parsing and rendering HTML can produce a layout object tree (LayoutObjecttree), which includes multiple layout objects, each of which has its own parent-child relationship. For example, if the hierarchical data is "document", the layout object that can be rendered is "LayoutView"; if the hierarchical data is "HTML", the layout object that can be rendered is "LayoutBlockFlow"; if the hierarchical data is "Text", the layout object that can be rendered is "LayoutText", etc. This application does not impose any restrictions on this.

[0034] S130: Obtain page features of the target page according to the attribute features of the layout objects and the parent-child relationship of the layout objects.

[0035] In some implementations, the attribute features of a layout object may include layout attributes, such as the location information of the layout object; node attributes, such as the parent node information of the layout object; Cascading Style Sheets (CSS) attributes, etc. The parent-child relationship of a layout object may be recorded through node attributes.

[0036] In this embodiment, the attribute features of the rendered layout objects and the parent-child relationships of the layout objects are obtained. Based on the attribute features of the layout objects and the parent-child relationships of the layout objects, the page features of the target page are obtained, including the text features, non-text features, parent-child relationships, etc. in the page. This preserves the page structure, has more feature dimensions, and can more accurately represent the target page.

[0037] In some implementations, the process of extracting page features from a target page can be called a page portrait. In this application, page portraits can be divided into three categories: panoramic page portraits, partial page portraits, and viewport page portraits.

[0038] Figure 2 This is a flowchart of an implementation of S130 in the page feature acquisition method provided in an embodiment of the present disclosure.

[0039] refer to Figure 2 The process for implementing S130 is a panoramic page portrait, including:

[0040] S210: Acquire attribute characteristics of each layout object in the target page.

[0041] In some implementations, the panoramic page portrait refers to generating page features in a one-to-one correspondence with the complete layout object tree. Therefore, it is necessary to obtain the attribute features of each layout object in the target page.

[0042] S220: Generate a statistical node of the layout object according to the attribute characteristics of the layout object and the parent-child relationship of the layout object, where the statistical node includes the parent-child relationship of the corresponding layout object.

[0043] In some implementations, a statistics node can be represented by a data structure, for example, a "StatNode" data structure. StatNode is defined using protocol buffers (protobuf). Protobuf is a hybrid language data standard provided by Google. By serializing structured data, it creates a language-independent, platform-independent, and scalable serialized structured data format for communication protocols, data storage, and other fields.

[0044] In some implementations, StatNode may include multi-dimensional data, such as layout attributes (such as position information), node attributes (such as parent node information), CSS style attributes, and Baidu custom attributes (such as ad filtering node attributes).

[0045] For example, some attributes can be defined in StatNode by the following code:

[0046] message StatNode{

[0047] / / Required layout attributes

[0048] required in32 xpos=1; / / Corresponding to the horizontal coordinate of the web page element, in px, from left to right

[0049] required in32 ypos=2; / / Corresponding to the vertical coordinate of the web page element, in px, from top to bottom

[0050] required in32 width=3; / / width of web page element, in px

[0051] required in32 height=4; / / The height of the web page element in px

[0052] required Visible visible=5; / / Is the web page element visible?

[0053] / / Required Node properties

[0054] requiredTypetype=6; / / type

[0055] required stringname=7; / / tag_name

[0056] requiredStatNodeparent=8; / / parent node

[0057] required StatNode next_sibling = 9; / / next sibling node

[0058] optional StatNodeChildrenchildren = 10; / / child nodes

[0059] optional StatNodeAttributesattributes=11; / / Attributes

[0060] required stringtxt=12; / / text information

[0061] optional ExtendAttributesextend_attributes=13; / / Add other attributes

[0062] optional CSSAttributescss_attributes=14; / / CSS style attributes

[0063]

[0064] }

[0065] S230: Generate page features of the target page according to each of the statistical nodes and the parent-child relationship of the statistical nodes.

[0066] In this embodiment, StatNode represents page features as a StatNode tree by adding a parent-child relationship. This maintains the tree structure of the HTML tree generated by the native kernel after parsing the HTML file, and the page features are expressed more accurately. At the same time, it is decoupled from the kernel data, and each statistical node contains data of the same dimensions, which is more standardized. The data in StatNode can be serialized, facilitating subsequent operations such as data identification and storage.

[0067] The data structure of StatNode makes it easy to extend. By defining a new message as an optional member of the original StatNode, the data of StatNode can be easily extended. Moreover, StatNode is also forward-compatible. After the data structure is extended, the use of the original attributes will not be affected, which facilitates the compatible reuse of the original data.

[0068] After generating the StatNode, the page features are separated from the rendering engine and can be sent to the background thread for detection independently. Detecting page features does not require occupying the foreground thread (such as the Render thread).

[0069] In this embodiment, the target page feature data is generated based on all layout objects in the entire target page, including the page features of the complete web page, which can provide more complete page information and be more complete when saving offline samples of the page.

[0070] Figure 3 This is a flowchart of an implementation of S130 in the page feature acquisition method provided in an embodiment of the present disclosure.

[0071] refer to Figure 3 The process for implementing S130 is a partial page portrait, including:

[0072] S310: Determine a first area in a target page, where the first area includes at least one layout object, and a parent-child relationship of the layout object includes one or more child layout objects.

[0073] In some implementations, only a portion of the page needs to be detected, so there is no need to create a full-page image. For example, when detecting a pop-up window in a target page, only the page features of the pop-up window need to be extracted, i.e., a pop-up window page image is created.

[0074] For example, when determining the first area, the process of pre-rendering the LayoutObject tree based on the HTML tree can detect changes in the rendering area of ​​the LayoutObject. When a layout object changes from invisible to visible, it is considered a pop-up layout object. By traversing the pop-up layout object and its child layout objects, the pop-up page image can be completed.

[0075] S320 : Generate statistical nodes for the layout object and each child layout object based on the attribute characteristics of the layout object, the attribute characteristics of each child layout object, and the parent-child relationship of the layout object. The statistical nodes include the parent-child relationship of the corresponding layout objects.

[0076] In some embodiments, Figure 4 A schematic diagram of a pop-up page image provided in an embodiment of the present disclosure.

[0077] refer to Figure 4 , which includes the LayoutObject tree of the target page. The pop-up page starts with the first div layout object 41 under the body layout object, and includes sub-layout objects such as the second div layout object 42, the a layout object 43, and the p layout object 44. Statistics nodes are generated for each layout object and each sub-layout object, starting with the first div statistics node 45, and including sub-statistics nodes such as the second div statistics node 46, the a statistics node 47, and the p statistics node 48.

[0078] S330: Generate page features of the target page based on each statistical node and the parent-child relationship of the statistical nodes.

[0079] In some embodiments, reference Figure 4 The StatNode tree of the pop-up page is shown in the , and the StatNode tree of the pop-up page is the page feature of the target page.

[0080] In this embodiment, feature extraction is performed only on layout objects in the first area of ​​the target page, so that page features can be extracted more specifically. When detecting the extracted page features, interference from other areas can be avoided, resulting in better detection effect.

[0081] Figure 5 This is a flowchart of an implementation of S130 in the page feature acquisition method provided in an embodiment of the present disclosure.

[0082] refer to Figure 5 The process for implementing S130 is window page portrait, including:

[0083] S510: Determine a second area in the target page, where the second area includes an area displayed on the screen.

[0084] In some embodiments, Figure 6 A schematic diagram of a window page image provided in an embodiment of the present disclosure.

[0085] refer to Figure 6 The second area of ​​the target page is the area where the layout objects are visible in the window 61. When the page slides, the first layout object 62 in the second area becomes invisible, and the second layout object 63 in other areas of the target page becomes visible, and the second area also changes accordingly.

[0086] S520: Acquire attribute characteristics of layout objects in the second region, and generate a statistical node for each layout object in the second region based on the attribute characteristics of the layout objects and the parent-child relationship of the layout objects, where the statistical node includes the parent-child relationship of the corresponding layout object.

[0087] In some implementations, during pre-rendering, all layout objects that need to be rendered may be recorded, and the parent-child relationship of the layout objects may be saved in a node list (nodelist).

[0088] In some implementations, a trigger condition may be set preferentially, and when the trigger condition is met, a statistical node for each layout object in the second area is generated.

[0089] In some implementations, the trigger condition includes multiple trigger mechanisms. For example, when the first screen of the target page is displayed, when HTML parsing is completed, or when pre-rendering is completed. Finally, after the page is scrolled, a statistical node for each layout object in the second area can be generated.

[0090] In some implementations, after a trigger condition is met, a preset duration may be waited before generating a statistics node for each layout object in the second region. This effectively avoids repeated acquisition of layout object attributes due to frequent acquisition triggering, such as continuous scrolling. The preset duration may be 200ms, 500ms, or 800ms, among others, and is not limited here.

[0091] It should be noted that when the page slides, only the newly added layout objects are detected, and there is no need to repeat the detection for the layout objects that have already generated statistical nodes.

[0092] S530: Generate page features of the target page according to each statistical node and the parent-child relationship of the statistical nodes.

[0093] In some implementations, after generating the statistics node for each layout object in the second area, a StatNode tree is generated based on all statistics nodes in the second area and the parent-child relationship of the statistics nodes. The StatNode tree of the window page is the page feature of the target page.

[0094] In this embodiment, only the layout objects displayed in the window are subjected to feature extraction, which can reduce the memory usage of single page feature generation and improve the speed of generating page features. It can also distinguish whether the layout objects have been detected to avoid repeated detection.

[0095] In some implementations, after obtaining the page features based on the attribute features of the layout objects and the parent-child relationship of the layout objects, the method further includes:

[0096] The target page is detected according to the page features to identify the content or behavior of the target page.

[0097] In this embodiment, by detecting the target page by obtaining page features according to the page feature acquisition method, the content or behavior of the target page can be identified more accurately, thereby improving user experience.

[0098] In some implementations, the above-mentioned page portraits can be combined to detect pages based on page feature recognition to achieve cloud integration.

[0099] In some embodiments, the recognition model can be first trained based on StatNode. The training of the recognition model can be performed offline. For example, the pre-marked target page is first profiled according to the page feature acquisition method provided in this application to obtain the page features, that is, the StatNode tree. The StatNode tree is serialized (for example, converted into binary code) and stored in the hard disk. According to the model type of the recognition model adopted, the serialized StatNode is deserialized to obtain a data type compatible with the recognition model. Finally, the recognition model is trained based on the pre-marked and StatNode data to obtain a pre-trained recognition model.

[0100] Then, the pre-trained recognition model can be deployed online to detect the target page.

[0101] In some implementations, each statistical node in the page features can be preprocessed. For example, preprocessing can include traversing the StatNode tree and reading the text content therein as model input. Alternatively, the features of each node in the StatNode tree can be preprocessed to extract partial features of each layout object, and the text content and features can be used as model input.

[0102] Then, the pre-processed data is input into a pre-trained recognition model to obtain the recognition results of the target page. The recognition results include whether there are broken links in the target page, whether the pop-up window is a bad advertisement, etc.

[0103] Finally, the recognition results and StatNode data can be recorded as data logs and reported and stored for subsequent use.

[0104] In this embodiment, the StatNode data is detected by a pre-trained recognition model to obtain a recognition result, which can more accurately determine whether there is content that requires intervention in the page, thereby realizing a closed loop from page feature extraction to page intervention.

[0105] In an exemplary embodiment, the present disclosure further provides a page feature acquisition device, which can be used to implement the page feature acquisition method as described in the above embodiment.

[0106] Figure 7 A schematic diagram of the composition of a page rendering device provided in an embodiment of the present disclosure.

[0107] like Figure 7 As shown, the device may include:

[0108] The acquisition module 71 is used to acquire page data of a target page, and obtain data of multiple levels in the page and parent-child relationships between the multiple levels according to the page data analysis.

[0109] The generation module 72 is used to generate a corresponding layout object according to the data rendering of each level, and the layout object includes the parent-child relationship of the corresponding level.

[0110] The acquisition module 71 is further configured to acquire page features of the target page according to the attribute features of the layout objects and the parent-child relationship of the layout objects.

[0111] In some implementations, the acquisition module 71 is specifically configured to acquire attribute characteristics of each layout object in the target page.

[0112] A statistical node of the layout object is generated according to the attribute characteristics of the layout object and the parent-child relationship of the layout object. The statistical node includes the parent-child relationship of the corresponding layout object.

[0113] According to each statistical node and the parent-child relationship of the statistical nodes, the page features of the target page are generated.

[0114] In some implementations, the acquisition module 71 is specifically configured to determine a first region in the target page, where the first region includes at least one layout object, and a parent-child relationship of the layout object includes one or more child layout objects.

[0115] Get the properties and characteristics of the layout object and each sublayout object.

[0116] According to the attribute characteristics of the layout object, the attribute characteristics of each child layout object and the parent-child relationship of the layout object, a statistical node of the layout object and each child layout object is generated, and the statistical node includes the parent-child relationship of the corresponding layout object.

[0117] According to each statistical node and the parent-child relationship of the statistical nodes, the page features of the target page are generated.

[0118] In some implementations, the acquisition module 71 is specifically configured to determine a second area in the target page, where the second area includes an area displayed on the screen.

[0119] Attribute characteristics of the layout objects in the second area are obtained, and statistical nodes for each layout object in the second area are generated according to the attribute characteristics of the layout objects and the parent-child relationship of the layout objects, where the statistical nodes include the parent-child relationship of the corresponding layout object.

[0120] According to each statistical node and the parent-child relationship of the statistical nodes, the page features of the target page are generated.

[0121] In some implementations, the apparatus further includes an identification module 73 configured to detect the target page according to the page features and obtain an identification result of the target page.

[0122] In some implementations, the identification module 73 is specifically configured to pre-process each statistical node in the page feature to generate a pre-processed page feature;

[0123] The preprocessed page features are input into the pre-trained recognition model to obtain the content or behavior of the target page.

[0124] In the technical solutions disclosed herein, the acquisition, storage, and application of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0125] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0126] In an exemplary embodiment, an electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method described in the above embodiment.

[0127] In an exemplary embodiment, the readable storage medium may be a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method according to the above embodiment.

[0128] In an exemplary embodiment, a computer program product includes a computer program, which implements the method according to the above embodiments when executed by a processor.

[0129] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0130] like Figure 8 As shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. Various programs and data required for the operation of the device 800 can also be stored in the RAM 803. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0131] Various components in device 800 are connected to I / O interface 805, including an input unit 806, such as a keyboard, mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a magnetic disk, optical disk, etc.; and a communication unit 809, such as a network card, modem, wireless communication transceiver, etc. The communication unit 809 allows device 800 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0132] The computing unit 801 can be a variety of general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as the page rendering method. For example, in some embodiments, the page rendering method can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the page rendering method described above can be performed. Alternatively, in other embodiments, the computing unit 801 can be configured to perform the page rendering method by any other appropriate means (e.g., by means of firmware).

[0133] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system comprising at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0134] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0135] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0136] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0137] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0138] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises through computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.

[0139] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not limited herein.

[0140] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.

Claims

1. A page feature acquisition method, characterized in that: The method comprises: Obtaining page data of a target page, and parsing the page data to obtain data of multiple levels in the page and parent-child relationships between the multiple levels; Generating a corresponding layout object according to the data rendering of each level, wherein the layout object includes a parent-child relationship of the corresponding level; Determining an area in the target page, where the area in the target page includes a window area displayed on the screen and / or an area where a pop-up window is displayed; Acquiring attribute characteristics of the layout objects in the region of the target page, and generating statistical nodes for each of the layout objects in the region of the target page based on the attribute characteristics of the layout objects and the parent-child relationships of the layout objects; the attribute characteristics of the layout objects include position information of the layout objects, parent node information of the layout objects, and cascading style sheet attributes of the layout objects; the statistical nodes include the parent-child relationship of the corresponding layout objects, the layout attributes of the corresponding layout objects, the node attributes of the corresponding layout objects, and the cascading style sheet attributes of the corresponding layout objects; the statistical nodes are data structures defined by protocol buffers; Preprocessing each statistical node in the page feature to generate a preprocessed page feature; inputting the preprocessed page feature into a pre-trained recognition model to obtain the content or behavior of the target page; the pre-trained recognition model is trained based on a pre-marked target page and the statistical nodes of the layout object in the target page; Determining the area in the target page includes: determining a second area in the target page, the second area including an area displayed on the screen; The acquiring the attribute characteristics of the layout objects in the area of ​​the target page, and generating a statistical node for each of the layout objects in the area of ​​the target page according to the attribute characteristics of the layout objects and the parent-child relationship of the layout objects, includes: Acquire attribute characteristics of the layout objects in the second area, and generate a statistical node for each of the layout objects in the second area based on the attribute characteristics of the layout objects and the parent-child relationship of the layout objects, wherein the statistical node includes the parent-child relationship of the corresponding layout object; The page features of the target page are generated according to each of the statistical nodes and the parent-child relationship of the statistical nodes.

2. The method according to claim 1, characterized in that The method further comprises: Obtaining attribute characteristics of each of the layout objects in the target page; generating a statistical node of the layout object according to the attribute characteristics of the layout object and the parent-child relationship of the layout object, wherein the statistical node includes the parent-child relationship of the corresponding layout object; The page features of the target page are generated according to each of the statistical nodes and the parent-child relationship of the statistical nodes.

3. The method according to claim 1, characterized in that Determining the area in the target page includes: Determine a first area in the target page, where the first area includes at least one layout object, and a parent-child relationship of the layout object includes one or more child layout objects; The acquiring the attribute characteristics of the layout objects in the area of ​​the target page, and generating a statistical node for each of the layout objects in the area of ​​the target page according to the attribute characteristics of the layout objects and the parent-child relationship of the layout objects, includes: Obtaining attribute characteristics of the layout object and each of the sub-layout objects; generating statistical nodes for the layout object and each of the sub-layout objects according to the attribute characteristics of the layout object, the attribute characteristics of each of the sub-layout objects, and the parent-child relationship of the layout objects, wherein the statistical nodes include the parent-child relationship of the corresponding layout objects; The page features of the target page are generated according to each of the statistical nodes and the parent-child relationship of the statistical nodes.

4. A device for acquiring page features, characterized in that: The device comprises: An acquisition module is used to acquire page data of a target page, and parse the page data to obtain data of multiple levels in the page and parent-child relationships between the multiple levels; A generation module, configured to generate a corresponding layout object according to the data rendering of each level, wherein the layout object includes a parent-child relationship of the corresponding level; The acquisition module is further configured to determine an area in the target page, the area in the target page including a window area displayed on the screen and / or an area displaying a pop-up window; when a set trigger condition is met, wait for a preset time period, acquire attribute characteristics of the layout objects in the area in the target page, and generate a statistical node for each layout object in the area in the target page based on the attribute characteristics of the layout objects and the parent-child relationship of the layout objects; the attribute characteristics of the layout objects include position information of the layout objects, parent node information of the layout objects, and cascading style sheet attributes of the layout objects; the statistical node includes the parent-child relationship of the corresponding layout object, the layout attributes of the corresponding layout object, the node attributes of the corresponding layout object, and the cascading style sheet attributes of the corresponding layout object; the statistical node is a data structure defined by a protocol buffer; The recognition module is used to pre-process each statistical node in the page feature to generate a pre-processed page feature; input the pre-processed page feature into a pre-trained recognition model to obtain the content or behavior of the target page; the pre-trained recognition model is trained based on a pre-marked target page and the statistical nodes of the layout objects in the target page; The acquisition module is specifically configured to determine a second area in the target page, where the second area includes an area displayed on the screen; Acquire attribute characteristics of the layout objects in the second area, and generate a statistical node for each of the layout objects in the second area based on the attribute characteristics of the layout objects and the parent-child relationship of the layout objects, wherein the statistical node includes the parent-child relationship of the corresponding layout object; The page features of the target page are generated according to each of the statistical nodes and the parent-child relationship of the statistical nodes.

5. The device according to claim 4, characterized in that The acquisition module is specifically used to acquire the attribute characteristics of each layout object in the target page; generating a statistical node of the layout object according to the attribute characteristics of the layout object and the parent-child relationship of the layout object, wherein the statistical node includes the parent-child relationship of the corresponding layout object; The page features of the target page are generated according to each of the statistical nodes and the parent-child relationship of the statistical nodes.

6. The device according to claim 4, characterized in that The acquisition module is specifically configured to determine a first area in the target page, the first area including at least one layout object, and the parent-child relationship of the layout object including one or more child layout objects; Obtaining attribute characteristics of the layout object and each of the sub-layout objects; generating statistical nodes for the layout object and each of the sub-layout objects according to the attribute characteristics of the layout object, the attribute characteristics of each of the sub-layout objects, and the parent-child relationship of the layout objects, wherein the statistical nodes include the parent-child relationship of the corresponding layout objects; The page features of the target page are generated according to each of the statistical nodes and the parent-child relationship of the statistical nodes.

7. An electronic device, characterized in that: include: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method according to any one of claims 1 to 3.

8. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to enable the computer to execute the method according to any one of claims 1 to 3.

9. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Webpage recognition method and electronic equipment

    CN108804469A