CN112486770A - Client dotting reporting method and device, electronic equipment and storage medium - Google Patents

Client dotting reporting method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112486770A
CN112486770A CN202011364706.8A CN202011364706A CN112486770A CN 112486770 A CN112486770 A CN 112486770A CN 202011364706 A CN202011364706 A CN 202011364706A CN 112486770 A CN112486770 A CN 112486770A
Authority
CN
China
Prior art keywords
target
attribute
dom
dotting
node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011364706.8A
Other languages
Chinese (zh)
Other versions
CN112486770B (en
Inventor
辛洋汐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202011364706.8A priority Critical patent/CN112486770B/en
Publication of CN112486770A publication Critical patent/CN112486770A/en
Application granted granted Critical
Publication of CN112486770B publication Critical patent/CN112486770B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • G06F11/3072Monitoring arrangements determined by the means or processing involved in reporting the monitored data where the reporting involves data filtering, e.g. pattern matching, time or event triggered, adaptive or policy-based reporting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3089Monitoring arrangements determined by the means or processing involved in sensing the monitored data, e.g. interfaces, connectors, sensors, probes, agents
    • G06F11/3093Configuration details thereof, e.g. installation, enabling, spatial arrangement of the probes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3438Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment monitoring of user actions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3452Performance evaluation by statistical analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Probability & Statistics with Applications (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Information Transfer Between Computers (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The disclosure relates to a client dotting reporting method and device, electronic equipment and a storage medium. The method comprises the following steps: when a target trigger event occurs in a target page is monitored, a target DOM node in the target page is obtained, wherein the target DOM node comprises a first attribute which is used for representing a parameter needing dotting; identifying whether a target DOM node contains a second attribute, wherein the second attribute is used for representing that a dotting log is sent; responding to the situation that the target DOM node does not contain the second attribute, and acquiring corresponding data to be reported according to the first attribute; and generating corresponding log information according to the data to be reported, and sending the log information to the server. The method and the device can ensure the reporting times of the dotting data of the DOM node element, ensure that the dotting data is reported once, avoid repeated reporting of the data and ensure the accuracy of the reported data.

Description

Client dotting reporting method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a method and an apparatus for reporting a dotting at a client, an electronic device, and a storage medium.
Background
And dotting is to record the service data information when the view is changed after the view is changed due to user operation, and the dotting data can be used for analyzing products and operation and maintenance. After the client obtains the dotting data, the dotting data are uploaded to the server. The server can carry out statistics according to the data reported by the client so as to carry out data mining according to the statistical data. Therefore, how to avoid repeated reporting of data to ensure the accuracy of the data to be reported is very important.
Disclosure of Invention
The disclosure provides a client dotting reporting method, a client dotting reporting device, electronic equipment and a storage medium, which are used for at least solving the problem of how to avoid repeated reporting of data so as to ensure the accuracy of event information data to be reported in the related technology. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, a method for reporting a dotting by a client is provided, which includes:
when a target trigger event occurs in a target page is monitored, acquiring a target Document Object Model (DOM) node in the target page, wherein the target DOM node comprises a first attribute which is used for representing a parameter needing dotting;
identifying whether a target Document Object Model (DOM) node contains a second attribute, wherein the second attribute is used for representing that a dotting log is sent;
responding to the situation that the second attribute is not contained in the DOM node of the target document object model, and acquiring corresponding data to be reported according to the first attribute; and
and generating corresponding log information according to the data to be reported, and sending the log information to a server.
In some embodiments of the present disclosure, when sending the log information to a server, the method further includes:
and adding the second attribute into the target Document Object Model (DOM) node.
In some embodiments of the present disclosure, the target trigger event includes:
any one of a page scroll trigger event and a click trigger event.
In the embodiment of the present disclosure, the target trigger event is the page scrolling trigger event; the identifying whether the target Document Object Model (DOM) node contains a second attribute comprises the following steps:
identifying whether the position of the target Document Object Model (DOM) node is in a visual window;
and responding to the current position of the target Document Object Model (DOM) node in a visible window, and identifying whether the target Document Object Model (DOM) node contains a second attribute.
In the embodiment of the disclosure, the number of the target document object model DOM nodes is multiple; the identifying whether the target Document Object Model (DOM) node contains a second attribute comprises the following steps:
for each target Document Object Model (DOM) node, identifying whether the position of the current target DOM node is in a visual window;
and if the position of the current target DOM node is in the visible window, identifying whether the current target DOM node contains a second attribute.
In some embodiments of the present disclosure, the obtaining a target Document Object Model (DOM) node in the target page includes:
acquiring all Document Object Model (DOM) nodes in the target page;
finding out DOM nodes containing the first attribute from all document object model DOM nodes;
and determining the DOM node containing the first attribute as the target document object model DOM node.
According to a second aspect of the embodiments of the present disclosure, there is provided a client dotting reporting device, including:
the document dotting method comprises a first obtaining unit, a second obtaining unit and a third obtaining unit, wherein the first obtaining unit is configured to obtain a target Document Object Model (DOM) node in a target page when a target trigger event occurs in the target page, the target DOM node comprises a first attribute, and the first attribute is used for representing a parameter needing dotting;
the identification unit is configured to identify whether a second attribute is contained in the target Document Object Model (DOM) node or not, wherein the second attribute is used for representing that a dotting log is sent;
the second acquisition unit is configured to respond that the target Document Object Model (DOM) node does not contain the second attribute, and acquire corresponding data to be reported according to the first attribute;
the generating unit is configured to generate corresponding log information according to the data to be reported; and
a transmitting unit configured to transmit the log information to a server.
In some embodiments of the present disclosure, the apparatus further comprises:
an adding unit configured to add the second attribute to the target Document Object Model (DOM) node when the sending unit sends the log information to a server.
In some embodiments of the present disclosure, the target trigger event includes:
any one of a page scroll trigger event and a click trigger event.
In some embodiments of the present disclosure, the target trigger event is the page scrolling trigger event; the identification unit is specifically configured to:
identifying whether the position of the target Document Object Model (DOM) node is in a visual window;
and responding to the current position of the target Document Object Model (DOM) node in a visible window, and identifying whether the target Document Object Model (DOM) node contains a second attribute.
In some embodiments of the present disclosure, the target document object model DOM node is plural; the identification unit is specifically configured to:
for each target Document Object Model (DOM) node, identifying whether the position of the current target DOM node is in a visual window;
and if the position of the current target DOM node is in the visible window, identifying whether the current target DOM node contains a second attribute.
In some embodiments of the present disclosure, the first obtaining unit is specifically configured to:
acquiring all Document Object Model (DOM) nodes in the target page;
finding out DOM nodes containing the first attribute from all document object model DOM nodes;
and determining the DOM node containing the first attribute as the target document object model DOM node.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instruction to implement the client peer reporting method according to the first aspect.
According to a fourth aspect of the embodiments of the present disclosure, a storage medium is provided, where instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to execute the client peer reporting method according to the first aspect.
According to a fifth aspect of the embodiments of the present disclosure, a computer program product is provided, where instructions in the computer program product, when executed by a processor, perform the method for reporting a dotting report by a client according to the first aspect.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
when a target trigger event occurs in a target page is monitored, a target DOM node in the target page is obtained, wherein the target DOM node comprises a first attribute which is used for representing a parameter needing dotting; and identifying whether the target DOM node contains a second attribute, wherein the second attribute is used for representing the sent dotting log, responding to the fact that the target DOM node does not contain the second attribute, acquiring corresponding data to be reported according to the first attribute, generating corresponding log information according to the data to be reported, and sending the log information to the server. Therefore, the DOM node elements needing to be subjected to dotting are found out from the target page through the first attribute, and whether the DOM node elements send dotting logs to the server or not is judged through the second attribute, so that the reporting times of the dotting data of the DOM node elements can be guaranteed, the reporting times can be guaranteed once, the repeated reporting of the data can be avoided, and the accuracy of the reported data can be guaranteed. In addition, in the development stage, only dotting data needs to be written to the DOM in the page in an attribute form, namely, two attributes are added to the DOM node, so that element dotting can be sent out when a page target event is triggered, and one element is reported once, and the complexity of the development process is greatly reduced.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
Fig. 1 is a flowchart illustrating a method for reporting a dotting by a client according to an exemplary embodiment.
Fig. 2 is a flowchart illustrating a method for reporting a dotting by a client according to another exemplary embodiment.
Fig. 3 is a flowchart illustrating a method for reporting a dotting by a client according to yet another exemplary embodiment.
Fig. 4 is a flowchart illustrating a method for reporting a dotting by a client according to yet another exemplary embodiment.
Fig. 5 is a block diagram of a device for reporting a dotting by a client according to an exemplary embodiment.
Fig. 6 is a block diagram of a device for reporting a dotting by a client according to another exemplary embodiment.
FIG. 7 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
It should be noted that dotting is one of the commonly used data statistics manners, and is an action of reporting data for counting the operation behavior of the user on the region of interest to the server on the client. The server can carry out statistics according to the data reported by the client so as to carry out data mining according to the statistical data. It can be understood that there are generally two types of dotting methods for pages: one is a click mode, and the other is an exposure click mode. Aiming at the click dotting mode, when a click trigger event occurs to a page, dotting operation can be performed on the page; aiming at the rolling dotting mode, when a rolling trigger event occurs to a page, reporting exposure logs of dotting elements appearing in a visual window of a screen.
For example, in the actual development process of daily operation activities, the situation that the height of a page is too long is often encountered, and if the exposure of a certain module in the page is desired to be known, the module needs to appear in a visual window of a screen to send a log reporting request to analyze the user data behavior. The specific mode is as follows: creating a first list, wherein the first list is used for maintaining elements needing dotting and log reporting parameters; a second list is created for subsequent maintenance of the dotted elements of the sent log, wherein the second list is an empty list at the time of creation. And a page monitoring rolling method, which circularly traverses the first list, judges each element, calculates whether the current element position is in a visual window, continuously judges whether the current element position is in the second list if the current element position is in the visual window, sends a dotting log reporting request aiming at the element if the current element position is not in the second list, and indicates that an exposure point of the element has been sent if the current element position is in the second list without sending a log request again.
However, in the above dotting method, two lists need to be maintained, and in the project based on the front-end component library VUE, whether a module in a sub-component is in a visible window needs to be additionally judged by a hierarchy and an index value, so that the development process is too complicated and is prone to errors.
In order to solve the problem of how to avoid repeated reporting of data so as to ensure the accuracy of the data to be reported and reduce the complexity of a development process, the disclosure provides a client dotting reporting method and device, electronic equipment and a storage medium. Specifically, a method, an apparatus, an electronic device, and a storage medium for reporting a dotting at a client according to the embodiments of the present disclosure are described below with reference to the accompanying drawings.
Fig. 1 is a flowchart illustrating a method for reporting a point by a client according to an exemplary embodiment, where as shown in fig. 1, the method for reporting a point by a client is used in a device for reporting a point by a client according to an embodiment of the present disclosure, and the device for reporting a point by a client is configured in an electronic device. The client dotting reporting method comprises the following steps.
In step S11, when it is monitored that a target trigger event occurs in the target page, a target Document Object Model (DOM) node in the target page is obtained.
In the embodiment of the present disclosure, the target DOM node may include, but is not limited to, the first attribute, etc. Wherein the first attribute is used for representing parameters needing dotting.
For example, in the development phase of a target page, when a DOM node in the target page is created, a parameter needing dotting can be written on the DOM node in an attribute form, for example, the appointed attribute is kwai-auto-log. As an example, the code form of writing the parameters needing dotting on the DOM node in the form of attributes can be expressed as follows:
<div kwai-auto-log=“{action:’model1-show’,params:{index:1,type:1}}”></div>。
that is to say, in the development stage of the target page, a DOM node of the target page may be created, and the corresponding parameter to be dotted is written to the DOM node in an attribute form according to the dotting requirement, so that the attribute represents that the DOM node needs to be dotted and reported, and the dotting data is the data corresponding to the parameter in the attribute.
As an example, when a user browses the target page, the client may report a dotting log on the target page, and at this time, may monitor whether a target trigger event occurs in the target page, and when it is monitored that the target trigger event occurs in the target page, may obtain all DOM nodes in the target page, find out all DOM nodes including the first attribute from the all DOM nodes, and determine all DOM nodes including the first attribute as target DOM nodes.
That is to say, when a target trigger event occurs in the target page is monitored, all DOM nodes needing dotting can be found from the target page based on the first attribute, and the DOM nodes needing dotting are target DOM nodes.
It should be noted that, in some embodiments of the present disclosure, the target page may be an HTML (HyperText Markup Language) page, or an H5(HyperText Markup Language 5, HTML5) page. As an example, the target page may be an H5 page.
In step S12, it is identified whether the target document object model DOM node has a second attribute therein, wherein the second attribute is used for indicating that the dotting log has been sent.
In the disclosed embodiment, the dotting log may be indicated to the server by utilizing the second attribute. The dotting log can be understood as a log containing data to be reported. In this step, when the target DOM node in the target page is obtained, it may be determined whether the target DOM node contains the second attribute, so as to determine whether reporting of the dotting log needs to be performed on the target DOM node.
In an embodiment of the present disclosure, if it is determined that the target DOM node includes the second attribute, it indicates that the target DOM node has sent the dotting log before, and at this time, the dotting log does not need to be sent to the server. If it is determined that the target DOM node has no second attribute, it indicates that the dotting log has not been sent by the target DOM node, and step S13 may be executed.
In step S13, in response to that the target document object model DOM node does not include the second attribute, the corresponding data to be reported is obtained according to the first attribute.
Optionally, when it is identified that the second attribute is absent in the target DOM node, it may be stated that the target DOM node has not sent the dotting log, and at this time, the data to be reported corresponding to the parameter may be acquired according to the parameter to be dotted in the first attribute included in the target DOM node. As an example, the specific content of the data to be reported may be determined by a dotting requirement, for example, the data to be reported may include, but is not limited to, behavior data of a user, and the like, for example, the behavior data may be any one or more of a number of comments, a video watching duration, a number of video watching times, and the like.
In step S14, corresponding log information is generated according to the data to be reported, and the log information is sent to the server.
Optionally, based on the parameter format of the log, the data to be reported is written into the corresponding position of the log to obtain the log information generated by the data to be reported, and then, a log request may be sent to the server to send the log information to the server based on the request, so that the server performs statistics according to the reported data in the log information, so as to perform data mining according to the statistical data.
In some embodiments of the present disclosure, the second attribute may be added to the target document object model, DOM, node when the log information is sent to the server. That is, while sending the dotting log for the target DOM node to the server, the second attribute is added to the target DOM node so as to indicate that the target DOM node has sent the dotting log to the server through the second attribute. Therefore, the second attribute used for representing the sent dotting log is added to the DOM node, so that the reporting times of the dotting data of the DOM node element are ensured, the reporting is ensured once, the repeated reporting of the data is avoided, and the accuracy of the reported data can be ensured.
According to the client dotting reporting method provided by the embodiment of the disclosure, when a target trigger event occurs in a target page is monitored, a target DOM node in the target page is obtained, wherein the target DOM node comprises a first attribute which is used for representing a parameter needing dotting; and identifying whether the target DOM node contains a second attribute, wherein the second attribute is used for representing the sent dotting log, responding to the fact that the target DOM node does not contain the second attribute, acquiring corresponding data to be reported according to the first attribute, generating corresponding log information according to the data to be reported, and sending the log information to the server. Therefore, the DOM node elements needing to be subjected to dotting are found out from the target page through the first attribute, and whether the DOM node elements send dotting logs to the server or not is judged through the second attribute, so that the reporting times of the dotting data of the DOM node elements can be guaranteed, the reporting times can be guaranteed once, the repeated reporting of the data can be avoided, and the accuracy of the reported data can be guaranteed. In addition, in the development stage, only dotting data needs to be written to the DOM in the page in an attribute form, namely, two attributes are added to the DOM node, so that element dotting can be sent out when a page target event is triggered, and one element is reported once, and the complexity of the development process is greatly reduced.
It should be noted that, in some embodiments of the present disclosure, the target trigger event may include any one of a page scrolling trigger event and a click trigger event. That is to say, the client dotting reporting method in the embodiment of the present disclosure may be applicable to a page scrolling exposure dotting scene, or may also be applicable to a page click dotting scene. To facilitate the understanding of the implementation of these two scenarios by those skilled in the art, examples of these two scenarios will be given below separately.
Fig. 2 is a flowchart illustrating a method for reporting a dotting by a client according to another exemplary embodiment. In the disclosed embodiment, the target trigger event is a page scroll trigger event. That is to say, in the embodiment of the present disclosure, taking a scenario suitable for page scrolling exposure dotting as an example, as shown in fig. 2, the client dotting reporting method includes the following steps.
In step S21, when it is monitored that a page scrolling trigger event occurs in the target page, a target DOM node in the target page is acquired.
In the embodiment of the disclosure, the target DOM node includes a first attribute, and the first attribute is used for representing a parameter that needs to be dotted.
In step S22, it is identified whether the location of the target DOM node is within the visible window.
Optionally, exposure dotting needs to require that the element position to be doted appears in a visible window of the client screen, that is, when the element position to be doted appears in the visible window, exposure dotting is triggered. Therefore, when obtaining the DOM node (i.e., the target DOM node) containing the first attribute in the target page, it can be determined whether the position of the target DOM node is within the visible window of the screen.
It should be noted that there are many ways to determine whether the position of the target DOM node is within the viewable window of the screen. As an example, the height of the visual window may be subtracted from the height of the target DOM node from the top to obtain a height difference, and then it is determined whether the height difference is less than or equal to the height of the target DOM node itself, and if so, it is determined that the position of the target DOM node is within the visual window. It can be understood that there are other ways to determine whether the position of the target DOM node is within the viewable window of the screen, and the details are not described herein.
In this embodiment of the present disclosure, if the height difference is greater than the height of the target DOM node, it indicates that the position of the target DOM node is not within the visible window, and indicates that the target DOM node does not have the condition of exposure dotting currently, that is, the target DOM node is not exposed dotting at this time, and when the target DOM node is within the visible window, the target DOM node needs to be exposed dotting, so that the purpose of exposure dotting of the page scrolling element is achieved.
In step S23, in response to the current position of the target DOM node being within the visual window, it is identified whether a second attribute is contained in the target DOM node, wherein the second attribute is used for indicating that the dotting log has been sent.
That is, when the current position of the target DOM node is within the visual window, it can be determined whether the target DOM node has a second attribute indicating that the dotting log has been sent. In some embodiments of the present disclosure, if it is determined that the target DOM node includes the second attribute indicating that the dotting log has been sent, it indicates that the target DOM node has sent the dotting log to the server, and at this time, exposure and dotting do not need to be performed on the target DOM node, so as to avoid repeated reporting of data.
In step S24, in response to that the target DOM node does not include the second attribute, the corresponding data to be reported is obtained according to the first attribute.
Optionally, when it is determined that the second attribute is not changed in the target DOM node, it is determined that the target DOM node has not performed overexposure dotting, that is, the target DOM node has not sent a dotting log to the server, and at this time, the data to be reported corresponding to the parameter may be obtained according to the parameter to be dotted in the first attribute included in the target DOM node.
In step S25, corresponding log information is generated according to the data to be reported, and the log information is sent to the server.
In step S26, a second attribute is added to the target DOM node.
According to the client dotting and reporting method disclosed by the embodiment of the disclosure, the purpose of exposure dotting of page rolling elements can be realized, namely, when a page rolling trigger event occurs in a target page, a DOM node element needing dotting is found out from the target page through a first attribute, and whether the DOM node element sends a dotting log to a server or not is judged through a second attribute, so that the reporting times of dotting data of the DOM node element can be ensured, the reporting is ensured once, the repeated reporting of the data can be avoided, and the accuracy of the reported data can be ensured. In addition, in the development stage, only dotting data needs to be written to the DOM in the page in an attribute form, namely, two attributes are added to the DOM node, so that element dotting can be sent out when a page target event is triggered, and one element is reported once, and the complexity of the development process is greatly reduced.
Fig. 3 is a flowchart illustrating a method for reporting a dotting by a client according to yet another exemplary embodiment. In the embodiment of the disclosure, a plurality of target document object model DOM nodes are provided, and at this time, whether each target DOM node meets the exposure dotting condition can be sequentially judged one by one, if so, the exposure dotting is performed on the current target DOM node, and if not, the reporting operation on the dotting data of the current target DOM node is not needed. Specifically, as shown in fig. 3, the client dotting reporting method includes the following steps.
In step S31, upon detecting that a page scrolling trigger event occurs in the target page, a plurality of target DOM nodes in the target page are acquired.
In the embodiment of the disclosure, each target DOM node includes a first attribute, and the first attribute is used for representing a parameter that needs to be dotted.
In step S32, for each target DOM node, it is identified whether the position of the current target DOM node is within the visual window.
Optionally, traversing the plurality of target DOM nodes, determining whether the position of the current target DOM node is within the visible window, and if the position of the current target DOM node is not within the visible window, reading the next target DOM node, i.e., determining whether the position of the next target DOM node is within the visible window. If the position of the current target DOM node is within the visible window, step S33 is performed.
In step S33, it is identified whether the second attribute is contained in the current target DOM node.
That is, when the position of the current target DOM node is determined to be within the visible window, it is determined whether the current target DOM node contains the second attribute. And if the current target DOM node contains the second attribute, the current target DOM node is shown to have sent the dotting log, and the next target DOM node can be read at the moment, namely whether the position of the next target DOM node is in the visible window or not is judged. If it is determined that there is no second attribute in the current target DOM node, step S34 is performed.
In step S34, the corresponding data to be reported is obtained according to the first attribute.
That is, when it is determined that the position of the current target DOM node is within the visible window and the current target DOM node does not have the second attribute, the corresponding data to be reported may be obtained according to the dotting parameter in the first attribute of the current target DOM node.
In step S35, corresponding log information is generated according to the data to be reported, and the log information is sent to the server.
That is, the data to be reported for the current target DOM node may be sent to the server in the form of a log, so as to complete exposure dotting of the current target DOM node.
In step S36, a second attribute is added to the current target DOM node.
That is, when the dotting log information of the current target DOM node is sent to the server, the second attribute may be added to the current target DOM node to indicate that exposure dotting has been performed on the current target DOM node, so as to avoid repeated dotting of the DOM node.
According to the client dotting reporting method of the embodiment of the disclosure, when a page rolling trigger event occurs in a target page is monitored, a plurality of target DOM nodes in the target page are obtained, the plurality of target DOM nodes can be written into a list to obtain a DOM node list, each target DOM node in the DOM node list is traversed in a circulating mode, whether the position of the currently traversed target DOM node is in a visible window is judged, if the position of the currently traversed target DOM node is not in the visible window, the next target DOM node is read, namely, whether the position of the next target DOM node is in the visible window is judged, if the position of the current target DOM node is in the visible window, whether the current target DOM node contains a second attribute is judged, if the current target DOM node contains the second attribute, the current target DOM node is proved to have sent a dotting log, and at this time, the next target DOM node can be read, judging whether the position of the next target DOM node is in the visible window or not; and if the current target DOM node does not have the second attribute, realizing exposure dotting on the current target DOM node, namely sending dotting data of the current target DOM node to the server in a log form. If each target DOM node in the DOM node list has been read, then the rolling exposure dotting of the target page is completed, and the process can exit. Therefore, all DOM nodes with the first attribute in the target page are found out, whether the DOM nodes contain the second attribute is sequentially judged one by one, if the DOM nodes do not contain the second attribute, the dotting logs are reported to the current DOM nodes, namely all DOM node elements needing to be dotted are found out from the target page through the first attribute, and whether the DOM node elements send the dotting logs to the server is judged through the second attribute, so that the reporting times of the dotting data of the DOM node elements can be ensured, the reporting is ensured once, the repeated reporting of the data can be avoided, and the accuracy of the reported data can be ensured.
Fig. 4 is a flowchart illustrating a method for reporting a dotting by a client according to yet another exemplary embodiment. In the disclosed embodiment, the target trigger event is a click trigger event. That is to say, in the embodiment of the present disclosure, taking a scenario suitable for page click dotting as an example, as shown in fig. 4, the client dotting reporting method includes the following steps.
In step S41, when it is monitored that a click trigger event occurs in the target page, a target document object model DOM node in the target page is acquired.
In the embodiment of the disclosure, the target document object model DOM node includes a first attribute, and the first attribute is used for representing a parameter that needs to be dotted.
In step S42, it is identified whether the target document object model DOM node has a second attribute therein, wherein the second attribute is used for indicating that the dotting log has been sent.
In step S43, in response to that the target document object model DOM node does not include the second attribute, the corresponding data to be reported is obtained according to the first attribute.
In step S44, corresponding log information is generated according to the data to be reported, and the log information is sent to the server.
In some embodiments of the present disclosure, the second attribute may be added to the target document object model, DOM, node when the log information is sent to the server.
According to the client dotting reporting method disclosed by the embodiment of the disclosure, the purpose of page clicking and dotting can be realized, namely when a click trigger event occurs in a monitored target page, a DOM node element needing dotting is found out from the target page through the first attribute, and whether the DOM node element sends a dotting log to a server or not is judged through the second attribute, so that the reporting times of dotting data of the DOM node element can be ensured, the reporting is ensured once, the repeated reporting of the data can be avoided, and the accuracy of the reported data can be ensured. In addition, in the development stage, only dotting data needs to be written to the DOM in the page in an attribute form, namely, two attributes are added to the DOM node, so that element dotting can be sent out when a page target event is triggered, and one element is reported once, and the complexity of the development process is greatly reduced.
Fig. 5 is a block diagram of a device for reporting a dotting by a client according to an exemplary embodiment. Referring to fig. 5, the apparatus includes: a first acquisition unit 501, a recognition unit 502, a second acquisition unit 503, a generation unit 504, and a transmission unit 505.
Specifically, the first obtaining unit 501 is configured to, when it is monitored that a target trigger event occurs in a target page, obtain a target document object model DOM node in the target page, where the target document object model DOM node includes a first attribute, and the first attribute is used to indicate a parameter that needs to be dotted. In the embodiment of the present disclosure, the target trigger event may include any one of a page scrolling trigger event and a clicking trigger event.
As an example, the first obtaining unit 501 obtains all document object model DOM nodes in the target page, and finds a DOM node containing a first attribute from among all document object model DOM nodes, and determines the DOM node containing the first attribute as the target document object model DOM node.
The identifying unit 502 is configured to identify whether a second attribute is contained in the target document object model DOM node, wherein the second attribute is used for representing that the dotting log is sent. In some embodiments of the present disclosure, the target trigger event is a page scroll trigger event. In the embodiment of the present disclosure, the identifying unit 502 is specifically configured to: identifying whether the position of a target Document Object Model (DOM) node is in a visual window; and identifying whether the target Document Object Model (DOM) node contains the second attribute or not in response to the current position of the DOM node being in the visible window.
In the embodiment of the present disclosure, when there are a plurality of target document object model DOM nodes, the specific implementation process of the identifying unit 502 identifying whether the target document object model DOM node contains the second attribute may be as follows: identifying whether the position of the current target DOM node is in a visual window or not aiming at each target document object model DOM node; and if the position of the current target DOM node is in the visible window, identifying whether the current target DOM node contains the second attribute.
The second obtaining unit 503 is configured to, in response to that the target document object model DOM node does not contain the second attribute, obtain corresponding data to be reported according to the first attribute.
The generating unit 504 is configured to generate corresponding log information according to the data to be reported.
The transmitting unit 505 is configured to and transmits the log information to the server.
In some embodiments of the present disclosure, as shown in fig. 6, the device for reporting a dotting by a client may further include: an adding unit 606. The adding unit 606 is configured to add the second attribute to the target document object model DOM node when the sending unit 605 sends the log information to the server. Wherein 601-605 in fig. 6 and 501-505 in fig. 5 have the same functions and structures.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here. According to the client dotting reporting device disclosed by the embodiment of the disclosure, when a target trigger event occurs in a target page is monitored, a target DOM node in the target page is obtained, wherein the target DOM node comprises a first attribute which is used for representing a parameter needing dotting; and identifying whether the target DOM node contains a second attribute, wherein the second attribute is used for representing the sent dotting log, responding to the fact that the target DOM node does not contain the second attribute, acquiring corresponding data to be reported according to the first attribute, generating corresponding log information according to the data to be reported, and sending the log information to the server. Therefore, the DOM node elements needing to be subjected to dotting are found out from the target page through the first attribute, and whether the DOM node elements send dotting logs to the server or not is judged through the second attribute, so that the reporting times of the dotting data of the DOM node elements can be guaranteed, the reporting times can be guaranteed once, the repeated reporting of the data can be avoided, and the accuracy of the reported data can be guaranteed. In addition, in the development stage, only dotting data needs to be written to the DOM in the page in an attribute form, namely, two attributes are added to the DOM node, so that element dotting can be sent out when a page target event is triggered, and one element is reported once, and the complexity of the development process is greatly reduced.
To implement the above embodiments, the present disclosure also provides an electronic device, and fig. 7 is a block diagram of an electronic device 700 shown according to an exemplary embodiment. For example, the electronic device 700 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 7, electronic device 700 may include one or more of the following components: a processing component 702, a memory 704, a power component 706, a multimedia component 708, an audio component 710, an input/output (I/O) interface 712, a sensor component 714, and a communication component 716.
The processing component 702 generally controls overall operation of the electronic device 700, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 702 may include one or more processors 720 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 702 may include one or more modules that facilitate interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate interaction between the multimedia component 708 and the processing component 702.
The memory 704 is configured to store various types of data to support operations at the electronic device 700. Examples of such data include instructions for any application or method operating on the electronic device 700, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 704 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 706 provides power to the various components of the electronic device 700. The power components 706 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the electronic device 700.
The multimedia component 708 includes a touch-sensitive display screen that provides an output interface between the electronic device 700 and a user. In some embodiments, the touch display screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 708 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 700 is in an operation mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 710 is configured to output and/or input audio signals. For example, the audio component 710 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 700 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 704 or transmitted via the communication component 716. In some embodiments, audio component 710 also includes a speaker for outputting audio signals.
The I/O interface 712 provides an interface between the processing component 702 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 714 includes one or more sensors for providing various aspects of status assessment for the electronic device 700. For example, the sensor assembly 714 may detect an open/closed state of the electronic device 700, the relative positioning of components, such as a display and keypad of the electronic device 700, the sensor assembly 714 may also detect a change in the position of the electronic device 700 or a component of the electronic device 700, the presence or absence of user contact with the electronic device 700, orientation or acceleration/deceleration of the electronic device 700, and a change in the temperature of the electronic device 700. The sensor assembly 714 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 714 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 714 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 716 is configured to facilitate wired or wireless communication between the electronic device 700 and other devices. The electronic device 700 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 716 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 700 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described client dotting reporting method.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as the memory 704 comprising instructions, executable by the processor 720 of the electronic device 700 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium having instructions therein which, when executed by a processor of an electronic device 700, enable the electronic device 700 to perform a client click reporting method.
A computer program product having instructions that, when executed by a processor of an electronic device 700, enable the electronic device 700 to perform a client peer reporting method.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A client dotting reporting method is characterized by comprising the following steps:
when a target trigger event occurs in a target page is monitored, acquiring a target Document Object Model (DOM) node in the target page, wherein the target DOM node comprises a first attribute which is used for representing a parameter needing dotting;
identifying whether a target Document Object Model (DOM) node contains a second attribute, wherein the second attribute is used for representing that a dotting log is sent;
responding to the situation that the second attribute is not contained in the DOM node of the target document object model, and acquiring corresponding data to be reported according to the first attribute; and
and generating corresponding log information according to the data to be reported, and sending the log information to a server.
2. The client-side dotting reporting method according to claim 1, wherein when sending the log information to a server, the method further comprises:
and adding the second attribute into the target Document Object Model (DOM) node.
3. The client dotting reporting method according to claim 1, wherein the target trigger event comprises:
any one of a page scroll trigger event and a click trigger event.
4. The client dotting and reporting method according to claim 3, wherein the target trigger event is the page rolling trigger event; the identifying whether the target Document Object Model (DOM) node contains a second attribute comprises the following steps:
identifying whether the position of the target Document Object Model (DOM) node is in a visual window;
and responding to the current position of the target Document Object Model (DOM) node in a visible window, and identifying whether the target Document Object Model (DOM) node contains a second attribute.
5. The client dotting and reporting method according to claim 4, wherein there are a plurality of DOM nodes; the identifying whether the target Document Object Model (DOM) node contains a second attribute comprises the following steps:
for each target Document Object Model (DOM) node, identifying whether the position of the current target DOM node is in a visual window;
and if the position of the current target DOM node is in the visible window, identifying whether the current target DOM node contains a second attribute.
6. The client dotting reporting method according to any one of claims 1 to 5, wherein the obtaining of the target Document Object Model (DOM) node in the target page comprises:
acquiring all Document Object Model (DOM) nodes in the target page;
finding out DOM nodes containing the first attribute from all document object model DOM nodes;
and determining the DOM node containing the first attribute as the target document object model DOM node.
7. A client dotting reporting device is characterized by comprising:
the document dotting method comprises a first obtaining unit, a second obtaining unit and a third obtaining unit, wherein the first obtaining unit is configured to obtain a target Document Object Model (DOM) node in a target page when a target trigger event occurs in the target page, the target DOM node comprises a first attribute, and the first attribute is used for representing a parameter needing dotting;
the identification unit is configured to identify whether a second attribute is contained in the target Document Object Model (DOM) node or not, wherein the second attribute is used for representing that a dotting log is sent;
the second acquisition unit is configured to respond that the target Document Object Model (DOM) node does not contain the second attribute, and acquire corresponding data to be reported according to the first attribute;
the generating unit is configured to generate corresponding log information according to the data to be reported; and
a transmitting unit configured to transmit the log information to a server.
8. The client peer reporting device of claim 7, further comprising:
an adding unit configured to add the second attribute to the target Document Object Model (DOM) node when the sending unit sends the log information to a server.
9. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the client peer reporting method according to any one of claims 1 to 6.
10. A storage medium having instructions that, when executed by a processor of an electronic device, enable the electronic device to perform the client peer reporting method of any one of claims 1 to 6.
CN202011364706.8A 2020-11-27 2020-11-27 Client dotting reporting method and device, electronic equipment and storage medium Active CN112486770B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011364706.8A CN112486770B (en) 2020-11-27 2020-11-27 Client dotting reporting method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011364706.8A CN112486770B (en) 2020-11-27 2020-11-27 Client dotting reporting method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112486770A true CN112486770A (en) 2021-03-12
CN112486770B CN112486770B (en) 2024-09-06

Family

ID=74936745

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011364706.8A Active CN112486770B (en) 2020-11-27 2020-11-27 Client dotting reporting method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112486770B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113905098A (en) * 2021-09-30 2022-01-07 北京百度网讯科技有限公司 Data reporting method, device, equipment and storage medium
CN116708063A (en) * 2022-12-23 2023-09-05 荣耀终端有限公司 Log reporting method, electronic equipment, cloud server and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108197002A (en) * 2018-01-16 2018-06-22 吉浦斯信息咨询(深圳)有限公司 Mobile equipment is without burying point data statistical method, system, terminal and medium
CN109474619A (en) * 2018-12-17 2019-03-15 中国平安财产保险股份有限公司 Data encryption report method and device, data decryption method and device
CN109635210A (en) * 2018-11-15 2019-04-16 腾讯科技(深圳)有限公司 Report method, device, equipment and the storage medium of behavioral data
CN111159600A (en) * 2019-12-27 2020-05-15 北京达佳互联信息技术有限公司 Method and device for reporting information of elements on page, electronic equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108197002A (en) * 2018-01-16 2018-06-22 吉浦斯信息咨询(深圳)有限公司 Mobile equipment is without burying point data statistical method, system, terminal and medium
CN109635210A (en) * 2018-11-15 2019-04-16 腾讯科技(深圳)有限公司 Report method, device, equipment and the storage medium of behavioral data
CN109474619A (en) * 2018-12-17 2019-03-15 中国平安财产保险股份有限公司 Data encryption report method and device, data decryption method and device
CN111159600A (en) * 2019-12-27 2020-05-15 北京达佳互联信息技术有限公司 Method and device for reporting information of elements on page, electronic equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113905098A (en) * 2021-09-30 2022-01-07 北京百度网讯科技有限公司 Data reporting method, device, equipment and storage medium
CN116708063A (en) * 2022-12-23 2023-09-05 荣耀终端有限公司 Log reporting method, electronic equipment, cloud server and storage medium
CN116708063B (en) * 2022-12-23 2024-06-11 荣耀终端有限公司 Log reporting method, electronic equipment, cloud server and storage medium

Also Published As

Publication number Publication date
CN112486770B (en) 2024-09-06

Similar Documents

Publication Publication Date Title
CN106569800B (en) Front-end interface generation method and device
CN111405302B (en) Live broadcast room attention reminding method and device, electronic equipment and storage medium
CN106919629B (en) Method and device for realizing information screening in group chat
CN113259226B (en) Information synchronization method and device, electronic equipment and storage medium
CN112486770B (en) Client dotting reporting method and device, electronic equipment and storage medium
CN107316207B (en) Method and device for acquiring display effect information
CN111079040B (en) Resource sniffing method, device, terminal, server and storage medium
CN111125388B (en) Method, device and equipment for detecting multimedia resources and storage medium
CN111695064A (en) Embedded point loading method and device
CN108012258B (en) Data traffic management method and device for virtual SIM card, terminal and server
CN116233554A (en) Video playing method, device, electronic equipment and storage medium
CN112333233B (en) Event information reporting method and device, electronic equipment and storage medium
CN115509872A (en) Client behavior data acquisition method and device
CN112819061B (en) Password information identification method, device, equipment and storage medium
CN111061633B (en) Webpage first screen time detection method, device, terminal and medium
CN114239531A (en) Template recommendation method and device, electronic equipment and storage medium
CN111984532A (en) Applet-based exception handling method and device
CN111131000B (en) Information transmission method, device, server and terminal
CN111049732B (en) Push message display method and device, electronic equipment and medium
CN112507261A (en) First screen time calculation method and device
CN112102009A (en) Advertisement display method, device, equipment and storage medium
CN107257384B (en) Service state monitoring method and device
CN111526084A (en) Information processing method, device, equipment and storage medium
CN111736890A (en) Data updating method and device, electronic equipment and storage medium
CN112507146B (en) Information processing method, information processing device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant