Method, device and method for generating buried point identification
By annotating node path information during the generation process of the virtual document object model tree, the problem of repeated control identification and operation delay in traceless point burying technology is solved, and efficient and accurate buried point data acquisition is achieved.
Patent Information
- Application Number
- CN201911201599.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-11-29
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2039-11-29
AI Technical Summary
The traceless point burying technology implemented based on XPath in the existing technology can easily lead to duplication of control identifiers and cannot ensure data accuracy. When events are triggered, nodes need to be calculated along the DOM tree structure, resulting in operational delays.
During the generation process of the virtual document object model tree, the path information of the current node is judged and marked, unique identification information is generated, and added to the attribute list to avoid repeated operations in subsequent calculations and directly obtain the identification information of the triggered control.
It reduces the runtime calculation burden, avoids operation delays, improves data accuracy and path readability, and facilitates developers to locate controls.
Smart Images

Figure CN112883250B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer information processing, and in particular to a method, device and method for generating a burying point identifier. Background Art
[0002] As the Internet industry pays more and more attention to data-driven operations, more and more companies and enterprises have the need to track data. In the field of user behavior analysis, the earliest tracking data was basically added manually by developers in the business code. This method has two disadvantages: on the one hand, the business code is full of various codes that are not related to the business, and the code may be difficult to maintain over time; on the other hand, developers manually add tracking code, which generates unnecessary workload. Therefore, the technology of tracking data without traces came into being.
[0003] The main invisible tracking technology on the market is based on XPath, such as CSS selectors. However, this method is prone to duplicate tracking and cannot ensure the accuracy of data. For example, when clicking on multiple identical elements at the same level, it is impossible to tell which element was clicked.
[0004] With regard to the technical problem that the prior art usually implements traceless tracking based on XPath, which results in the easy duplication of control identifiers, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present invention provide a method, device and method for generating a tracking point identifier, so as to at least solve the technical problem in the prior art that tracking point is usually implemented seamlessly based on XPath, so that the node identifier is calculated along the DOM tree structure when the event is triggered, resulting in operation delays.
[0006] According to one aspect of an embodiment of the present invention, a method for generating a tracking point identifier is provided, comprising: in the process of generating a virtual document object model tree, determining whether the path of a current node is marked, wherein the nodes included in the virtual document object model tree are used to represent at least one component in a browser, and the at least one component is used to generate a control in a display interface; determining that the path of the current node is not marked, and marking the path information of the current node to obtain identification information of the current node, wherein the identification information of the current node includes the path information of the current node.
[0007] According to another aspect of an embodiment of the present invention, a method for tracking points is also provided, including: detecting whether a target control is triggered by a specified event; determining whether the target control is triggered by a specified event, and returning identification information of a node associated with the target control to a back-end server used for tracking points, wherein the node is a node in a real document object model tree, the real document object model tree is generated based on a property list in a virtual document object model tree, and the identification information of the node is added to the property list during the process of creating the virtual document object model.
[0008] According to another aspect of an embodiment of the present invention, a method for embedding points is also provided, comprising: in the process of generating a virtual document object model, marking a current node to obtain identification information of the current node, wherein the identification information of the current node includes path information of the current node; adding the identification information of the current node to the attribute list of the virtual document object model, and constructing a virtual document object model tree according to the virtual document model; generating a real document object model tree corresponding to the virtual document object model tree according to the attribute list of the virtual document model, wherein the nodes in the real document object model tree have identification information corresponding to the nodes.
[0009] According to another aspect of an embodiment of the present invention, a device for generating a buried point identifier is also provided, including: a judgment module, used to judge whether the path of the current node is marked during the generation of a virtual document object model tree, wherein the nodes included in the virtual document object model tree are used to represent at least one component in the browser, and the at least one component is used to generate a control in a display interface; an annotation module, used to determine that the path of the current node is not marked, and annotate the path information of the current node to obtain the identification information of the current node, wherein the identification information of the current node includes the path information of the current node.
[0010] According to another aspect of an embodiment of the present invention, a storage medium is also provided, the storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the above-mentioned method of generating a burial point identifier.
[0011] According to another aspect of an embodiment of the present invention, a processor is further provided, and the processor is used to run a program, wherein the method for generating a burrowing point identifier is executed when the program is running.
[0012] In the embodiment of the present application, during the generation of the virtual document object model tree, it is determined whether the path of the current node is marked, wherein the nodes included in the virtual document object model tree are used to represent at least one component in the browser, and at least one component is used to generate a control in the display interface; it is determined that the path of the current node is not marked, and the path information of the current node is marked to obtain the identification information of the current node, wherein the identification information of the current node includes the path information of the current node. Compared with the prior art, the identification information of the node in the present application is determined when the virtual document object model tree is created, thereby actively generating the identification of the node, so that when the path information is needed later, the path information can be obtained without any calculation, thereby reducing the computational burden at runtime. It is also easy to notice that when the control is triggered, the identification information of the triggered control, that is, the identification information of the corresponding node, can be directly obtained by using the above scheme, avoiding the time lag, and solving the technical problem that the prior art usually implements traceless embedding based on XPath, so that the identification of the node is calculated along the DOM tree structure when the event is triggered, resulting in operation delay. The identification information generated according to the path information is easy for developers to understand and easy to locate. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0014] Figure 1 It is a hardware structure block diagram of a computer terminal (or mobile device) for implementing a method for generating a burial point identifier according to Embodiment 1 of the present application;
[0015] Figure 2 is a schematic diagram of a computer terminal (or mobile device) as a client terminal according to Embodiment 1 of the present application;
[0016] Figure 3 This is a flow chart of an optional method for generating a burial point identifier according to Embodiment 1 of the present application;
[0017] Figure 4 is a schematic diagram of generating a DOM tree according to Embodiment 1 of the present application;
[0018] Figure 5 This is a flow chart of an optional method for embedding points according to Example 2 of the present application;
[0019] Figure 6 It is a schematic diagram of an optional device for generating a burial point identifier according to Embodiment 3 of the present application;
[0020] Figure 7is a schematic diagram of an optional buried point device according to Example 4 of the present application; and
[0021] Figure 8 This is a flowchart of an optional method for generating a burial point identifier according to Example 5 of the present application;
[0022] Fig. 9 is a schematic diagram of an optional device for generating a burial point identifier according to Example 6 of the present application; and
[0023] Fig.10 This is a structural block diagram of an optional computer terminal according to Example 7 of the present application. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0026] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following explanations:
[0027] XML Path Language (XPath): A language used to locate a part of an XML document.
[0028] Tracking: A method of recording user behavior for subsequent data analysis, such as the number of times a user clicks on an icon, the length of time a user watches a video, page jumps, etc.
[0029] Traceless tracking: a technology that can complete tracking without intruding into business code; it uses technical means to record user behavior on the front-end page indiscriminately.
[0030] Document Object Model (DOM): A standard programming interface for processing Extensible Markup Language (XML) recommended by the World Wide Web Consortium. On a web page, objects that organize a page (or document) are organized in a tree structure, which is a standard model for representing objects in a document.
[0031] Virtual Document Object Model (VDOM): A data structure that expresses the browser's DOM objects with pure JavaScript objects, and has a one-to-one mapping relationship with the DOM objects it actually expresses.
[0032] Example 1
[0033] According to an embodiment of the present application, a method embodiment for generating a burial point identifier is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0034] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 The hardware structure block diagram of a computer terminal (or mobile device) for implementing a method for generating a buried point identifier is shown. Figure 1 As shown, the computer terminal 10 (or mobile device 10) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0035] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0036] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the method for generating a buried point identifier in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the method for generating a buried point identifier of the above-mentioned application is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0037] The transmission module 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission module 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission module 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0038] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0039] Figure 1 The hardware structure block diagram shown can be used not only as an exemplary block diagram of the above-mentioned computer terminal 10 (or mobile device), but also as an exemplary block diagram of a server. In an optional embodiment, Figure 2 The block diagram shows the use of the above Figure 1 The computer terminal 10 (or mobile device) shown is an embodiment of a client terminal. Figure 2As shown, the computer terminal 10 (or mobile device) can be connected to one or more servers 66 via a data network connection or electronic connection. In an optional embodiment, the above-mentioned computer terminal 10 (or mobile device) can be a mobile computing device, etc. The data network connection can be a local area network connection, a wide area network connection, an Internet connection, or other types of data network connections. The computer terminal 10 (or mobile device) can be executed to connect to a network service performed by a server (e.g., a secure server) or a group of servers. A network server is a network-based user service, such as a social network, cloud resources, email, online payment or other online applications.
[0040] Under the above operating environment, this application provides Figure 3 The method for generating a tracking point identifier is shown. Figure 3 FIG. 1 is a flow chart of an optional method for obtaining expression information according to Embodiment 1 of the present application. Figure 3 As shown, the method may include the following steps:
[0041] Step S302, during the process of generating the virtual document object model tree, determining whether the path of the current node is marked, wherein the nodes included in the virtual document object model tree are used to represent at least one component in the browser, and the at least one component is used to generate a control in the display interface.
[0042] In the process of generating the virtual document object model tree, a virtual document object model represented by a node may be first created, and then the virtual document object model tree is constructed according to the virtual document object model. The above steps are to start from the render method of the root component after creating the virtual document object model, to determine whether the model is marked, and if the path of the current node has not been marked, to mark the path information of the current node, and to call the h function (the h function is used to generate the virtual document object model tree) in sequence.
[0043] In an optional solution, the above-mentioned virtual document object model tree can be an implementation method of the virtual document object model. The virtual document object model can be a structure that expresses the browser's DOM components with simple JavaScript components, and has a one-to-one mapping relationship with the DOM objects it actually expresses.
[0044] The Virtual Document Object Model (VDOM) is relative to the Document Object Model (DOM). The DOM model uses a logical tree to represent a document. The end point of each branch of the tree is a node, and each node contains an object. The DOM can operate this tree in a specific way to change the structure, style or content of the document. Compared with the performance problems caused by frequent operations on the DOM, VDOM has a good mapping relationship for the DOM, mapping a series of operations that originally needed to be performed on the DOM to VDOM operations.
[0045] It should be noted that there is no restriction on the document representation method in the DOM specification. The basic elements of the DOM structure are nodes, and the structure of the document is composed of hierarchical nodes. In the DOM, if HTMLDocument is the root node and the remaining nodes are child nodes, the data structure organized into a tree is the DOM tree.
[0046] In an optional solution, the above components can be used to generate controls in the display interface, which can refer to any reusable objects or any code body that can interact with other objects; the above controls can be used for front-end presentation or human-computer interaction, and are components of the front-end, such as text input boxes, drop-down boxes, radio check boxes, containers, etc.
[0047] Step S304, determining that the path of the current node is not marked, and marking the path information of the current node to obtain identification information of the current node, wherein the identification information of the current node includes the path information of the current node.
[0048] In an optional solution, the above path may represent the position of the node in the virtual document object model tree.
[0049] Since the node identifiers are determined during the construction of the virtual document object tree, the node identifiers are actively generated, so that when the path information is needed later, no further calculations are required to obtain the path information, thereby reducing the computational burden at runtime.
[0050] Therefore, the identification information of each node must be different, thus solving the technical problem of easy duplication of control identification caused by seamless tracking based on XPath.
[0051] It is easy to notice that the method of implementing traceless tracking based on XPath is to search for the control identifier along the DOM tree only after the control is triggered, which has a certain delay. However, this application marks the node identifier information during the generation of the DOM tree. Therefore, when the control is triggered, the identifier information of the triggered control can be directly obtained, that is, the identifier information of the corresponding node, avoiding time loss. Finally, since the node annotation is completed in the process of generating the VDOM tree, when the path information is needed later, no further calculation is required to obtain the path information, thus reducing the computational burden at runtime.
[0052] In an optional embodiment, starting from the rendering method of the root component, during the generation of the virtual document object model tree, it is determined whether the path of the current node is marked. If the path of the current node is not marked, the path information of the current node is marked.
[0053] In the embodiment of the present application, in the process of generating the virtual document object model tree, it is determined whether the path of the current node is marked, wherein the node included in the virtual document object model tree is used to represent at least one component in the browser, and at least one component is used to generate a control in the display interface; it is determined that the path of the current node is not marked, and the path information of the current node is marked to obtain the identification information of the current node, wherein the identification information of the current node includes the path information of the current node. Compared with the prior art, the identification information of the node in the present application is determined when the virtual document object model tree is created, thereby actively generating the identification of the node, so that when the path information is needed later, the path information can be obtained without any calculation, thereby reducing the calculation burden at runtime. It is also easy to notice that when the control is triggered, the identification information of the triggered control, that is, the identification information of the corresponding node, can be directly obtained by using the above scheme, avoiding the time lag, and solving the technical problem that the prior art usually implements traceless embedding based on XPath, so that the identification of the node is calculated along the DOM tree structure when the event is triggered, resulting in operation delay.
[0054] Optionally, step S304 determines that the path of the current node is not marked, and marks the path information of the current node, which may specifically include the following steps:
[0055] Step S3041, determining the path information of the current node and the component name represented by the current node as identification information of the current node, wherein the identification information is character string information.
[0056] In an optional solution, the above-mentioned string information may include path information and the name of the component represented by the current node.
[0057] Step S3042: label the current node according to the identification information.
[0058] The annotation implemented with XPath is difficult to debug during the development process, because the generated identification information is machine-specific and obscure, and it is difficult for developers to quickly locate DOM elements through their paths; while the above-mentioned string information of the present application contains the component name of the component corresponding to the node, so during the development process, developers can quickly understand its meaning to facilitate debugging, thereby solving the problem of poor path readability when using XPath to implement traceless embedding, which leads to difficulty in positioning during development and debugging.
[0059] Optionally, the current node is used to represent a native component of the browser or a custom component of the browser.
[0060] In an optional solution, the above-mentioned native components can be created by the browser, such as camera, map, video, etc.; the above-mentioned custom components can be created by the user.
[0061] In an optional embodiment, if the current node is a native component of the browser, step S3042 marks the current node according to the identification information, and may include step S30421 of marking the identification information on the current node.
[0062] For example, if the native component is "div, p" of the browser, the identification information is directly marked on the current node of the virtual document object model tree, and the component name "ROOT, div" can be added to the path information, where ROOT is used to represent the path information.
[0063] In another optional embodiment, if the current node is a custom component of the browser, step S3042 marks the current node according to the identification information, which may include step S30422 of marking the identification information on the root node of the virtual document object model tree.
[0064] In the above scheme, when marking the nodes of the custom component, it is necessary to return to the root node for marking. For example, when marking the identification information on the root node of the virtual document object model tree, the component name "ROOT, custom_component_name" can be added to the path information. Similarly, ROOT is used to represent the path information.
[0065] It should be noted that the use of custom components can increase the sample size of the final annotated path set. If the traditional XPath method or DOM tree is used to form a path, the elements in the path belong to the set of elements allowed in the HTML language. However, since the custom components are added in this application, it is equivalent to adding a dimension to the final path, and the set size of this dimension is infinite in theory.
[0066] Optionally, when the virtual DOM tree is mapped to the real DOM tree, the identification information of each node in the virtual DOM tree is stored in the corresponding node in the real DOM tree. In an optional solution, the above storage is a data attribute of the node.
[0067] As an optional embodiment, the mapping method may be: after determining that the path of the current node is not marked and marking the path information of the current node, write the identification information of the current node into the attribute list of the node; construct a virtual document object model tree based on multiple nodes; and generate a real document object model tree corresponding to the virtual document object model tree based on the attribute list of the node, wherein the nodes in the real document object model tree have the identification information corresponding to the nodes.
[0068] The attribute list of the above node is the attribute list of the virtual document object model tree represented by the node. The front end will generate the real DOM based on the attribute list of VDOM, and the real DOM will be marked with a path. Figure 4 is a schematic diagram of generating a DOM tree according to Example 1 of the present application, combined with Figure 4 As shown, firstly, VODM is created from the root. The steps of creating VDOM include parsing the attributes of VDOM, generating a path label (ie, the above-mentioned identification information), adding the path label to the attribute list of VDOM, generating VDOM and outputting VDOM. Figure 4 The right side shows the process of generating a VDOM tree based on vdom. If it is a native HTML tag, a VDOM tree can be created directly. If it is a user-defined tag (i.e., a front-end component), the generated VDOM will contain a render method, which provides a function for generating VDOM (which can be the createElement function in react, or the $createElement function in vue, etc.). When the render method is executed, a VDOM tree inside the component will be generated. This process is repeated to generate the entire VDOM tree, and the entire VDOM tree is marked with a path. Finally, the front-end renders the VDOM tree into a real DOM tree marked with a path.
[0069] It should be noted that the biggest feature of the front-end framework based on VDOM is component-based combined development, so there will be many different custom components. Each custom component will have a main render method, which defines the VDOM that this component should render; in addition, it will provide a basic h function for generating the VDOM structure. A render method can be regarded as a combination of multiple h functions. The process of generating VDOM can be regarded as a depth-first call process of a render function tree. Therefore, in the process of generating the final VDOM tree, a series of recursive calls will be made. Finally, the minimum DOM structure that needs to be updated is calculated through the comparison algorithm.
[0070] As mentioned earlier, compared with the performance problems caused by frequent DOM operations, VDOM has done a good job of mapping the DOM, mapping a series of operations that originally needed to be performed on the DOM to VDOM operations.
[0071] It should be noted here that the marking method in the above steps is not limited here. In addition to the method of mapping the marked paths to the real DOM tree in the above solution, these marked paths can also be used in other ways.
[0072] Optionally, after executing the above step S304 to generate a real document object model tree corresponding to the virtual document object model tree based on the attribute list of the node, the above method may further include:
[0073] Step S3061, calling the rendering function corresponding to the real document object model tree.
[0074] Step S3062: Render the control corresponding to the current node to the display interface based on the rendering function.
[0075] Optionally, the control is associated with a specified event, and when the control is triggered by the specified event, identification information of the node associated with the control is returned to the backend server used for tracking.
[0076] In an optional solution, the above-mentioned specified event can be a user's operation behavior on the control, such as a mouse click, a double-click, a scroll wheel slide, a button click, etc.
[0077] In the era of mobile Internet, user behavior data is very important for every company and enterprise. How long the user stays on the page, what buttons they click, what content they browse, what mobile phone, what network environment, what version of the App, etc. need to be clear, so as to recommend appropriate information to users or help developers analyze online problems to improve the corresponding application software.
[0078] In the above steps, the user's operations on the controls will be uploaded to the backend server used for tracking, which is convenient for the analysis and calculation of user behavior.
[0079] In an embodiment of the present application, during the generation of the virtual document object model tree, it is determined whether the path of the current node is marked, wherein the nodes included in the virtual document object model tree are used to represent at least one component in the browser, and at least one component is used to generate controls in the display interface; it is determined that the path of the current node is not marked, and the path information of the current node is marked to obtain the identification information of the current node, wherein the identification information of the current node includes the path information of the current node. The above scheme marks the unique path of the element on the browser during the generation of the VDOM tree through the cooperation of VDOM technology and custom components, and does not require dynamic calculation when the browser interacts, which can save the performance overhead at runtime; marking the identification information on the VDOM node greatly facilitates the extraction and use of subsequent paths, thereby solving the technical problem that the prior art usually implements traceless point embedding based on XPath, so that the node identification is calculated along the DOM tree structure when the event is triggered, resulting in operation delays.
[0080] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0081] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0082] Example 2
[0083] According to an embodiment of the present application, a method for embedding a point is also provided, such as Figure 5 As shown, the method can be applied to the front-end VDOM library. The implementation process of the present application is described in detail from the perspective of the front-end VDOM library, which may include the following steps:
[0084] Step S502: Detect whether the target control is triggered by a specified event.
[0085] In an optional solution, the target control can be used for front-end presentation or human-computer interaction and is a component of the front-end, such as a text input box, drop-down box, radio check box, container, etc. The specified event can be a mouse click, double-click, scroll wheel slide, click a button, and other user operations on the control.
[0086] Step S504, determines whether the target control is triggered by the specified event, and returns the identification information of the node associated with the target control to the back-end server used for tracking, wherein the node is a node in the real document object model tree, the real document object model tree is generated according to the attribute list in the virtual document object model tree, and the identification information of the node is added to the attribute list during the process of creating the virtual document object model.
[0087] In an optional solution, the above-mentioned virtual document object model tree can be an implementation method of the virtual document object model. The virtual document object model can be a structure that expresses the browser's DOM components with simple JavaScript components, and has a one-to-one mapping relationship with the DOM objects it actually expresses.
[0088] The Virtual Document Object Model (VDOM) is relative to the Document Object Model (DOM). The DOM model uses a logical tree to represent a document. The end point of each branch of the tree is a node, and each node contains an object. The DOM can operate this tree in a specific way to change the structure, style or content of the document. Compared with the performance problems caused by frequent operations on the DOM, VDOM has a good mapping relationship for the DOM, mapping a series of operations that originally needed to be performed on the DOM to the operations on the VDOM.
[0089] It should be noted that there is no restriction on the document representation method in the DOM specification. The basic elements of the DOM structure are nodes, and the structure of the document is composed of hierarchical nodes. In the DOM, if HTMLDocument is the root node and the remaining nodes are child nodes, the data structure organized into a tree is the DOM tree.
[0090] In the era of mobile Internet, user behavior data is very important for every company and enterprise. How long the user stays on the page, what buttons they click, what content they browse, what mobile phone, what network environment, what version of the App, etc. need to be clear, so as to recommend appropriate information to users or help developers analyze online problems to improve the corresponding application software.
[0091] In the above steps, the user's operations on the target control will be uploaded to the backend server used for tracking, which is convenient for the analysis and calculation of user behavior.
[0092] Optionally, before step S502 detects whether the target control is triggered by a specified event, the above method may further include step S501, generating identification information of the node. Specifically, step S501 may further include:
[0093] Step S5012, during the process of generating the virtual document object model tree, determining whether the path of the current node is marked, wherein the nodes included in the virtual document object model tree are used to represent at least one component in the browser, and the at least one component is used to generate a control in the display interface.
[0094] In an optional solution, the above components can be used to generate controls in a display interface, which can refer to any reusable object or any code body that can interact with other objects; the above path can represent the location of a node.
[0095] Step S5014, determining that the path of the current node is not marked, and marking the path information of the current node to obtain identification information of the current node, wherein the identification information of the current node includes the path information of the current node.
[0096] The identification information of the node in this application is determined when the virtual document object model tree is created, thereby actively generating the identification of the node, so that when the path information is needed later, no further calculation is required to obtain the path information, thereby reducing the computational burden at runtime. This solves the technical problem that the prior art usually implements traceless point embedding based on XPath, so that the identification of the node is calculated along the DOM tree structure only when the event is triggered, resulting in operation delays. It is easy to notice that when a control is triggered, the identification information of the triggered control, that is, the identification information of the corresponding node, can be directly obtained using the above solution, avoiding time lags.
[0097] Step S5016: Add the identification information of the current node to the attribute list of the node.
[0098] In the above steps, the identification information of the current node is added to the attribute list of the node, so that each node in the generated real document object model tree can have corresponding identification information.
[0099] It is easy to notice that the method of implementing traceless tracking based on XPath is to search for the identifier of the control along the DOM tree only after the control is triggered, which has a certain delay, while the present application marks the identification information of the node during the generation of the DOM tree. Therefore, when the control is triggered, the identification information of the triggered control can be directly obtained, that is, the identification information of the corresponding node, avoiding time loss. In addition, the annotation implemented by XPath is difficult to debug during the development process, because the generated identification information is machine-specific and obscure, and it is difficult for developers to quickly locate DOM elements through the path; while the present application generates identification information based on the path information, which is convenient for developers to locate. Finally, since the annotation of nodes is completed in the process of generating the VDOM tree, when these path information are needed later, no further calculations are required to obtain the path information, reducing the computational burden at runtime.
[0100] Optionally, step S5014 determines that the path of the current node is not marked, and marks the path information of the current node, which may include the following steps:
[0101] Step S50141, determining the path information of the current node and the component name represented by the current node as identification information of the current node, wherein the identification information is character string information.
[0102] In an optional solution, the above-mentioned string information may include path information and the name of the component represented by the current node.
[0103] Since the above string information contains many component names, even if the components are user-defined, and the names of the custom components are originally customized by the developers, the developers can quickly understand their meanings during the development process to facilitate debugging.
[0104] Step S50142, label the current node according to the identification information.
[0105] Optionally, the current node is used to represent a native component of the browser or a custom component of the browser.
[0106] In an optional solution, the above-mentioned native components can be created by the client, such as camera, map, video, etc.; the above-mentioned custom components can be created by the user.
[0107] In an optional embodiment, if the current node is a native component of the browser, marking the current node according to the identification information includes: marking the identification information on the current node.
[0108] For example, if the native component is "div, p" of the browser, the identification information is directly marked on the current node of the virtual document object model tree, and the component name "ROOT, div" can be added to the path information.
[0109] In an optional embodiment, if the current node is a custom component of the browser, marking the current node according to the identification information includes: marking the identification information on the root node of the virtual document object model tree.
[0110] Since native components are at the highest level, when marking nodes of custom components, you need to return to the root node for marking. For example, to mark the root node of the virtual document object model tree with identification information, you can add the component name "ROOT, custom_component_name" to the path information.
[0111] It should be noted that the use of custom components can increase the sample size of the final annotated path set. If the traditional XPath method or DOM tree is used to form a path, the elements in the path belong to the set of elements allowed in the HTML language. However, since the custom components are added in this application, it is equivalent to adding a dimension to the final path, and the set size of this dimension is infinite in theory.
[0112] Optionally, when the virtual document object model tree is mapped to the real document object model tree, identification information of each node in the virtual document object model tree is stored in a corresponding node in the real document object model tree.
[0113] In an optional solution, the above storage format may be a data attribute.
[0114] As mentioned earlier, compared with the performance problems caused by frequent DOM operations, VDOM has done a good mapping relationship for DOM, mapping a series of operations that originally needed to be performed on DOM to VDOM operations.
[0115] After the above steps, a complete VDOM tree with identifiers is obtained, which needs to be mapped to the real DOM tree structure, and the identifier information of all nodes in the VDOM tree is stored in various forms on the corresponding nodes of the DOM tree.
[0116] It should be noted here that the marking method in the above steps is not limited here. For example, the marked paths do not necessarily have to be mapped to the real DOM tree, and these marked paths can be used in other ways.
[0117] Optionally, after determining in step S5014 that the path of the current node is not marked and marking the path information of the current node, the above method may further include the following steps:
[0118] Step S50141, calling the rendering function corresponding to the current node.
[0119] In an optional solution, the above rendering function can be the createElement function in react, or the $createElement function in vue, both of which are referred to as h functions in this application.
[0120] Step S50142: Render the control corresponding to the current node to the display interface based on the rendering function.
[0121] It should be noted that the biggest feature of the front-end framework based on VDOM is component-based combined development, so there will be many different custom components. Each custom component will have a main render method, which defines the VDOM that this component should render; in addition, it will provide a basic h function for generating the VDOM structure. A render method can be regarded as a combination of multiple h functions. The process of generating VDOM can be regarded as a depth-first call process of a render function tree. Therefore, in the process of generating the final VDOM tree, a series of recursive calls will be made. Finally, the minimum DOM structure that needs to be updated is calculated through the comparison algorithm.
[0122] In the above steps, starting from the render method of the root component, if the path of the current node has not been marked, the path information of the current node is marked, and the h function is called in sequence.
[0123] It should be noted that the optional or preferred implementation of this embodiment can refer to the relevant description in Example 1, but is not limited to the contents disclosed in Example 1 and will not be repeated here.
[0124] It should be noted here that the preferred implementation scheme involved in the above-mentioned Example 2 of the present application is the same as the scheme provided in Example 1 and the application scenario implementation process, but is not limited to the scheme provided in Example 1.
[0125] Example 3
[0126] According to an embodiment of the present application, a device for generating a buried point identifier is also provided, such as Figure 6 As shown, the device 600 includes: a judgment module 602 and a marking module 604.
[0127] Among them, the judgment module 602 is used to determine whether the path of the current node is marked during the generation of the virtual document object model tree, wherein the nodes included in the virtual document object model tree are used to represent at least one component in the browser, and at least one component is used to generate controls in the display interface; the marking module 604 is used to determine that the path of the current node is not marked, and mark the path information of the current node to obtain the identification information of the current node, wherein the identification information of the current node includes the path information of the current node.
[0128] Optionally, the labeling module may include: a determination module for determining the path information of the current node and the component name represented by the current node as identification information of the current node, wherein the identification information is string information; and a labeling submodule for labeling the current node according to the identification information.
[0129] Optionally, the current node is used to represent a native component of the browser or a custom component of the browser.
[0130] Optionally, the marking submodule may include a first marking submodule, which is used to mark identification information on the current node if the current node is a native component of the browser.
[0131] Optionally, the marking submodule may include a second marking submodule, which is used to mark identification information on the root node of the virtual document object model tree if the current node is a custom component of the browser.
[0132] Optionally, the above-mentioned device also includes: a first writing module, used to write the identification information of the current node into the attribute list of the node after determining that the path of the current node is not marked and marking the path information of the current node; a construction module, used to construct a virtual document object model tree according to multiple nodes; a generation module, used to generate a real document object model tree corresponding to the virtual document object model tree based on the attribute list of the node, wherein the nodes in the real document object model tree have the identification information corresponding to the nodes.
[0133] Optionally, the above-mentioned device also includes: a calling module, which is used to call the rendering function corresponding to the real document object model tree after generating the real document object model tree corresponding to the virtual document object model tree based on the attribute list of the node; and a rendering module, which is used to render the controls corresponding to the real document object model tree to the display interface based on the rendering function.
[0134] Optionally, the control is associated with a specified event, and the above-mentioned device may also include: a return module, which is used to return the identification information of the node associated with the control to the back-end server used for burying points when the control is triggered by the specified event.
[0135] It should be noted that the above-mentioned judgment module 602 and marking module 604 correspond to steps S302 to S304 in Example 1, and the examples and application scenarios implemented by the two modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules as part of the device can be run in the computer terminal 10 provided in Example 1.
[0136] Example 4
[0137] According to an embodiment of the present application, a device for embedding points is also provided, such as Figure 7 As shown, the device 700 includes: a detection module 702 and a return module 704 .
[0138] Among them, the detection module 702 is used to detect whether the target control is triggered by a specified event; the return module 704 is used to determine whether the target control is triggered by a specified event, and return the identification information of the node associated with the target control to the back-end server used for embedding, wherein the node is a node in the real document object model tree, and the real document object model tree is generated according to the attribute list in the virtual document object model tree, and the identification information of the node is added to the attribute list in the process of creating the virtual document object model.
[0139] Optionally, the above-mentioned device may also include a generation module, which is used to generate the identification information of the node before detecting whether the target control is triggered by the specified event. Specifically, the generation module may include: a judgment module, which is used to judge whether the path of the current node is marked during the generation of the virtual document object model tree, wherein the nodes included in the virtual document object model tree are used to represent at least one component in the browser, and at least one component is used to generate the control in the display interface; a marking module, which is used to determine that the path of the current node is not marked, and mark the path information of the current node to obtain the identification information of the current node, wherein the identification information of the current node includes the path information of the current node; a second writing module, which is used to add the identification information of the current node to the attribute list of the node.
[0140] Optionally, the labeling module may include: a determination module for determining the path information of the current node and the component name represented by the current node as identification information of the current node, wherein the identification information is string information; and a labeling submodule for labeling the current node according to the identification information.
[0141] Optionally, the current node is used to represent a native component of the browser or a custom component of the browser.
[0142] Optionally, the marking submodule may include a first marking submodule, which is used to mark identification information on the current node if the current node is a native component of the browser.
[0143] Optionally, the marking submodule may include a second marking submodule, which is used to mark identification information on the root node of the virtual document object model tree if the current node is a custom component of the browser.
[0144] Optionally, when the virtual document object model tree is mapped to the real document object model tree, identification information of each node in the virtual document object model tree is stored in a corresponding node in the real document object model tree.
[0145] Optionally, the above-mentioned device also includes: a calling module, which is used to call the rendering function corresponding to the current node after determining that the path of the current node is not marked and marking the path information of the current node; a rendering module, which is used to render the control corresponding to the current node to the display interface based on the rendering function.
[0146] It should be noted that the detection module 702 and the return module 704 correspond to steps S502 to S504 in Example 2, and the examples and application scenarios implemented by the two modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned Example 2. It should be noted that the above-mentioned modules as part of the device can be run in the computer terminal 10 provided in Example 1.
[0147] Example 5
[0148] According to an embodiment of the present application, a method for embedding a point is also provided, such as Figure 8 As shown, the method comprises the following steps:
[0149] Step S81, in the process of generating the virtual document object model, marking the current node to obtain identification information of the current node, wherein the identification information of the current node includes path information of the current node.
[0150] In the process of generating the virtual document object model tree, a virtual document object model represented by a node may be first created, and then the virtual document object model tree is constructed according to the virtual document object model. The above steps are to start from the render method of the root component after creating the virtual document object model, to determine whether the model is marked, and if the path of the current node has not been marked, to mark the path information of the current node, and to call the h function (the h function is used to generate the virtual document object model tree) in sequence.
[0151] In an optional solution, the above-mentioned virtual document object model tree can be an implementation method of the virtual document object model. The virtual document object model can be a structure that expresses the browser's DOM components with simple JavaScript components, and has a one-to-one mapping relationship with the DOM objects it actually expresses.
[0152] Step S83: adding the identification information of the current node to the attribute list of the virtual document object model, and constructing a virtual document object model tree according to the virtual document model.
[0153] The attribute list of the above node is the attribute list of the virtual document object model tree represented by the node. The front end will generate the real DOM based on the attribute list of VDOM, and the real DOM will be marked with a path. Figure 4is a schematic diagram of generating a DOM tree according to Example 1 of the present application, combined with Figure 4 As shown, firstly, VODM is created from the root. The steps of creating VDOM include parsing the attributes of VDOM, generating a path label (ie, the above-mentioned identification information), adding the path label to the attribute list of VDOM, generating VDOM and outputting VDOM.
[0154] Step S85: Generate a real document object model tree corresponding to the virtual document object model tree according to the attribute list of the virtual document model, wherein the nodes in the real document object model tree have identification information corresponding to the nodes.
[0155] Still combined Figure 4 As shown, the right side is the process of generating a VDOM tree based on vdom. If it is a native HTML tag, the VDOM tree can be created directly. If it is a user-defined tag (i.e., the front-end Component), the generated VDOM will contain a render method, which provides a function to generate VDOM (which can be the createElement function in react, or the $createElement function in vue, etc.). When the render method is executed, the VDOM tree inside the Component will be generated. In this way, the entire VDOM tree is generated, and the entire VDOM tree is marked with a path. Finally, the front-end renders the VDOM tree into a real DOM tree marked with a path.
[0156] In the embodiment of the present application, the current node is marked in the process of generating the virtual document object model, the identification information of the current node is obtained, the identification information of the current node is added to the attribute list of the virtual document object model, and a virtual document object model tree is formed according to the virtual document model; the real document object model tree corresponding to the virtual document object model tree is generated according to the attribute list of the virtual document model, so that the nodes in the real document object model tree have the identification information corresponding to the node. Compared with the prior art, the identification information of the node in the present application is determined when the virtual document object model tree is created, so that the identification of the node is actively generated, so that when the path information is needed later, the path information can be obtained without any calculation, so that the calculation burden at runtime can be reduced. Therefore, the technical problem that the prior art usually implements traceless embedding based on XPath, so that the identification of the node is calculated along the DOM tree structure when the event is triggered, resulting in operation delays. It is easy to notice that when the control is triggered, the identification information of the triggered control, that is, the identification information of the corresponding node, can be directly obtained using the above scheme, avoiding time lag.
[0157] Example 6
[0158] According to an embodiment of the present application, a device for embedding points is also provided, such as Fig. 9 As shown, the device 900 includes:
[0159] The marking module 902 marks the current node during the process of generating the virtual document object model to obtain identification information of the current node, wherein the identification information of the current node includes path information of the current node.
[0160] The adding module 904 is used to add the identification information of the current node to the attribute list of the virtual document object model, and construct a virtual document object model tree according to the virtual document model.
[0161] The generating module 906 is configured to generate a real document object model tree corresponding to the virtual document object model tree according to the attribute list of the virtual document model, wherein the nodes in the real document object model tree have identification information corresponding to the nodes.
[0162] It should be noted that the above-mentioned marking module 902, adding module 904 and generating module 906 correspond to steps S81 to S85 in Example 5, and the examples and application scenarios implemented by the two modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned Example 2. It should be noted that the above-mentioned modules as part of the device can be run in the computer terminal 10 provided in Example 1.
[0163] Example 7
[0164] The embodiment of the present application may provide a computer terminal, which may be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the computer terminal may also be replaced by a terminal device such as a mobile terminal.
[0165] Optionally, in this embodiment, the computer terminal may be located in at least one network device among a plurality of network devices of the computer network.
[0166] In this embodiment, the above-mentioned computer terminal can execute the program code of the following steps in the method for generating a tracking point identifier of an application: in the process of generating a virtual document object model tree, determine whether the path of the current node is marked, wherein the nodes included in the virtual document object model tree are used to represent at least one component in the browser, and at least one component is used to generate controls in the display interface; determine that the path of the current node is not marked, and mark the path information of the current node to obtain the identification information of the current node, wherein the identification information of the current node includes the path information of the current node.
[0167] Optionally, Fig.10 is a structural block diagram of a computer terminal according to an embodiment of the present application. Fig.10 As shown, the computer terminal A may include: one or more (only one is shown in the figure) processors 102 and a memory 104.
[0168] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the method and device for generating a buried point identifier in the embodiment of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned method for generating a buried point identifier. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the computer terminal A via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0169] The processor can call the information and application stored in the memory through the transmission module to perform the following steps: in the process of generating the virtual document object model tree, determine whether the path of the current node is marked, wherein the nodes included in the virtual document object model tree are used to represent at least one component in the browser, and at least one component is used to generate controls in the display interface; determine that the path of the current node is not marked, and mark the path information of the current node to obtain the identification information of the current node, wherein the identification information of the current node includes the path information of the current node.
[0170] Optionally, the processor may also execute the following program code steps: determining that the path of the current node is not marked, and marking the path information of the current node, including: determining that the path information of the current node and the component name represented by the current node are identification information of the current node, wherein the identification information is string information; marking the current node according to the identification information.
[0171] Optionally, the processor may further execute program code of the following steps: the current node is used to represent a native component of the browser or a custom component of the browser.
[0172] Optionally, the processor may further execute program code of the following steps: the current node is a native component of the browser, and the current node is marked according to the identification information, including: marking the identification information on the current node.
[0173] Optionally, the processor may further execute program code of the following steps: the current node is a custom component of the browser, and the current node is marked according to the identification information, including: marking the identification information on the root node of the virtual document object model tree.
[0174] Optionally, the processor may also execute the following program code steps: after determining that the path of the current node is not marked and marking the path information of the current node, write the identification information of the current node into the attribute list of the node; construct a virtual document object model tree based on multiple nodes; and generate a real document object model tree corresponding to the virtual document object model tree based on the attribute list of the node, wherein the nodes in the real document object model tree have the identification information corresponding to the nodes.
[0175] Optionally, the processor may also execute the following program code steps: after generating a real document object model tree corresponding to the virtual document object model tree based on the attribute list of the node, calling a rendering function corresponding to the real document object model tree; and rendering the controls corresponding to the real document object model tree to the display interface based on the rendering function.
[0176] Optionally, the processor may also execute program code of the following steps: the control is associated with a specified event, and when the control is triggered by the specified event, identification information of the node associated with the control is returned to the backend server used for tracking.
[0177] It can be understood by those skilled in the art that Fig.10 The structure shown is for illustration only, and the computer terminal may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a handheld computer, a mobile Internet device (Mobile Internet Devices, MID), a PAD, or other terminal devices. Fig.10 The structure of the electronic device is not limited. For example, the computer terminal 10 may also include Fig.10 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Fig.10 Different configurations are shown.
[0178] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0179] Example 8
[0180] The embodiment of the present application further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the method for generating a burying point identifier provided in the first embodiment or the burying point method provided in the second embodiment.
[0181] Optionally, in this embodiment, the above storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.
[0182] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: in the process of generating a virtual document object model tree, determining whether the path of the current node is marked, wherein the nodes included in the virtual document object model tree are used to represent at least one component in the browser, and the at least one component is used to generate controls in the display interface; determining that the path of the current node is not marked, and marking the path information of the current node to obtain identification information of the current node, wherein the identification information of the current node includes the path information of the current node.
[0183] In an embodiment of the present application, by running the program code stored in the storage medium, in the process of generating the virtual document object model tree, it is determined whether the path of the current node is marked, wherein the node included in the virtual document object model tree is used to represent at least one component in the browser, and at least one component is used to generate a control in the display interface; it is determined that the path of the current node is not marked, and the path information of the current node is marked to obtain the identification information of the current node, wherein the identification information of the current node includes the path information of the current node. Compared with the prior art, the identification information of the node in the present application is determined when the virtual document object model tree is created, thereby actively generating the identification of the node, so that when the path information is needed later, the path information can be obtained without any calculation, so that the calculation burden at runtime can be reduced. It is also easy to notice that when the control is triggered, the identification information of the triggered control, that is, the identification information of the corresponding node, can be directly obtained by using the above scheme, avoiding the time lag, and solving the technical problem that the prior art usually implements traceless embedding based on XPath, so that the identification of the node is calculated along the DOM tree structure when the event is triggered, resulting in operation delay.
[0184] Example 9
[0185] According to an embodiment of the present application, a system for generating a burial point identifier is also provided, the system comprising:
[0186] Processor; and
[0187] The memory is connected to the processor and is used to provide the processor with instructions for processing the following processing steps: in the process of generating a virtual document object model tree, determining whether the path of the current node is marked, wherein the nodes included in the virtual document object model tree are used to represent at least one component in the browser, and the at least one component is used to generate a control in the display interface; determining that the path of the current node is not marked, and marking the path information of the current node to obtain identification information of the current node, wherein the identification information of the current node includes the path information of the current node.
[0188] It should be noted that the optional or preferred implementation of this embodiment can refer to the relevant description in Example 1, which will not be repeated here.
[0189] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0190] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0191] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0192] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0193] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0194] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0195] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for generating a buried point identifier, It is characterized in that include: During the process of generating a virtual document object model tree, determining whether a path of a current node is marked, wherein the node included in the virtual document object model tree is used to represent at least one component in a browser, and the at least one component is used to generate a control in a display interface; Determining that a path of the current node is not marked, determining identification information of the current node based on the path information of the current node, and marking the current node according to the identification information, wherein the identification information of the current node includes the path information of the current node; The control is associated with a specified event, and when the specified event triggers the control, identification information of a node associated with the control is returned to a backend server for embedding; Among them, after determining that the path of the current node is not marked and marking the current node according to the identification information, the method also includes: generating a real document object model tree corresponding to the virtual document object model tree, calling the rendering function corresponding to the real document object model tree; and rendering the controls in the real document object model tree to the display interface based on the rendering function.
2. The method according to claim 1, It is characterized in that Determining the identification information of the current node based on the path information of the current node, and marking the current node according to the identification information, includes: Determine the path information of the current node and the component name represented by the current node as identification information of the current node, wherein the identification information is character string information; The current node is marked according to the identification information.
3. The method according to claim 1 or 2, It is characterized in that The current node is used to represent a native component of the browser or a custom component of the browser.
4. The method according to claim 3, It is characterized in that Marking the current node according to the identification information includes: In response to the current node being a native component of the browser, the identification information is marked on the current node.
5. The method according to claim 3, It is characterized in that Marking the current node according to the identification information includes: In response to the current node being a custom component of the browser, the identification information is marked on a root node of the virtual document object model tree.
6. The method according to claim 1, It is characterized in that Generating a real document object model tree corresponding to the virtual document object model tree includes: Writing the identification information of the current node into the attribute list of the node; Constructing a virtual document object model tree according to a plurality of nodes; The real document object model tree corresponding to the virtual document object model tree is generated based on the attribute list of the node, wherein the nodes in the real document object model tree have identification information corresponding to the nodes.
7. A method of burying points, It is characterized in that include: Detect whether the target control is triggered by the specified event; Determine that the target control is triggered by the specified event, and return identification information of a node associated with the target control to a backend server used for embedding, wherein the node is a node in a real document object model tree, the real document object model tree is generated according to a property list in a virtual document object model tree, the identification information of the node is added to the property list during the process of creating the virtual document object model, the identification information is determined based on the path information of the node, and is used to mark the node; Among them, after determining that the target control is triggered by the designated event and returning the identification information of the node associated with the target control to the back-end server used for tracking, the method also includes: calling the rendering function corresponding to the real document object model tree; rendering the controls in the real document object model tree to the display interface based on the rendering function.
8. The method according to claim 7, It is characterized in that Before detecting whether the target control is triggered by a specified event, the method further includes: generating identification information of the node, wherein the step of generating the identification information of the node includes: During the generation of the virtual document object model tree, determining whether the path of the current node is marked, wherein the node included in the virtual document object model tree is used to represent at least one component in the browser, and the at least one component is used to generate a control in the display interface; Determining that the path of the current node is not marked, and marking the path information of the current node to obtain identification information of the current node, wherein the identification information of the current node includes the path information of the current node; The identification information of the current node is added to the attribute list of the node.
9. A device for generating a buried point identification, It is characterized in that include: A judgment module, used to judge whether the path of the current node is marked during the generation of the virtual document object model tree, wherein the node included in the virtual document object model tree is used to represent at least one component in the browser, and the at least one component is used to generate a control in the display interface; a marking module, configured to determine that the path of the current node is not marked, determine identification information of the current node based on the path information of the current node, and mark the current node according to the identification information, wherein the identification information of the current node includes the path information of the current node; The control is associated with a specified event, and when the specified event triggers the control, identification information of a node associated with the control is returned to a backend server for embedding; The device is also used to: generate a real document object model tree corresponding to the virtual document object model tree, call a rendering function corresponding to the real document object model tree; and render controls in the real document object model tree to the display interface based on the rendering function.
10. A method for producing a buried point mark, It is characterized in that include: In the process of generating the virtual document object model, based on the path information of the current node, the identification information of the current node is determined, and the current node is marked according to the identification information, wherein the identification information of the current node includes the path information of the current node; Adding the identification information of the current node to the attribute list of the virtual document object model, and constructing a virtual document object model tree according to the virtual document object model; Generating a real document object model tree corresponding to the virtual document object model tree according to the attribute list of the virtual document model, wherein the nodes in the real document object model tree have identification information corresponding to the nodes; Wherein, the identification information is used to enable the backend server to determine the path information of the node associated with the control; The method further comprises: when a designated event triggers the control, returning the identification information of the node associated with the control to a backend server for embedding; Among them, after generating a real document object model tree corresponding to the virtual document object model tree according to the attribute list of the virtual document model, the method also includes: calling a rendering function corresponding to the real document object model tree; and rendering the controls in the real document object model tree to a display interface based on the rendering function.
11. A storage medium, It is characterized in that The storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the method for generating a burial point identifier as described in any one of claims 1 to 6.
12. A processor, It is characterized in that The processor is used to run a program, wherein the program, when running, executes the method for generating a burial point identifier as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Node processing method and device in document object model, electronic equipment and storage equipment
CN108647025A
Structural data processing method and device, storage medium and electronic device
CN109445784A
Method and system for acquiring interactive data
CN110059282A
Application burying point method, device, computing equipment and system
CN110196953A
Source Identification of Compliance Errors in a Web Page with Custom Widgets
US20120110384A1
