CN113206869A - Data acquisition method and device, storage medium and electronic equipment - Google Patents

Data acquisition method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN113206869A
CN113206869A CN202110396006.5A CN202110396006A CN113206869A CN 113206869 A CN113206869 A CN 113206869A CN 202110396006 A CN202110396006 A CN 202110396006A CN 113206869 A CN113206869 A CN 113206869A
Authority
CN
China
Prior art keywords
data
area
buried point
reporting
timer
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
CN202110396006.5A
Other languages
Chinese (zh)
Other versions
CN113206869B (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.)
Shanghai Bilibili Technology Co Ltd
Original Assignee
Shanghai Bilibili 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 Shanghai Bilibili Technology Co Ltd filed Critical Shanghai Bilibili Technology Co Ltd
Priority to CN202110396006.5A priority Critical patent/CN113206869B/en
Publication of CN113206869A publication Critical patent/CN113206869A/en
Application granted granted Critical
Publication of CN113206869B publication Critical patent/CN113206869B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/535Tracking the activity of the user
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

A data acquisition method, an apparatus, a storage medium and an electronic device are disclosed. The method comprises the steps of setting elements to be monitored in a page, obtaining the cross overlapping degree of a target area and a monitoring area of the elements to be monitored, responding to the fact that the cross overlapping degree meets a preset condition, obtaining buried point data needing to be reported and storing the buried point data in a memory area, and reporting the buried point data in batch in the memory area according to a preset timer. Therefore, the calculation amount of the position information of the elements and the reporting times of the buried point data can be reduced, and the response speed and the user experience of the application program are improved.

Description

Data acquisition method and device, storage medium and electronic equipment
Technical Field
The embodiment of the invention relates to the technical field of data statistics, in particular to a data acquisition method, a data acquisition device, a storage medium and electronic equipment.
Background
Applications/websites and the like of the internet often need to count some data to analyze the websites, wherein the buried point analysis is a common data acquisition method for website analysis, and for example, PV (page view) data acquired by analyzing and sorting may be used to mine behavior logs of users, and then effective conclusions may be obtained, so as to perform product optimization/iteration.
In the prior art, the collection of the buried point data is generally realized by monitoring a rolling event of a webpage. The height of each element relative to the webpage head is stored in advance, when the page scrolling height and the height of the element relative to the webpage head are in a range, the element is shown to be in a user visible area, and then buried point data is collected and reported.
However, the process of monitoring the page scrolling event may involve a large amount of position calculation, DOM (Document Object Model) operation, element redrawing, and the like, and when the scrolling event is triggered, if the calculation is not completed in the next triggering, the browser may drop frames, resulting in poor user experience; secondly, collecting the buried point data through the rolling event is also very limited, for example, if the user hides a page element and displays another element, there is no way to collect the buried point data through the rolling event, which results in some extra processing and introduces a large amount of calculation again.
Disclosure of Invention
In view of this, embodiments of the present invention provide a data acquisition method, an apparatus, a storage medium, and an electronic device, which can reduce the calculation amount of the location information of an element and the number of times of reporting buried point data, so as to improve the response speed of an application program and user experience.
In a first aspect, an embodiment of the present invention provides a data acquisition method, where the method includes:
setting elements to be monitored in a page;
acquiring the cross overlapping degree of a target area and a monitoring area, wherein the target area is used for representing the position information of the element to be monitored, and the cross overlapping degree is used for representing the display condition of the target area in the monitoring area;
responding to the fact that the cross overlapping degree meets a preset condition, acquiring buried point data needing to be reported and storing the buried point data in a memory area; and
and reporting the data of the buried points in the memory area in batch at least according to a preset timer.
In some embodiments, the method further comprises:
receiving a registration instruction;
wherein, the setting of the elements to be monitored in the page specifically comprises:
and registering a monitoring event for the element to be monitored in the page according to the registration instruction, wherein the monitoring event is used for indicating the buried point data needing to be reported.
In some embodiments, the obtaining of the cross overlapping degree of the target area and the listening area specifically includes:
and acquiring the cross overlapping degree of the target area and the monitoring area through a cross observer.
In some embodiments, the buried point data includes one or more of an event name, a trigger time, a terminal identification, and a user identification.
In some embodiments, the method further comprises:
in response to acquiring a first configuration parameter, determining the monitoring area according to the first configuration parameter; and
and in response to not acquiring the first configuration parameter, determining the monitoring area according to a first default parameter.
In some embodiments, the predetermined condition is that the cross-over overlap is greater than or equal to a predetermined threshold.
In some embodiments, the method further comprises:
in response to acquiring a second configuration parameter, determining the predetermined threshold according to the second configuration parameter; and
and in response to not acquiring the second configuration parameter, determining the predetermined threshold according to a second default parameter.
In some embodiments, the reporting of the data of the buried points in the memory area in batch according to at least a predetermined timer specifically includes:
detecting the duration of a timer; and
and reporting the data of the buried point stored in the memory area in response to the timer reaching the preset time.
In some embodiments, the reporting of the data of the buried point in the memory area in batch according to at least a predetermined timer specifically includes:
and reporting the data of the buried points in the memory area in batch according to a preset timer and a preset data length.
In some embodiments, the reporting of the data of the buried point in the memory area in batch according to the predetermined timer and the predetermined data length specifically includes:
detecting the data length of the buried point data stored in the memory area;
detecting the duration of a timer; and
and reporting the data of the buried point stored in the memory area in response to the data length reaching a preset length or in response to the timer reaching a preset time.
In some embodiments, the method further comprises:
and reporting the data of the buried points stored in the memory area in response to the detection of the closing event.
In some embodiments, before batch reporting of the data of the buried points in the memory area, the method further includes:
and screening the stored buried point data.
In some embodiments, the method further comprises:
initializing the timer and the memory area.
In a second aspect, an embodiment of the present invention provides a data acquisition apparatus, including:
the setting unit is used for setting elements to be monitored in the page;
the observation unit is used for acquiring the cross overlapping degree of a target area and a monitoring area, wherein the target area is used for representing the position information of the element to be monitored, and the cross overlapping degree is used for representing the display condition of the target area in the monitoring area;
the storage unit is used for responding to the condition that the cross overlapping degree meets the preset condition, acquiring buried point data needing to be reported and storing the buried point data in a memory area; and
and the first reporting unit is used for reporting the data of the buried points in the memory area in batch at least according to a preset timer.
In a third aspect, an embodiment of the present invention provides a computer-readable storage medium on which computer program instructions are stored, which when executed by a processor implement the method according to the first aspect.
In a fourth aspect, an embodiment of the present invention provides an electronic device, including a memory and a processor, the memory being configured to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method according to the first aspect.
According to the technical scheme of the embodiment of the invention, the elements to be monitored are arranged in the page, the cross overlapping degree of the target area and the monitoring area of the elements to be monitored is obtained, the data of the embedded points needing to be reported is obtained and stored in the memory area in response to the fact that the cross overlapping degree meets the preset condition, and the data of the embedded points in the memory area is reported in batches according to the preset timer. . Therefore, the calculation amount of the position information of the elements and the reporting times of the buried point data can be reduced, and the response speed and the user experience of the application program are improved.
Drawings
The above and other objects, features and advantages of the present invention will become more apparent from the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:
FIG. 1 is a schematic diagram of a data acquisition system of an embodiment of the present invention;
FIG. 2 is a schematic view of a page of one embodiment of the present invention;
FIG. 3 is a flow chart of a data acquisition method of an embodiment of the present invention;
FIG. 4 is a schematic view of a page of another embodiment of the present invention;
FIG. 5 is a flowchart of batch reporting of buried point data according to an embodiment of the present invention;
FIG. 6 is a schematic view of a data acquisition device according to an embodiment of the present invention;
fig. 7 is a schematic diagram of an electronic device of an embodiment of the invention.
Detailed Description
The present invention will be described below based on examples, but the present invention is not limited to only these examples. In the following detailed description of the present invention, certain specific details are set forth. It will be apparent to one skilled in the art that the present invention may be practiced without these specific details. Well-known methods, procedures, components and circuits have not been described in detail so as not to obscure the present invention.
Further, those of ordinary skill in the art will appreciate that the drawings provided herein are for illustrative purposes and are not necessarily drawn to scale.
Unless the context clearly requires otherwise, throughout the description, the words "comprise", "comprising", and the like are to be construed in an inclusive sense as opposed to an exclusive or exhaustive sense; that is, what is meant is "including, but not limited to".
In the description of the present invention, it is to be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In addition, in the description of the present invention, "a plurality" means two or more unless otherwise specified.
FIG. 1 is a schematic diagram of a data acquisition system according to an embodiment of the present invention. As shown in fig. 1, the data acquisition system according to the embodiment of the present invention includes a terminal device 1 and a server 2. Wherein, the terminal device 1 can perform data interaction with the server 2.
In this embodiment, the terminal device 1 is a terminal device used by a user, and may be implemented by a mobile phone, a tablet computer, a notebook computer, a desktop computer, a wearable device (e.g., a smart watch, a smart bracelet, etc.), and the like.
Further, the terminal device 1 is installed with an application program capable of displaying a page, and the application program for displaying a page may be implemented as a browser, but the present invention does not limit the type of the application program for displaying a page. And after the browser is started, acquiring a network page to be accessed by the user from the server, and loading and presenting the network page.
In this embodiment, the server 2 is configured to provide page data for the terminal device 1, and receive buried point data reported by the terminal device. The server 2 may be an independent server, or may be a server cluster composed of a plurality of servers, which is not limited in this embodiment of the present invention. It should be understood that, in fig. 1, an example that one server 2 simultaneously provides page data for the terminal device 1 and receives the embedded point data reported by the terminal device 1 is taken as an illustration, but the embodiment of the present invention is not limited thereto. For example, the method can also be implemented by two servers, wherein one server provides page data for the terminal device, and the other server receives buried point data reported by the terminal device.
Specifically, when a user needs to browse page data, a corresponding website is input in a browser of the terminal device, the terminal device obtains a server address after analyzing the input website through a Domain Name System (DNS), the browser initiates a Hyper Text Transfer Protocol (HTTP) request to the server 2, and after confirming a link through a three-way handshake of a Transmission Control Protocol (TCP)/Internet Protocol (IP), the server 2 sends back a required Hyper Text Markup Language (HTML) code to the browser. The browser receives the code, analyzes the code, constructs, lays out and draws a page through a DOM (Document Object Model), and finally presents the page to a user in the form of a web page. Specifically, the browser firstly analyzes and constructs the received HTML codes into a DOM tree through an HTML parser. And then constructing Style sheet rules by the received CSS (Cascading Style Sheets) codes through a CSS parser, and respectively putting the rules on corresponding DOM tree nodes to obtain a DOM tree with Style attributes. And the browser reads the document nodes of the DOM tree according to the sequence from top to bottom and from left to right, and stores the document nodes into the document stream in sequence. And then drawing all the contents to finish rendering the whole page. Thus, the browser may present information to the user in the form of a page.
FIG. 2 is a schematic view of a page of one embodiment of the present invention. As shown in FIG. 2, the browser may obtain page A in the manner described above, and the dashed boxes A1-A5 represent elements in the page, each of which may be data such as text, images, animation, or a combination thereof. Wherein, B represents a display interface, and the display interface may be a terminal device screen area, a browser window area, or the like. Therefore, the user can select to display the corresponding elements on the display interface through the operation of sliding up, down, left and right, and further select the operation of browsing or clicking and the like.
In order to operate and maintain a website, it is often necessary to collect data of a buried point to analyze user behavior. The embedding is a mode of reporting user behaviors by implanting statistical codes into product and service conversion key points. For example, the clicking behavior and the browsing behavior of the user on each target element can be obtained through a preset buried point rule.
In the prior art, collecting the buried point data is usually performed by monitoring a scrolling event of a page, and when the scrolling event is monitored, a position monitoring function is called to obtain position information of an element, the position monitoring function can obtain the size and the position of the element relative to a viewport, and the position information of the element is a minimum rectangle containing a complete element. The coordinates of the element corresponding to the upper left corner of the viewport can be obtained through the position information, and whether the element is in the viewport is judged according to the coordinates. However, when the scroll position is changed, the coordinates are immediately changed, and the position of the element needs to be recalculated. Meanwhile, since the position information of the target element is calculated in the main thread, when a large number of elements needing to be monitored exist in the page, the calculation amount of the position information of the elements is large, the page is blocked, and further user experience is influenced. Meanwhile, in the prior art, the collected buried point data is usually reported directly for the buried point data needing to be reported, and when a large number of elements needing to be reported exist in a page, the reported data is frequently triggered, which brings huge pressure to terminal equipment and a server.
Therefore, the embodiment of the invention provides a data acquisition method to reduce the calculation amount of the position information of the elements and the reporting times of the buried point data, and improve the response speed and the user experience of the application program.
Specifically, fig. 3 is a flow chart of a data acquisition method of an embodiment of the present invention. As shown in fig. 3, the data acquisition method according to the embodiment of the present invention includes the following steps:
and S100, setting elements to be monitored in a page.
In this embodiment, before the element to be monitored is set in the page, the terminal device receives a registration instruction, so as to register a listening event for the element to be monitored in the page according to the registration instruction.
Specifically, the operator sends a registration instruction to the terminal device through the server according to an actual requirement, where the registration instruction may be a VUE instruction. The VUE is a set of progressive JavaScript (a programming language) framework for building user interfaces.
Further, the terminal equipment registers a monitoring event for the element to be monitored in the page according to the registration instruction, wherein the monitoring event is used for indicating the buried point data needing to be reported.
The buried point data comprises one or more of an event name, trigger time, a terminal identifier and a user identifier.
Further, the process of acquiring the page by the terminal device includes a plurality of event hooks, for example, before creation (before update), creation (created), before mounting the DOM structure (before count), after mounting the DOM structure (mounted), before update (before update), after update (updated), before destroy (before destroy), and after destroy (destroyed). In this embodiment, a snoop event is registered according to the registration instruction when a page is rendered (i.e. before _ count).
Specifically, the registration instruction may be as follows:
Public static inject(app:Application):void{
App.directive(name:‘show-report’,directive:{
beforeMount(el){
XbReport.getXbReportInstance().add({el})
},
})
}
the buried point data to be reported, which is indicated by the monitoring event registered by the instruction, is an exposure buried point, and the show-report is an event name.
Since not all elements in the page need to collect the buried point data, the register instruction can register a snoop event for the element needing to be snooped when the element is rendered.
It should be understood that before registering a listening event for an element, it may be verified whether the user has a parameter configuration right according to the user information according to a login request containing the user information sent by the user through the client. When the user does not have the parameter configuration right, prompting that the user right is insufficient, and when the user has the parameter configuration right, registering the monitoring event.
And step S200, acquiring the cross overlapping degree of the target area and the monitoring area.
In this embodiment, a cross-overlap degree of a target area and a listening area is obtained through a cross viewer (intersectionObserver), where the target area is used to represent position information of the element to be monitored, and the cross-overlap degree is used to represent a display condition of the target area in the listening area.
Specifically, an internationobserver API (Application Programming Interface) is an open source API that can asynchronously observe the intersection state of a target element with its ancestor element or top-level document window (viewport). The target elements are elements in a web page, the ancestor elements or the windows are monitoring regions in the embodiment of the present invention, and when the monitoring regions are used, the monitoring regions can be configured according to actual situations, for example, a browser window can be configured as the monitoring regions, or one or more regions are selected as the monitoring regions.
And step S300, responding to the condition that the cross overlapping degree meets the preset condition, acquiring buried point data needing to be reported and storing the buried point data in a preset memory area.
In this embodiment, the cross viewer may detect the cross overlap degree between the target area and the monitoring area, and when the cross overlap degree satisfies a predetermined condition, trigger a callback function, where the callback function acquires, according to the monitoring event, the buried point data that needs to be reported and stores the buried point data in a predetermined memory area.
Further, the predetermined condition is that the cross-over overlap is greater than or equal to a predetermined threshold.
Further, the cross viewer may accept callback functions and configuration parameters. Therefore, the user can configure the cross viewer according to actual requirements. The callback function is a callback function when the visibility of the target element changes, the configuration parameters include a first configuration parameter and a second configuration parameter, the first configuration parameter is a monitoring area, one or more monitoring areas can be configured selectively, the second configuration parameter is a predetermined threshold, and the cross observer can judge whether the visibility of the target element changes or not through the predetermined threshold.
Further, the cross viewer detects whether the received configuration parameters include the first configuration parameter. And in response to acquiring the first configuration parameter, determining the monitoring area according to the first configuration parameter, and in response to not acquiring the first configuration parameter, determining the monitoring area according to a first default parameter. Specifically, in the process of configuring the cross viewer, if the user configures the listening area through the first configuration parameter, the listening area is set according to the configuration of the user. If the user does not set the first configuration parameter, the cross viewer sets the default area as a listening area, preferably, the default area is a window area of the browser.
Further, the cross viewer detects whether the received configuration parameters include a second configuration parameter. And determining the preset threshold according to the second configuration parameter in response to acquiring the second configuration parameter, and determining the preset threshold according to a second default parameter in response to not acquiring the second configuration parameter. Specifically, in the process of configuring the cross viewer, if the user configures the predetermined threshold value through the second configuration parameter, the predetermined threshold value is set according to the configuration of the user, where the predetermined threshold value may be any value greater than or equal to 0 and less than 1. If the user does not set the second configuration parameter, the cross viewer will set the default value to a predetermined threshold, such as 0.5, etc.
Thus, the cross viewer can detect changes in the visibility of the target element based on the listening area and a predetermined threshold. Specifically, the cross viewer may obtain a target area of the target element, where the target area is used to represent position information of the target element, and calculate a cross overlap degree according to the position information of the target element and the monitoring area. More specifically, the cross observer may obtain a cross region of the target region and the monitoring region, and then determine the cross overlap degree according to the cross region, where the cross overlap degree is a ratio of the cross region to the target region. The larger the ratio, the larger the portion indicating that the target area appears within the listening area, and when the ratio is 1, the target area appears entirely within the listening area.
Taking fig. 2 and 4 as an example for explanation, at a certain time, the relative position of page a and listening area B is as shown in fig. 2, at this time, the area of element a1 appears in listening area B completely, and element a2 appears in listening area partially. When the user scrolls page A to the position shown in FIG. 4, the area of element A2 appears entirely within listening area B, and element A3 appears partially within the listening area. In this process, the cross-viewer can determine the cross-overlap of elements a2 and A3 with listening area B. Wherein the cross observer can detect the cross overlapping degree of each element and the listening area B according to a predetermined frequency.
In this embodiment, the cross viewer compares the detected cross-overlap of the target element with a predetermined threshold, and triggers the callback function when the cross-overlap is greater than or equal to the predetermined threshold. For example, assuming that the predetermined threshold is set to 0.1, when the cross viewer detects that the cross overlap of the target element is greater than or equal to 0.1, a callback function is started to be triggered, and the callback function is used for collecting the buried point data according to the registration listening event.
Therefore, the change condition of the visibility of the target element can be detected through the cross viewer, and when the visibility of the target element changes, the callback function is triggered, and the buried point data is collected through the callback function. Because the calculation process of the cross viewer is not performed in the main thread, the main thread can not perform position calculation of the target element, the calculation amount of data acquisition of the embedded point of the main thread is reduced, and the response speed and the user experience of the browser are improved.
And step S400, reporting the data of the buried points in the memory area in batch at least according to a preset timer.
In an optional implementation manner, the terminal device reports the data of the buried points in the memory area in batch according to a predetermined timer. Specifically, the duration of a timer is detected, and in response to the timer reaching a predetermined duration, data of buried points stored in the memory area is reported.
In another optional implementation manner, the terminal device may report the buried point data in the memory area in batch according to a predetermined timer and a predetermined data length. Specifically, the process of reporting the stored buried point data in batch as shown in fig. 5 includes the following steps:
step S410, initializing a memory area and a timer.
In this embodiment, after each data report, the memory area and the timer are initialized.
Further, initializing the memory area is specifically clearing data of the memory area, and initializing the timer is specifically triggering the timer to restart timing.
Step S420, detecting whether the data length reaches a predetermined length.
In this embodiment, the terminal device detects whether the data length of the buried point data stored in the memory area reaches a predetermined length.
If the predetermined length is reached, the process proceeds to step S440.
If the predetermined length is not reached, the process proceeds to step S430.
And step S430, detecting whether the timer reaches a preset time length.
In this embodiment, if the data length of the memory area does not reach the predetermined length, it is detected whether the timer reaches the predetermined length. The timer may be implemented in various existing manners, such as a countdown timer or a count-up timer. When the timer is a countdown timer, the timer returns to zero to indicate that the timer reaches the preset time length; when the timer is a positive timer, the timer reaches the maximum value to indicate that the timer reaches the preset time length.
If the predetermined time period is reached, the process proceeds to step S440.
If the predetermined length is not reached, the process returns to step S420 to detect whether the data length reaches the predetermined length.
And step S440, reporting the buried point data.
In this embodiment, if the data length reaches the predetermined length or the timer reaches the predetermined duration, the terminal device reports the stored data of the buried point to the server.
Further, after reporting the stored buried point data to the server, the terminal device returns to step S410, initializes the timer and the memory area, and re-executes steps S420 to S440.
It should be understood that, the step S420 and the step S430 are not distinguished by the execution order, and may be executed sequentially or simultaneously.
For example, step S420 and step S430 may also be: detecting whether the timer reaches a preset time length or not, and if so, starting to report data; if the preset time length is not reached, detecting whether the data length reaches the preset length, and if the preset length is reached, starting to report the data; and if the preset length is not reached, returning to the detection timer, and reporting the data until the timer reaches the preset time or the data length reaches the preset length.
For another example, step S420 and step S430 may further include: and simultaneously detecting whether the timer reaches the preset time length or not and whether the data length reaches the preset length or not, and reporting the data when the timer reaches the preset time length or the data length reaches the preset length.
Therefore, the data can be reported when the buried point data reaches a certain amount through the preset length, and the data reporting times are reduced; meanwhile, when the data burying amount is less, the memory area may not reach the preset length for a long time, and therefore, the timer is arranged, so that the data can be reported in time when the data burying amount is less, and the situation that the data is not reported in time is reduced. That is, by setting the predetermined length and the timer, the number of data reporting times can be reduced, and the occurrence of untimely data reporting can be reduced.
Further, when the memory area has data, the data length does not reach the predetermined length, and the timer does not reach the predetermined length, the data in the memory area is automatically cleared when the browser is closed, resulting in data loss. Therefore, the process of reporting stored buried point data according to the embodiment of the present invention further includes:
and step S450, reporting the stored buried point data in response to the detected closing event.
In this embodiment, when the browser is closed, a closing event may be detected, and the stored data may be reported, so that the occurrence of data loss due to closing of the browser may be avoided.
Further, in the above steps S440 and S450, before reporting the buried point data, optionally, the data may be filtered, and the filtering rule may be based on various existing methods. For example, duplicate data is deleted. Specifically, in the process of sliding the page up and down by the user, the same element may appear on the display interface for multiple times, so that multiple buried point data may be collected for the same element, and repeated data may be deleted by screening to reduce the number of reported data.
The method and the device for monitoring the embedded data in the page have the advantages that the elements to be monitored are arranged in the page, the cross overlapping degree of the target area and the monitoring area of the elements to be monitored is obtained, the embedded data needing to be reported is obtained and stored in the memory area in response to the fact that the cross overlapping degree meets the preset condition, and the embedded data in the memory area are reported in batches according to the preset timer. Therefore, the calculation amount of the position information of the elements and the reporting times of the buried point data can be reduced, and the response speed and the user experience of the application program are improved.
Fig. 6 is a schematic diagram of a data acquisition device according to an embodiment of the present invention. As shown in fig. 6, the data acquisition apparatus according to the embodiment of the present invention includes: a setting unit 61, an observation unit 62, a storage unit 63 and a first reporting unit 64. The setting unit 61 is configured to set an element to be monitored in a page. The observation unit 62 is configured to obtain a cross overlap degree between a target area and a listening area, where the target area is used to represent position information of the element to be monitored, and the cross overlap degree is used to represent a display condition of the target area in the listening area. The storage unit 63 is configured to, in response to that the cross overlap degree meets a predetermined condition, obtain buried point data that needs to be reported and store the buried point data in a memory area. The first reporting unit 64 is configured to report the data of the buried points in the memory area in batch according to at least a predetermined timer.
In some embodiments, the apparatus further comprises:
a receiving unit for receiving a registration instruction;
wherein the setting unit is specifically configured to:
and registering a monitoring event for the element to be monitored in the page according to the registration instruction, wherein the monitoring event is used for indicating the buried point data needing to be reported.
In some embodiments, the observation unit is specifically configured to:
and acquiring the cross overlapping degree of the target area and the monitoring area through a cross observer.
In some embodiments, the buried point data includes one or more of an event name, a trigger time, a terminal identification, and a user identification.
In some embodiments, the apparatus further comprises:
the first monitoring area acquisition unit is used for responding to acquisition of a first configuration parameter and determining the monitoring area according to the first configuration parameter; and
and the second monitoring area acquisition unit is used for responding to the situation that the first configuration parameter is not acquired and determining the monitoring area according to the first default parameter.
In some embodiments, the predetermined condition is that the cross-over overlap is greater than or equal to a predetermined threshold.
In some embodiments, the apparatus further comprises:
the first preset threshold determining unit is used for responding to the acquisition of a second configuration parameter and determining the preset threshold according to the second configuration parameter; and
and the second predetermined threshold determining unit is used for determining the predetermined threshold according to a second default parameter in response to that the second configuration parameter is not acquired.
In some embodiments, the reporting of the data of the buried points in the memory area in batch according to at least a predetermined timer specifically includes:
detecting the duration of a timer; and
and reporting the data of the buried point stored in the memory area in response to the timer reaching the preset time.
In some embodiments, the first reporting unit is specifically configured to:
and reporting the data of the buried points in the memory area in batch according to a preset timer and a preset data length.
In some embodiments, the first reporting unit specifically includes:
the first detection subunit is used for detecting the data length of the buried point data stored in the memory area;
the second detection subunit is used for detecting the duration of the timer; and
and the data reporting subunit is used for reporting the data burying point stored in the memory area in response to the data length reaching a preset length or in response to the timer reaching a preset time length.
In some embodiments, the apparatus further comprises:
and the second reporting unit is used for reporting the data of the buried point stored in the memory area in response to the detection of the closing event.
In some embodiments, the apparatus further comprises:
and the screening unit is used for screening the stored buried point data.
In some embodiments, the apparatus further comprises:
and the initialization unit is used for initializing the timer and the memory area.
The method and the device for monitoring the embedded data in the page have the advantages that the elements to be monitored are arranged in the page, the cross overlapping degree of the target area and the monitoring area of the elements to be monitored is obtained, the embedded data needing to be reported is obtained and stored in the memory area in response to the fact that the cross overlapping degree meets the preset condition, and the embedded data in the memory area are reported in batches according to the preset timer. Therefore, the calculation amount of the position information of the elements and the reporting times of the buried point data can be reduced, and the response speed and the user experience of the application program are improved.
Fig. 7 is a schematic diagram of an electronic device of an embodiment of the invention. The electronic device shown in fig. 7 is a general-purpose data processing apparatus comprising a general-purpose computer hardware structure including at least a processor 71 and a memory 72. The processor 71 and the memory 72 are connected by a bus 73. The memory 72 is adapted to store instructions or programs executable by the processor 71. The processor 71 may be a stand-alone microprocessor or a collection of one or more microprocessors. Thus, the processor 71 implements the processing of data and the control of other devices by executing instructions stored by the memory 72 to perform the method flows of embodiments of the present invention as described above. The bus 73 connects the above-described components together, and also connects the above-described components to a display controller 74 and a display device and an input/output (I/O) device 75. Input/output (I/O) devices 75 may be a mouse, keyboard, modem, network interface, touch input device, motion sensing input device, printer, and other devices known in the art. Typically, the input/output devices 75 are connected to the system through input/output (I/O) controllers 76.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus (device) or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may employ a computer program product embodied on one or more computer-readable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations of methods, apparatus (devices) and computer program products according to embodiments of the application. It will be understood that each flow in the flow diagrams can be implemented by computer program instructions.
These computer program instructions may be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows.
These computer program instructions may also be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes may be made to the present embodiment by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the embodiments of the present invention should be included in the scope of protection of the embodiments of the present invention.

Claims (16)

1. A method of data acquisition, the method comprising:
setting elements to be monitored in a page;
acquiring the cross overlapping degree of a target area and a monitoring area, wherein the target area is used for representing the position information of the element to be monitored, and the cross overlapping degree is used for representing the display condition of the target area in the monitoring area;
responding to the fact that the cross overlapping degree meets a preset condition, acquiring buried point data needing to be reported and storing the buried point data in a memory area; and
and reporting the data of the buried points in the memory area in batch at least according to a preset timer.
2. The method of claim 1, further comprising:
receiving a registration instruction;
wherein, the setting of the elements to be monitored in the page specifically comprises:
and registering a monitoring event for the element to be monitored in the page according to the registration instruction, wherein the monitoring event is used for indicating the buried point data needing to be reported.
3. The method according to claim 1, wherein the obtaining of the cross-overlapping degree of the target area and the listening area specifically comprises:
and acquiring the cross overlapping degree of the target area and the monitoring area through a cross observer.
4. The method of claim 1, wherein the buried point data comprises one or more of an event name, a trigger time, a terminal identifier, and a user identifier.
5. The method of claim 1, further comprising:
in response to acquiring a first configuration parameter, determining the monitoring area according to the first configuration parameter; and
and in response to not acquiring the first configuration parameter, determining the monitoring area according to a first default parameter.
6. The method of claim 1, wherein the predetermined condition is that the cross-over overlap is greater than or equal to a predetermined threshold.
7. The method of claim 6, further comprising:
in response to acquiring a second configuration parameter, determining the predetermined threshold according to the second configuration parameter; and
and in response to not acquiring the second configuration parameter, determining the predetermined threshold according to a second default parameter.
8. The method according to claim 1, wherein the reporting of the data of the buried points in the memory area in batch according to at least a predetermined timer specifically comprises:
detecting the duration of a timer; and
and reporting the data of the buried point stored in the memory area in response to the timer reaching the preset time.
9. The method according to claim 1, wherein the reporting of the data of the buried point in the memory area in batch at least according to a predetermined timer is specifically:
and reporting the data of the buried points in the memory area in batch according to a preset timer and a preset data length.
10. The method according to claim 9, wherein the reporting of the buried point data in the memory area in batch according to the predetermined timer and the data length specifically comprises:
detecting the data length of the buried point data stored in the memory area;
detecting the duration of a timer; and
and reporting the data of the buried point stored in the memory area in response to the data length reaching a preset length or in response to the timer reaching a preset time.
11. The method of claim 1, further comprising:
and reporting the data of the buried points stored in the memory area in response to the detection of the closing event.
12. The method of claim 1, wherein before reporting the buried point data in the memory region in batch, the method further comprises:
and screening the stored buried point data.
13. The method of claim 10, further comprising:
initializing the timer and the memory area.
14. A data acquisition device, the device comprising:
the setting unit is used for setting elements to be monitored in the page;
the observation unit is used for acquiring the cross overlapping degree of a target area and a monitoring area, wherein the target area is used for representing the position information of the element to be monitored, and the cross overlapping degree is used for representing the display condition of the target area in the monitoring area;
the storage unit is used for responding to the condition that the cross overlapping degree meets the preset condition, acquiring buried point data needing to be reported and storing the buried point data in a memory area; and
and the first reporting unit is used for reporting the data of the buried points in the memory area in batch at least according to a preset timer.
15. A computer-readable storage medium on which computer program instructions are stored, which, when executed by a processor, implement the method of any one of claims 1-13.
16. An electronic device comprising a memory and a processor, wherein the memory is configured to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method of any of claims 1-13.
CN202110396006.5A 2021-04-13 2021-04-13 Data acquisition method and device, storage medium and electronic equipment Active CN113206869B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110396006.5A CN113206869B (en) 2021-04-13 2021-04-13 Data acquisition method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110396006.5A CN113206869B (en) 2021-04-13 2021-04-13 Data acquisition method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN113206869A true CN113206869A (en) 2021-08-03
CN113206869B CN113206869B (en) 2022-11-01

Family

ID=77026753

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110396006.5A Active CN113206869B (en) 2021-04-13 2021-04-13 Data acquisition method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN113206869B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113656102A (en) * 2021-08-17 2021-11-16 杭州网易云音乐科技有限公司 Data point burying method and device, storage medium and electronic equipment
CN114546377A (en) * 2022-01-07 2022-05-27 北京达佳互联信息技术有限公司 Embedded point processing method and device, electronic equipment and storage medium
CN116931897A (en) * 2023-09-15 2023-10-24 北京市大数据中心 Data reporting method, device and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107728873A (en) * 2017-09-04 2018-02-23 小草数语(北京)科技有限公司 The method and its device of contents selection
CN109219074A (en) * 2018-08-31 2019-01-15 中建科技有限公司深圳分公司 A kind of monitor method of sensor network, monitor and detection device
CN110188275A (en) * 2019-05-30 2019-08-30 广州虎牙信息科技有限公司 A kind of browsing monitoring method, device, equipment and the storage medium of web page element
CN111159600A (en) * 2019-12-27 2020-05-15 北京达佳互联信息技术有限公司 Method and device for reporting information of elements on page, electronic equipment and storage medium
CN112149039A (en) * 2020-10-13 2020-12-29 四川长虹电器股份有限公司 Method for increasing front-end webpage loading speed
CN112380473A (en) * 2020-11-16 2021-02-19 康键信息技术(深圳)有限公司 Data acquisition and synchronization method, device, equipment and storage medium
CN112395535A (en) * 2019-08-15 2021-02-23 腾讯科技(深圳)有限公司 Image lazy loading method and device, medium and electronic equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107728873A (en) * 2017-09-04 2018-02-23 小草数语(北京)科技有限公司 The method and its device of contents selection
CN109219074A (en) * 2018-08-31 2019-01-15 中建科技有限公司深圳分公司 A kind of monitor method of sensor network, monitor and detection device
CN110188275A (en) * 2019-05-30 2019-08-30 广州虎牙信息科技有限公司 A kind of browsing monitoring method, device, equipment and the storage medium of web page element
CN112395535A (en) * 2019-08-15 2021-02-23 腾讯科技(深圳)有限公司 Image lazy loading method and device, medium and electronic equipment
CN111159600A (en) * 2019-12-27 2020-05-15 北京达佳互联信息技术有限公司 Method and device for reporting information of elements on page, electronic equipment and storage medium
CN112149039A (en) * 2020-10-13 2020-12-29 四川长虹电器股份有限公司 Method for increasing front-end webpage loading speed
CN112380473A (en) * 2020-11-16 2021-02-19 康键信息技术(深圳)有限公司 Data acquisition and synchronization method, device, equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113656102A (en) * 2021-08-17 2021-11-16 杭州网易云音乐科技有限公司 Data point burying method and device, storage medium and electronic equipment
CN114546377A (en) * 2022-01-07 2022-05-27 北京达佳互联信息技术有限公司 Embedded point processing method and device, electronic equipment and storage medium
CN116931897A (en) * 2023-09-15 2023-10-24 北京市大数据中心 Data reporting method, device and storage medium

Also Published As

Publication number Publication date
CN113206869B (en) 2022-11-01

Similar Documents

Publication Publication Date Title
CN113206869B (en) Data acquisition method and device, storage medium and electronic equipment
US11949750B2 (en) System and method for tracking browsing activity
US9330179B2 (en) Configuring web crawler to extract web page information
US9756140B2 (en) Tracking user behavior relative to a network page
US9805377B2 (en) Unified content visibility
CN111046317A (en) Page data acquisition method, device, equipment and computer readable storage medium
JP5027905B2 (en) Information display device, information display method, information display program, recording medium, and information display system
EP2299358A1 (en) Method and apparatus for user interface modification
CN106708502B (en) Webpage processing method and device
CN106844635A (en) The edit methods and device of the element in webpage
US20150310484A1 (en) System and Method for Tracking User Engagement with Online Advertisements
US8909765B2 (en) Analyzing webpage users' web access actions by using a defined focal region
EP3796155A1 (en) Improving acquisition process of gui elements using user input
CN107612908A (en) webpage tamper monitoring method and device
CN104881273A (en) Webpage rendering analysis method and terminal device
KR102034510B1 (en) A visitor behavior alalysis appratus of dynamic webpages and a method for analysing a visitor behavior of webpages using it
JP7308540B2 (en) Dynamic web page visitor behavior analysis information providing device and website visitor behavior analysis information providing method using the same
JP6015648B2 (en) Web page update notification program, Web page update notification device, and Web page update notification method
US9679073B2 (en) Webpage comprising a rules engine
US20150154160A1 (en) System and method for displaying image on webpage according to visible area
CN108829828B (en) Webpage display method and device, electronic equipment and readable storage medium
JP5957986B2 (en) Drawing support apparatus, drawing support method, and drawing support program
CN112083974A (en) Advertisement window closing method and device and electronic equipment
EP3018567A1 (en) User-interface review method, device, and program
CN111324388A (en) Webpage information monitoring method and device, storage medium and electronic equipment

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