WO2019196498A1 - 页面数据采集的方法、装置、服务器、电子设备及计算机可读介质 - Google Patents

页面数据采集的方法、装置、服务器、电子设备及计算机可读介质 Download PDF

Info

Publication number
WO2019196498A1
WO2019196498A1 PCT/CN2018/122297 CN2018122297W WO2019196498A1 WO 2019196498 A1 WO2019196498 A1 WO 2019196498A1 CN 2018122297 W CN2018122297 W CN 2018122297W WO 2019196498 A1 WO2019196498 A1 WO 2019196498A1
Authority
WO
WIPO (PCT)
Prior art keywords
page
control
current
listener
current page
Prior art date
Application number
PCT/CN2018/122297
Other languages
English (en)
French (fr)
Inventor
李英杰
Original Assignee
京东方科技集团股份有限公司
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 京东方科技集团股份有限公司 filed Critical 京东方科技集团股份有限公司
Priority to US16/474,478 priority Critical patent/US11538046B2/en
Publication of WO2019196498A1 publication Critical patent/WO2019196498A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0201Market modelling; Market analysis; Collecting market data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • 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]
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/86Event-based monitoring

Definitions

  • the present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, a server, an electronic device, and a computer readable medium for page data collection.
  • APP Application, APP
  • App developers or companies often want to collect and analyze the data used by the developed APP users, so that they can better understand the users. Behavior and feedback on the product, in order to further optimize and upgrade the APP and subsequent business, or give users better recommendations.
  • a method for page data collection comprising: communicating with a server to obtain configuration information from a server.
  • the configuration information includes control information; traversing all the controls in the current page, and determining, for each of the controls, whether the control is a control indicated by the control information in the configuration information; a control indicated by the control information in the configuration information, and a listener is set for the control; and the behavior data is collected by the listener by using the listener.
  • the method further includes: searching for whether the control is recording.
  • the method further comprises: responsive to determining that there is no record of the control: recording the control, determining whether the control has a listener, and in response to determining that the control has a listener, Replacing the existing listener with a new listener, wherein the new listener adds a behavioral data collection function corresponding to the type of the control on the existing listener, in response to determining The control has no listeners and sets the listener for the control.
  • the method further comprises: responsive to determining that the control has a record: renewing the original listener.
  • the configuration information further includes page information; the method further includes: obtaining a duration from the entry to the exit of the current page and a page name.
  • obtaining the duration and the page name from entering to exiting the current page including: obtaining the time to enter the current page and the page name; wherein, obtaining the time and page name of entering the current page, specifically: responding to entering The current page records the time of entering the current page, identifies the status of the current page as visible, and stores the page name including the current page and the page information of the page object; when storing the page information, determining whether the current storage directory is visible or not The main window page of the state; in response to the main window page having the visible state, the current page is used as the child window page of the visible state main window page; in response to the main window page having no visible state, the current page is used as the main window page .
  • the method further includes: determining whether the current page is a child window when the current page exits; The current page is a child window page, the current time is subtracted from the time of entering the current page as the duration from entering to exiting the current page; and the status of the current page is identified as invisible; in response to the current page being not a child window page, The current page and the child window page attached to the current page and identified as visible state adopt the current time minus the time of each entry as the duration of the respective page from entry to exit; and the current page and the current page are attached to the current page. The status of the child window page that is identified as a visible state is not visible.
  • a listener is set for the control using reflection and dynamic proxying.
  • the method further comprises: parsing and storing the configuration information locally.
  • control information includes a control ID, an associated control ID.
  • the method further comprises uploading at least the collected behavior data to the server.
  • a second aspect provides a page data collection apparatus, including: a communicator configured to communicate with a server to obtain configuration information from a server; the configuration information includes control information; and a control event monitor configured to traverse the current page All controls, for each of the controls, determining whether the control is a control indicated by the control information in the configuration information; and in response to the control being a control indicated by the control information in the configuration information, And setting a listener for the control; and performing behavior data collection on the control by using the listener.
  • control event monitor is configured to: after determining that the control is a control indicated by the control information in the configuration information, before setting a listener for the control, The record of the control.
  • control event monitor is further configured to: responsive to determining that there is no record of the control: recording the control, determining whether the control has a listener, in response to determining that the control has There is a listener that replaces the existing listener with a new listener, wherein the new listener adds behavior data collection function corresponding to the type of the control on the existing listener, and responds To determine that the control has no listeners, set a listener for the control.
  • control event monitor is further configured to: responsive to determining that there is a record of the control: renewing the original listener.
  • the configuration information further includes page information; based on the page data collection device, the page data collection device further includes a page statistic configured to acquire a duration from the entry to the exit of the current page and a page name.
  • the page statistic obtains the duration from the entry to the exit of the current page and the name of the page, including: the time when the page statisticter obtains the current page and the name of the page; wherein the page statistic obtains the current page Time and page name, including: in response to entering the current page, recording the time of entering the current page, identifying the status of the current page as visible, and storing the page name including the current page and the page information of the page object; storing the page Information, determining whether there is a visible state main window page in the current storage directory; in response to the main window page having the visible state, the current page is used as the child window page of the visible state main window page; in response to the absence of the visible state The main window page, the current page as the main window page.
  • the page statistic obtains the time and page name of entering the current page, it also obtains the duration from the entry to the exit of the current page; wherein the page statistic obtains the duration from the entry to the exit of the current page. , including: determining whether the current page is a child window page when the current page exits; in response to the current page being a child window page, subtracting the current time from the current time into the current page as the duration from entering to exiting the current page; The status of the current page is not visible; in response to the current page being not a child window, the current page and the child window page attached to the current page and identified as visible are all subtracted from the current time. As the duration of the respective page from entry to exit; the status of the current page and the child window page attached to the current page and identified as visible is identified as invisible.
  • the page data collection device further includes a parser configured to parse the configuration information acquired from the server and store it locally.
  • the communicator is further configured to upload at least the collected behavior data to the server.
  • a server including: a configuration memory configured to store configuration information; the configuration information includes control information; and a request receiver, when receiving a request for acquiring the configuration information sent by the page data collection device, The configuration information is sent to the page data collection device.
  • the server further includes a collector configured to store and analyze behavior data uploaded by the page data collection device.
  • the configuration information further includes page information; the collector is further configured to store and analyze the duration of the page data collection device uploaded from the entry to the exit current page and the page name.
  • a fourth aspect provides an electronic device, including: a processor, a memory; the memory is configured to store one or more programs; and when the one or more programs are executed by the processor, implementing the first aspect Said method.
  • a computer readable medium having stored thereon a computer program, which when executed, implements the method of the first aspect.
  • FIG. 1 is a schematic flowchart 1 of a page data collection method provided by the present disclosure.
  • FIG. 2 is a schematic flowchart 2 of a page data collection method provided by the present disclosure.
  • FIG. 3 is a schematic flowchart 3 of a page data collection method provided by the present disclosure.
  • FIG. 4 is a schematic flowchart diagram 4 of a page data collection method provided by the present disclosure.
  • FIG. 5 is a schematic flowchart 5 of a page data collection method provided by the present disclosure.
  • FIG. 6 is a schematic flowchart of a method for obtaining a time and a page name entering a current page according to the present disclosure.
  • FIG. 7 is a schematic flowchart diagram of a method for obtaining a duration from entering to exiting a current page according to the present disclosure.
  • FIG. 8 is a schematic flowchart 6 of a page data collection method provided by the present disclosure.
  • FIG. 9 is a schematic structural diagram 1 of a page data collection device provided by the present disclosure.
  • FIG. 10 is a schematic structural diagram 2 of a page data collection apparatus provided by the present disclosure.
  • FIG. 11 is a schematic structural diagram 3 of a page data collection apparatus provided by the present disclosure.
  • FIG. 12 is a schematic structural diagram 1 of a server provided by the present disclosure.
  • FIG. 13 is a schematic structural diagram 2 of a server provided by the present disclosure.
  • the embodiment of the present disclosure provides a method for collecting page data, as shown in FIG. 1 , including:
  • the page data collection method is performed by the terminal device.
  • Various applications can be installed on the terminal device, such as a shopping application, a web browser application, a search application, an instant communication tool, a mailbox client, and the like.
  • Terminal devices include, but are not limited to, mobile phones, tablets, portable computers, desktop computers, and the like.
  • the terminal device can communicate with the server via a wired or wireless network.
  • control has a text control, a picture control, a button control, a selection box control, an input box control, a progress bar control, and the like.
  • control information included in the configuration information in the server should be the information of the control that needs to perform behavior data collection.
  • a control is a control indicated by the control information in the configuration information
  • a listener is set for the control, essentially creating a new listener to replace the original listener, and the new listener is added to the
  • This function code will be preset into the program.
  • the new listener responds to the event data, and also calls the event listener function of the original listener to complete the original function logic of the control.
  • the behavior data collection function should be based on the type of control. For example, for the button control, the collected behavior data is clicked; for the selection box control, the selected behavior data can be collected, and the click behavior data can also be collected.
  • the control can collect multiple behavior data, it is necessary to determine which behavior data to collect when developing the program, so that the preset code knows what type of listener to use to replace the original listener (ie, which behavior is added) Data collection function). Once the collected behavior is defined, the function of the acquisition is determined when the behavior occurs.
  • the present disclosure is the behavior data collection without the burying method. It should also be noted here that the present disclosure only needs to add code when the page is displayed and disappears when developing the APP. Specifically, using the non-buried point method to collect behavior data requires calling the interface, and the place where the interface is called is where the page is displayed and disappears.
  • the embodiment of the present disclosure provides a method for collecting page data, by storing configuration information including control information in a server, and the control indicated by the control information is a control that needs to collect behavior data, and the configuration information may be acquired at the terminal device.
  • the listener is set only for the control indicated in the configuration information, and the behavior data is collected.
  • the behavior data collection function is preset to the program in advance, when the listener is set for the control, it is added, and thus, the buried point method used in the reference technology (that is, written in the event processing function) Code)
  • this disclosure does not need to add code when each control event is processed, which can reduce the complexity of the development process.
  • you need to update the listener for control events you don't need to rewrite the code and update the software, the operation is simple.
  • the method further includes:
  • the configuration information is analyzed and stored in the terminal device.
  • control information includes a control ID, and further may include an associated control ID.
  • the configuration information includes the control ID
  • the control is the control indicated by the control information in the configuration information.
  • the terminal dynamically monitors the control event by sending configuration information by the server.
  • the control information in the configuration information delivered by the server includes the associated control ID, the event can be carried to carry other behavior data information.
  • the method further includes: S15: upload the collected behavior data to the server.
  • the terminal device After the terminal device uploads the collected behavior data to the server and stores the data, the terminal device can perform subsequent analysis and processing.
  • the configuration information further includes page information; based on this, as shown in FIG. 4, the method further includes: S16: acquiring a duration from the entry to the exit of the current page and a page name. In order to provide a more in-depth analysis of user behavior.
  • the method further includes: S17, uploading the duration from the entry to the exit current page and the page name to the server.
  • the duration from the entry to the exit of the current page and the name of the page are obtained, including: obtaining the time to enter the current page and the name of the page.
  • the time and page name of the current page are obtained, as shown in FIG. 6, including:
  • the page information can exist in a directory (List).
  • the page is divided into a main window page and a sub-window page attached to the main window.
  • a directory For example, under an Activity (active page), there may be multiple Fragments (part of the page), Activity is the main window, and Fragment is the child window.
  • the class name of the Activity or Fragment can be stored as the page name, and the current time is recorded.
  • the statistics of the Activity and Fragment are implemented by using the class name of the Activity or Fragment as the page name.
  • the current page is used as the main window page.
  • the method further includes: S18, searching whether There is a record of the control.
  • setting a listener for the control includes: if there is no record of the control, recording the control, and setting a listener for the control, wherein if the control has a listener, Then, a new listener is used to replace the existing listener, and the new listener adds a behavior data collection function corresponding to the type of the control on the existing listener, if the control does not monitor Set the listener for it, obviously, the listener has a behavior data collection function corresponding to the type of the control; if the record of the control is found, no processing is performed, that is, the original is continued Listener.
  • the Android system When traversing all the controls of the page, if the ID of a certain control is the same as the control ID included in the configuration information, the control is a control that needs to collect data;
  • the record of the control if there is no record of the control, the control is recorded, for example, can be recorded in a HashMap, the key can be an ID, the Value is the control itself, and Add a data collection function to the listener corresponding to the control. If the record of the control is found, no processing is performed, that is, the original listener is continued. Among them, if the control is recorded in the HashMap, it should also be searched in the HashMap when searching.
  • a listener is set for the control using reflection and dynamic proxying.
  • a dynamic listener is used to create a new listener, but this new listener requires a parameter when it is created, which is the original listener.
  • the original listener needs to be retrieved using the reflection mechanism.
  • the embodiment of the present disclosure further provides a page data collection device, as shown in FIG. 9, comprising: a communicator 10 and a control event monitor 20.
  • the communicator 10 is configured to communicate with a server to obtain configuration information from the server; the configuration information includes control information.
  • the control information may include a control ID and an associated control ID.
  • the control event monitor 20 is configured to traverse all the controls in the current page, and for each control, determine whether the control is a control indicated by the control information in the configuration information; if yes, set a new listener for the control The new listener adds behavior data collection function corresponding to the type of the control based on the original listener.
  • control information included in the configuration information in the server should be the information of the control that needs to perform behavior data collection.
  • a control is a control indicated by the control information in the configuration information
  • a listener is set for the control, essentially creating a new listener to replace the original listener, and the new listener is added to the
  • This function code will be preset into the program.
  • the new listener responds to the event data, and also calls the event listener function of the original listener to complete the original function logic of the control.
  • the listener can be set for the control by means of reflection and dynamic proxy.
  • a dynamic listener is used to create a new listener, but this new listener requires a parameter when it is created, which is the original listener.
  • the original listener needs to be retrieved using the reflection mechanism.
  • Behavior data collection should be based on the type of control. For example, for the button control, the collected behavior data is clicked; for the selection box control, the selected behavior data can be collected, and the click behavior data can also be collected.
  • the control can collect multiple behavior data, it is necessary to determine which behavior data to collect when developing the program, so that the preset code knows what type of listener to use to replace the original listener (ie, which behavior is added) Data collection function). Once the collected behavior is defined, the function of the acquisition is determined when the behavior occurs.
  • the embodiment of the present disclosure provides a page data collection device, by storing configuration information including control information in a server, and the control indicated by the control information is a control that needs to collect behavior data, and can be acquired by the terminal device through the communicator 10
  • the control event monitor 20 when the user browses the current page, the control event monitor 20 only sets a listener for the control indicated in the configuration information, and the new listener adds on the basis of the original listener.
  • the behavior data collection function corresponding to the type of the control realizes collection of behavior data.
  • the behavior data collection function is preset to the program in advance, when the listener is set for the control, it is added, and thus, the buried point method used in the reference technology (that is, written in the event processing function) Code), this disclosure does not need to add code when each control event is processed, which can reduce the complexity of the development process.
  • the configuration information further includes page information; based on this, as shown in FIG. 10, the page data collection device further includes a page statistic 30 configured to acquire a duration from the entry to the exit of the current page.
  • the page name In order to provide a more in-depth analysis of user behavior.
  • the page statistic 30 acquires the duration from the entry to the exit of the current page and the page name, including: the page statistic 30 obtains the time to enter the current page and the page name.
  • the page statistic 30 obtains the time and page name of entering the current page, including: in response to entering the current page, recording the time of entering the current page, identifying the status of the current page as visible, and storing the page name and page including the current page.
  • the page information of the object when storing the page information, determining whether there is a visible window of the main window in the current storage directory; if present, using the current page as the child window page of the visible state main window page; otherwise, the current The page serves as the main window page.
  • the page information can exist in a List.
  • the page is divided into a main window page and a sub-window page attached to the main window.
  • there may be multiple Fragments in an Activity the Activity is the main window, and the Fragment is a child window.
  • the class name of the Activity or Fragment can be stored as the page name, and the current time is recorded.
  • the statistics of the Activity and Fragment are implemented by using the class name of the Activity or Fragment as the page name.
  • the page statistic 30 obtains the time and page name of entering the current page, it also acquires the duration from the entry to the exit of the current page.
  • the page statistic obtains the duration from the entry to the exit of the current page, including: determining whether the current page is a child window when the current page exits; if yes, subtracting the current time from entering the current page as the entry to exit The duration of the current page; and the status of the current page is marked as invisible; if not, the current page and the child window pages attached to the current page and identified as visible are subtracted from each other by the current time. Time, as the duration of the respective page from entry to exit; and identifies the current page and the status of the child window page attached to the current page and identified as visible as invisible.
  • control event monitor 20 is configured to: after determining that the control is a control indicated by the control information in the configuration information, before setting a listener for the control, a record of the control; wherein, if there is no record of the control, the control is recorded, and a listener is set for the control, wherein if the control has a listener, the new listener is replaced An existing listener, the new listener adds a behavior data collection function corresponding to the type of the control on the existing listener, and if the control does not have a listener, set a listener for the control.
  • the listener has a behavior data collection function corresponding to the type of the control; if the record of the control is found, no processing is performed, that is, the original listener is continued.
  • the Android system When traversing all the controls of the page, if the ID of a certain control is the same as the control ID included in the configuration information, the control is a control that needs to collect data;
  • the record of the control if there is no record of the control, the control is recorded, for example, can be recorded in a HashMap, the key can be an ID, the Value is the control itself, and the data is added in the listener corresponding to the control. Acquisition function. If the record of the control is found, no processing is performed, that is, the original listener is continued. Among them, if the control is recorded in the HashMap, it should also be searched in the HashMap when searching.
  • the page data collection device further includes a parser 40 configured to parse the configuration information acquired from the server and store it locally. That is, the configuration information is analyzed and stored in the terminal device.
  • the communicator 10 is further configured to upload at least the collected behavior data to the server.
  • the collected behavior data is uploaded to the server through the communicator 10, and after the server stores the data, the subsequent analysis processing can be performed.
  • the communicator 10 may also upload the duration from the entry to the exit current page and the page name to the server.
  • the embodiment of the present disclosure further provides a server, as shown in FIG. 12, including: a configuration memory 50 and a request receiver 60.
  • the configuration memory 50 is configured to store configuration information; the configuration information includes control information.
  • the configuration information is stored, for example, in the form of an xml file or json format data.
  • the control information includes a control ID, and further may include an associated control ID.
  • the configuration information includes the control ID
  • the control is the control indicated by the control information in the configuration information.
  • the terminal dynamically monitors the control event by sending configuration information by the server.
  • the control information in the configuration information delivered by the server includes the associated control ID, the event can be carried to carry other behavior data information.
  • the request receiver 60 when receiving the request for acquiring the configuration information sent by the page data collection device, sends the configuration information to the page data collection device.
  • the terminal device obtains the configuration information
  • the new listener is based on the original listener.
  • the behavior data collection function corresponding to the type of the control is added to realize the collection of behavior data. Since the behavior data collection function is preset into the program in advance, when the listener is set for the control, it is added, and thus, compared with the buried point method used in the reference technology (that is, the code is written in the event processing function), The present disclosure does not require adding code at the time of each control event processing, which reduces the complexity of the development process.
  • the server further includes a collector 70 configured to store and analyze behavior data uploaded by the page data collection device. After the collected behavior data is uploaded to the server and stored by the server, subsequent analysis and processing can be performed.
  • the collector 70 is further configured to store and analyze the duration of the page data collection device uploaded from the entry to the exit current page and the page name. In order to provide a more in-depth analysis of user behavior.
  • An embodiment of the present disclosure further provides an electronic device, including: a processor, a memory; the memory is configured to store one or more programs; and when the one or more programs are executed by the processor, implementing the foregoing page Data collection method.
  • the embodiment of the present disclosure further provides a computer readable medium having stored thereon a computer program, and when the computer program is executed, implementing the page data collection method described above.
  • the foregoing program may be stored in a computer readable storage medium, and the program is executed when executed.
  • the foregoing steps include the steps of the foregoing method embodiments; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.

Abstract

一种页面数据采集的方法、装置、服务器、电子设备及计算机可读介质,涉及计算机技术领域。该页面数据采集的方法包括:与服务器进行通信,从服务器获取配置信息,所述配置信息包括控件信息(S10);遍历当前页面中的所有控件,针对每个所述控件,判断所述控件是否为所述配置信息中所述控件信息所指示的控件(S11);响应于所述控件是所述配置信息中所述控件信息所指示的控件,为所述控件设置监听器(S12);通过所述监听器,对所述控件进行行为数据采集(S13)。

Description

页面数据采集的方法、装置、服务器、电子设备及计算机可读介质
相关申请
本申请要求申请日为2018年4月12日、申请号为201810328622.5的中国专利申请的优先权,该优先权申请的整体内容通过引用的方式被合并于此。
技术领域
本公开涉及计算机技术领域,尤其涉及页面数据采集的方法、装置、服务器、电子设备及计算机可读介质。
背景技术
随着移动互联网技术的迅速发展,每天用户都会使用各种应用程序(Application,APP),APP的开发者或者公司往往希望对开发的APP用户使用数据进行收集和分析,可以更好地了解用户的行为和对产品的反馈,以便进一步对APP和后面的业务进行优化升级,或者给用户更好的推荐等。
发明内容
第一方面,提供一种页面数据采集的方法,该方法包括:与服务器进行通信,从服务器获取配置信息。所述配置信息包括控件信息;遍历当前页面中的所有控件,针对每个所述控件,判断所述控件是否为所述配置信息中所述控件信息所指示的控件;响应于所述控件是所述配置信息中所述控件信息所指示的控件,为所述控件设置监听器;通过所述监听器,对所述控件进行行为数据采集。
在一个实施例中,在判断所述控件为所述配置信息中所述控件信息所指示的控件之后,在为所述控件设置监听器之前,所述方法还包括:查找是否有所述控件的记录。
在一个实施例中,所述方法进一步包括:响应于确定没有所述控件的记录:对所述控件进行记录,确定所述控件是否已有监听器,响应于确定所述控件已有监听器,将已有的监听器替换为新的监听器,其中所述新的监听器是在所述已有的监听器上增加与所述控件的类型相对应的行为数据采集功能,响应于确定所述控件没有监听器,为所述控件设置监听器。
在一个实施例中,所述方法进一步包括:响应于确定有所述控件 的记录:续用原有的监听器。
在一个实施例中,所述配置信息还包括页面信息;所述方法还包括:获取从进入到退出当前页面的持续时长和页面名称。
进一步的实施例中,获取从进入到退出当前页面的持续时长和页面名称,包括:获取进入当前页面的时间和页面名称;其中,获取进入当前页面的时间和页面名称,具体包括:响应于进入当前页面,记录进入当前页面的时间,将当前页面的状态标识为可见,并存储包括当前页面的页面名称和页面对象的页面信息;在存储所述页面信息时,判断当前存储目录中是否存在可见状态的主窗口页面;响应于存在可见状态的主窗口页面,则把当前页面作为该可见状态主窗口页面的子窗口页面;响应于不存在可见状态的主窗口页面,把当前页面作为主窗口页面。
在此基础上,获取进入当前页面的时间和页面名称之后,获取从进入到退出当前页面的持续时长,所述方法进一步包括:在当前页面退出时,判断当前页面是否为子窗口页面;响应于当前页面是子窗口页面,将当前时间减去进入当前页面的时间作为从进入到退出当前页面的持续时长;并将当前页面的状态标识为不可见;响应于当前页面不是子窗口页面,则将该当前页面及附属于该当前页面且标识为可见状态的子窗口页面,都采用当前时间减去各自进入的时间,作为各自页面从进入到退出的持续时长;并将当前页面及附属于该当前页面且标识为可见状态的子窗口页面的状态标识为不可见。
在一个实施例中,利用反射和动态代理的方式,为所述控件设置监听器。
在一个实施例中,在从服务器获取所述配置信息之后,遍历当前页面中的所有控件之前,所述方法还包括:将所述配置信息进行解析并存储于本地。
在一个实施例中,所述控件信息包括控件ID、关联控件ID。
在一个实施例中,所述方法还包括:至少将采集到的行为数据上传至服务器。
第二方面,提供一种页面数据采集装置,包括:通信器,配置为与服务器进行通信,从服务器获取配置信息;所述配置信息包括控件信息;控件事件监控器,配置为遍历当前页面中的所有控件,针对每 个所述控件,判断所述控件是否为所述配置信息中所述控件信息所指示的控件;响应于所述控件是所述配置信息中所述控件信息所指示的控件,,为所述控件设置监听器;通过所述监听器,对所述控件进行行为数据采集。
在一个实施例中,所述控件事件监控器配置为,在判断所述控件为所述配置信息中所述控件信息所指示的控件之后,在为所述控件设置监听器之前,还查找是否有所述控件的记录。
在一个实施例中,所述控件事件监控器进一步配置为:响应于确定没有所述控件的记录:对所述控件进行记录,确定所述控件是否已有监听器,响应于确定所述控件已有监听器,将已有的监听器替换为新的监听器,其中所述新的监听器是在所述已有的监听器上增加与所述控件的类型相对应的行为数据采集功能,响应于确定所述控件没有监听器,为所述控件设置监听器。
在一个实施例中,所述控件事件监控器进一步配置为:响应于确定有所述控件的记录:续用原有的监听器。
在一个实施例中,所述配置信息还包括页面信息;基于此,所述页面数据采集装置还包括页面统计器,配置为获取从进入到退出当前页面的持续时长和页面名称。
进一步的,所述页面统计器获取从进入到退出当前页面的持续时长和页面名称,包括:所述页面统计器获取进入当前页面的时间和页面名称;其中,所述页面统计器获取进入当前页面的时间和页面名称,包括:响应于进入当前页面,记录进入当前页面的时间,将当前页面的状态标识为可见,并存储包括当前页面的页面名称和页面对象的页面信息;在存储所述页面信息时,判断当前存储目录中是否存在可见状态的主窗口页面;响应于存在可见状态的主窗口页面,则把当前页面作为该可见状态主窗口页面的子窗口页面;响应于不存在可见状态的主窗口页面,把当前页面作为主窗口页面。
在此基础上,所述页面统计器获取进入当前页面的时间和页面名称后,还获取从进入到退出当前页面的持续时长;其中,所述页面统计器获取从进入到退出当前页面的持续时长,包括:在当前页面退出时,判断当前页面是否为子窗口页面;响应于当前页面是子窗口页面,将当前时间减去进入当前页面的时间作为从进入到退出当前页面的持 续时长;并将当前页面的状态标识为不可见;响应于当前页面不是子窗口页面,则将该当前页面及附属于该当前页面且标识为可见状态的子窗口页面,都采用当前时间减去各自进入的时间,作为各自页面从进入到退出的持续时长;并将当前页面及附属于该当前页面且标识为可见状态的子窗口页面的状态标识为不可见。
在一个实施例中,所述页面数据采集装置还包括解析器,配置为将从服务器获取的所述配置信息进行解析,并存储于本地。
在一个实施例中,所述通信器,还配置为至少将采集到的行为数据上传至服务器。
第三方面,提供一种服务器,包括:配置存储器,配置为存储配置信息;所述配置信息包括控件信息;请求接收器,当接收到页面数据采集装置发送的获取所述配置信息的请求时,将所述配置信息发送至所述页面数据采集装置。
在一个实施例中,所述的服务器还包括收集器,配置为将页面数据采集装置上传的行为数据存储、并分析。
进一步的实施例中,所述配置信息还包括页面信息;所述收集器还被配置为将页面数据采集装置上传的从进入到退出当前页面的持续时长和页面名称存储、并分析。
第四方面,提供一种电子设备,包括:处理器、存储器;所述存储器用于存储一个或多个程序;当所述一个或多个程序被所述处理器执行时,实现如第一方面所述的方法。
第五方面,提供一种计算机可读介质,其上存储有计算机程序,所述计算机程序被执行时,实现如第一方面所述的方法。
附图说明
为了更清楚地说明本公开实施例或参考技术中的技术方案,下面将对实施例或参考技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本公开提供的一种页面数据采集方法的流程示意图一。
图2为本公开提供的一种页面数据采集方法的流程示意图二。
图3为本公开提供的一种页面数据采集方法的流程示意图三。
图4为本公开提供的一种页面数据采集方法的流程示意图四。
图5为本公开提供的一种页面数据采集方法的流程示意图五。
图6为本公开提供的一种获取进入当前页面的时间和页面名称的方法的流程示意图。
图7为本公开提供的一种获取从进入到退出当前页面的持续时长的方法的流程示意图。
图8为本公开提供的一种页面数据采集方法的流程示意图六。
图9为本公开提供的一种页面数据采集装置的结构示意图一。
图10为本公开提供的一种页面数据采集装置的结构示意图二。
图11为本公开提供的一种页面数据采集装置的结构示意图三。
图12为本公开提供的一种服务器的结构示意图一。
图13为本公开提供的一种服务器的结构示意图二。
具体实施方式
下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本公开一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。
目前在APP(Application,应用程序)中进行数据采集时往往需要开发人员专门编写用于数据采集的代码,放在界面特定操作时产生事件的回调函数中,这样会造成开发过程复杂,需要提前考虑要采集数据的控件并编写好代码,后期增加或者减少数据采集点,需要重新编写代码,并升级软件才能使新的代码在APP上生效,缺乏灵活性。此外,有一些技术方案采用全埋点的方式,就是对界面上所有可能采集的事件点回调里面都加上一段处理代码,开发人员不得不提前考虑数据采集功能的嵌入。
本公开实施例提供一种页面数据采集的方法,如图1所示,包括:
S10、与服务器进行通信,从服务器获取配置信息;所述配置信息包括控件信息。
本领域技术人员明白,本公开实施例中,页面数据采集方法由终端设备执行。终端设备上可以安装各种应用程序,例如购物类应用、 网页浏览器应用、搜索类应用、即时通信工具、邮箱客户端等。终端设备包括但不限于手机、平板电脑、便携式计算机、台式计算机等。
终端设备可以通过有线或无线网络与服务器通信。
S11、遍历当前页面中的所有控件,针对每个控件,判断所述控件是否为所述配置信息中控件信息所指示的控件;若是,执行S12。
其中,控件有文本控件、图片控件、按钮控件、选择框控件、输入框控件、进度条控件等等。
可采用递归的方式对当前页面中的所有控件进行遍历。
以安卓为例,遍历当前页面中的所有控件,可以是:解析页面的视图树,从视图的DecorView(根节点)开始遍历所有的View(视图),可通过getChildCount()函数获取子节点个数,然后通过getChildAt()函数获取到子节点的View,采用递归的方式可以对页面所有View进行遍历。其中,本领域技术人员应该明白,控件就是具体的某类View。在此基础上,如果某个控件的信息与配置信息中的控件信息一致,为该控件设置监听器。
可以理解的是,服务器中的配置信息所包括的控件信息,应为需要进行行为数据采集的控件的信息。
S12、为所述控件设置监听器。
需要说明的是,若某个控件为所述配置信息中控件信息所指示的控件,则为该控件设置监听器,实质是创建新的监听器替换原监听器,新的监听器里面增加与该控件的类型相对应的行为数据采集功能,这个功能代码会提前预置到程序中。新的监听器响应事件的动作除了采集行为数据外,还会调用原来监听器的事件响应函数,以便完成该控件原有的功能逻辑。
其中,行为数据采集功能应根据控件的类型而定。例如,对于按钮控件,采集的就是点击的行为数据;对于选择框控件,可以采集选择的行为数据,也可以采集点击的行为数据。对于控件可以采集多种行为数据时,需要在开发程序时就确定好要采集哪种行为数据,这样预置的代码才知道使用什么类型的监听器去替换原监听器(即,增加哪种行为数据采集功能)。一旦采集的行为定义好了,当行为发生时,采集的功能就确定了。
由于行为数据采集功能的代码不需要写在每个事件处理函数内, 因而本公开即为无埋点方式进行的行为数据采集。在此还需说明的一点是,本公开在开发APP时仅需在页面显示和消失的位置添加代码。具体来讲,使用无埋点这种方式来采集行为数据,需要调用接口,而调用接口的地方就在页面显示和消失的位置。
S13、通过所述监听器,对所述控件进行行为数据采集。
本公开实施例提供一种页面数据采集的方法,通过在服务器中存储包括控件信息的配置信息,而该控件信息所指示的控件为需要进行行为数据采集的控件,可在终端设备获取该配置信息后,在用户浏览当前页面时,仅为配置信息中指示的控件设置监听器,实现对行为数据进行采集。基于此,由于行为数据采集功能会提前预置到程序中,在为控件设置监听器时,将其添加进来,因而,相对参考技术中采用的埋点方式(即,在事件处理函内写入代码),本公开不需要在每个控件事件处理的时候添加代码,可降低开发过程复杂度。当需要更新控件事件的监听器时,也不需要重新编写代码并更新软件,操作简单。
在一个实施例中,如图2所示,在S10之后,S11之前,所述方法还包括:
S14、将所述配置信息进行解析并存储于本地。
即,将所述配置信息进行解析后,存储于终端设备。
在一个实施例中,所述控件信息包括控件ID,进一步的还可以包括关联控件ID。
当配置信息中包括控件ID时,如果某个控件的ID与配置信息中的控件ID一致,则该控件便是配置信息中所述控件信息所指示的控件。
当配置信息中还包括关联控件ID时,则会存在某个控件关联另外一个控件的情况。例如可以是一个按钮控件关联一个编辑框控件,基于此,可对按钮控件进行点击行为采集,并对输入编辑框里面的内容进行采集。本公开实施例中,通过服务器下发配置信息,终端动态监控控件事件。当服务器下发的配置信息中控件信息包括关联控件ID时,可使事件携带其他控件行为数据信息。
在一个实施例中,如图3所示,所述方法还包括:S15、将采集到的行为数据上传至服务器。
终端设备通过将采集的行为数据上传服务器,服务器进行存储后,可进行后续分析处理。
在一个实施例中,所述配置信息还包括页面信息;基于此,如图4所示,所述方法还包括:S16、获取从进入到退出当前页面的持续时长和页面名称。以便可对用户行为进行更深入的分析。
在此基础上,如图5所示,所述方法还包括:S17、将从进入到退出当前页面的持续时长和页面名称,上传至服务器。
进一步的,获取从进入到退出当前页面的持续时长和页面名称,包括:获取进入当前页面的时间和页面名称。
其中,获取进入当前页面的时间和页面名称,如图6所示,包括:
S161、响应于进入当前页面,记录进入当前页面的时间,将当前页面的状态标识为可见,并存储包括当前页面的页面名称和页面对象的页面信息。
示例的,页面信息可以存在一个目录(List)里面。页面分为主窗口页面和附属于主窗口的子窗口页面。比如某个Activity(活动的页面)下可以有多个Fragment(页面中的一部分)存在,Activity是主窗口,Fragment是子窗口。
Activity进入时或者Fragment进入时,可把Activity或者Fragment的类名作为页面名称存储下来,并记录当前时间。通过将Activity或者Fragment的类名作为页面名称,实现了对Activity和Fragment的统计。
S162、在存储所述页面信息时,判断当前存储目录中是否有可见状态的主窗口页面;若存在,执行S163;否则,执行S164。
S163、把当前页面作为该可见状态主窗口页面的子窗口页面。
S164、把当前页面作为主窗口页面。
在此基础上,获取从进入到退出当前页面的持续时长,如图7所示,包括:
S165、在当前页面退出时,判断当前页面是否为子窗口页面;若是,执行S166;否则,执行S167。
可以理解的是,如果不是子窗口页面,则必然为主窗口页面。
S166、将当前时间减去进入当前页面的时间作为从进入到退出当前页面的持续时长;并将当前页面的状态标识为不可见。
S167、将该当前页面及附属于该当前页面且标识为可见状态的子窗口页面,都采用当前时间减去各自进入的时间,作为各自页面从进入到退出的持续时长;并将当前页面及附属于该当前页面且标识为可 见状态的子窗口页面的状态标识为不可见。
在一个实施例中,如图8所示,在判断所述控件为所述配置信息中控件信息所指示的控件之后,为所述控件设置监听器之前,所述方法还包括:S18、查找是否有所述控件的记录。
在此基础上,为所述控件设置监听器,包括:若没有所述控件的记录,则对所述控件进行记录,并为所述控件设置监听器,其中若所述控件已有监听器,则采用新的监听器替代已有的监听器,所述新的监听器是在所述已有的监听器上增加与所述控件的类型相对应的行为数据采集功能,若所述控件没有监听器,则为其设置监听器,显然,该监听器具有与所述控件的类型相对应的行为数据采集功能;若查找到有所述控件的记录,则不做处理,即续用原有的监听器。
示例的,仍以安卓系统为例,在遍历页面所有控件时,如果某个控件的ID与配置信息中包括的控件ID一样,则该控件为需要进行数据采集的控件;可先查找是否有所述控件的记录,若没有所述控件的记录,则把该控件记录下来,例如可记录在一个HashMap(哈希表)中,key(键)可以是ID,Value(值)就是控件本身,并在所述控件对应的监听器中增加数据采集功能。若查找有所述控件的记录,则不做处理,即续用原有的监听器。其中,如果控件的被记录在HashMap中,则在查找时,也应在HashMap中进行查找。
本公开实例中,通过对设置监听器的控件进行记录,在需要为某个控件设置监听器之前,通过先查找是否有该控件的记录,如果有则可不必再设置新的控件,可避免重复。
基于上述,在一个实施例中,利用反射和动态代理的方式,为所述控件设置监听器。
具体的,使用动态代理建立一个新的监听器,但是这个新的监听器建立时需要一个参数,就是原来的监听器,原来的监听器需要使用反射机制获取。
示例的,以按钮(Button)控件为例,可先使用反射方法获取filedId为mListenerInfo的对象obj1,然后再获取obj1的fieldId为mOnClickListener的对象obj2,用obj2构造InvocationHandler的对象obj3,并用Proxy.newProxyInstance创建原监控器的代理对象,最后用反射方式将新的代理对象设置mListenerInfo的mOnClickListener成员, 这样实现了使用新的监控器代替了原来的监控器,而obj3中除了增加新的事件处理逻辑外,还保持对原监控器obj2的调用,从而实现在原有功能基础上,对点击事件进行采集。
本公开实施例还提供一种页面数据采集装置,如图9所示,包括:通信器10和控件事件监控器20。
通信器10,配置为与服务器进行通信,从服务器获取配置信息;所述配置信息包括控件信息。
其中,所述控件信息可以包括控件ID、关联控件ID。
控件事件监控器20,配置为遍历当前页面中的所有控件,针对每个控件,判断所述控件是否为所述配置信息中控件信息所指示的控件;若是,为所述控件设置新的监听器;所述新的监听器在原有监听器的基础上,增加与所述控件的类型相对应的行为数据采集功能。
其中,可采用递归的方式对当前页面中的所有控件进行遍历。
以安卓系统为例,遍历当前页面中的所有控件,可以是:解析页面的视图树,从视图的DecorView开始遍历所有的View,可通过getChildCount()函数获取子节点个数,然后通过getChildAt()函数获取到子节点的View,采用递归的方式可以对页面所有View进行遍历。其中,本领域技术人员应该明白,控件就是具体的某类View。在此基础上,如果某个控件的信息与配置信息中的控件信息一致,为该控件设置监听器。
可以理解的是,服务器中的配置信息所包括的控件信息,应为需要进行行为数据采集的控件的信息。
需要说明的是,若某个控件为所述配置信息中控件信息所指示的控件,则为该控件设置监听器,实质是创建新的监听器替换原监听器,新的监听器里面增加与该控件的类型相对应的行为数据采集功能,这个功能代码会提前预置到程序中。新的监听器响应事件的动作除了采集行为数据外,还会调用原来监听器的事件响应函数,以便完成该控件原有的功能逻辑。
其中,可利用反射和动态代理的方式,为所述控件设置监听器。具体的,使用动态代理建立一个新的监听器,但是这个新的监听器建立时需要一个参数,就是原来的监听器,原来的监听器需要使用反射机制获取。
行为数据采集功能应根据控件的类型而定。例如,对于按钮控件,采集的就是点击的行为数据;对于选择框控件,可以采集选择的行为数据,也可以采集点击的行为数据。对于控件可以采集多种行为数据时,需要在开发程序时就确定好要采集哪种行为数据,这样预置的代码才知道使用什么类型的监听器去替换原监听器(即,增加哪种行为数据采集功能)。一旦采集的行为定义好了,当行为发生时,采集的功能就确定了。
本公开实施例提供一种页面数据采集装置,通过在服务器中存储包括控件信息的配置信息,而该控件信息所指示的控件为需要进行行为数据采集的控件,可在终端设备通过通信器10获取该配置信息后,在用户浏览当前页面时,通过控件事件监控器20仅对配置信息中指示的控件,为其设置监听器,而该新的监听器在原有监听器的基础上,增加了与所述控件的类型相对应的行为数据采集功能,实现对行为数据进行采集。基于此,由于行为数据采集功能会提前预置到程序中,在为控件设置监听器时,将其添加进来,因而,相对参考技术中采用的埋点方式(即,在事件处理函内写入代码),本公开不需要在每个控件事件处理的时候添加代码,可降低开发过程复杂度。
在一个实施例中,所述配置信息还包括页面信息;基于此,如图10所示,所述页面数据采集装置还包括页面统计器30,配置为获取从进入到退出当前页面的持续时长和页面名称。以便可对用户行为进行更深入的分析。
在此基础上,所述页面统计器30获取从进入到退出当前页面的持续时长和页面名称,包括:页面统计器30获取进入当前页面的时间和页面名称。
其中,页面统计器30获取进入当前页面的时间和页面名称,包括:响应于进入当前页面,记录进入当前页面的时间,将当前页面的状态标识为可见,并存储包括当前页面的页面名称和页面对象的页面信息;在存储所述页面信息时,判断当前存储目录中是否存在可见状态的主窗口页面;若存在,则把当前页面作为该可见状态主窗口页面的子窗口页面;否则,把当前页面作为主窗口页面。
示例的,页面信息可以存在一个List里面。页面分为主窗口页面和附属于主窗口的子窗口页面。比如某个Activity下可以有多个 Fragment存在,Activity是主窗口,Fragment是子窗口。
Activity进入时或者Fragment进入时,可把Activity或者Fragment的类名作为页面名称存储下来,并记录当前时间。通过将Activity或者Fragment的类名作为页面名称,实现了对Activity和Fragment的统计。
在此基础上,页面统计器30获取进入当前页面的时间和页面名称后,还获取从进入到退出当前页面的持续时长。
其中,页面统计器获取从进入到退出当前页面的持续时长,包括:在当前页面退出时,判断当前页面是否为子窗口页面;若是,将当前时间减去进入当前页面的时间作为从进入到退出当前页面的持续时长;并将当前页面的状态标识为不可见;若否,则将该当前页面及附属于该当前页面且标识为可见状态的子窗口页面,都采用当前时间减去各自进入的时间,作为各自页面从进入到退出的持续时长;并将当前页面及附属于该当前页面且标识为可见状态的子窗口页面的状态标识为不可见。
在一个实施例中,控件事件监控器20,配置为,在判断所述控件为所述配置信息中所述控件信息所指示的控件之后,在为所述控件设置监听器之前,还查找是否有所述控件的记录;其中,若没有所述控件的记录,则对所述控件进行记录,并为所述控件设置监听器,其中若所述控件已有监听器,则采用新的监听器替代已有的监听器,所述新的监听器是在所述已有的监听器上增加与所述控件的类型相对应的行为数据采集功能,若所述控件没有监听器,则为其设置监听器,显然,该监听器具有与所述控件的类型相对应的行为数据采集功能;若查找到有所述控件的记录,则不做处理,即续用原有的监听器。
示例的,仍以安卓系统为例,在遍历页面所有控件时,如果某个控件的ID与配置信息中包括的控件ID一样,则该控件为需要进行数据采集的控件;可先查找是否有所述控件的记录,若没有所述控件的记录,则把该控件记录下来,例如可记录在一个HashMap中,key可以是ID,Value就是控件本身,并在所述控件对应的监听器中增加数据采集功能。若查找有所述控件的记录,则不做处理,即续用原有的监听器。其中,如果控件的被记录在HashMap中,则在查找时,也应在HashMap中进行查找。
本公开实例中,通过对设置监听器的控件进行记录,在需要为某 个控件设置监听器之前,通过先查找是否有该控件的记录,如果有则可不必再设置新的控件,可避免重复。
在一个实施例中,如图11所示,所述页面数据采集装置还包括解析器40,配置为将从服务器获取的所述配置信息进行解析,并存储于本地。即,将所述配置信息进行解析后,存储于终端设备。
在一个实施例中,所述通信器10,还配置为至少将采集到的行为数据上传至服务器。通过通信器10将采集的行为数据上传服务器,服务器进行存储后,可进行后续分析处理。
进一步的,所述通信器10还可将从进入到退出当前页面的持续时长和页面名称,上传至所述服务器。
本公开实施例还提供一种服务器,如图12所示,包括:配置存储器50和请求接收器60。
配置存储器50,配置为存储配置信息;所述配置信息包括控件信息。
其中,配置信息例如以xml文件或者json格式数据等形式进行存储。
所述控件信息包括控件ID,进一步的还可以包括关联控件ID。
当配置信息中包括控件ID时,如果某个控件的ID与配置信息中的控件ID一致,则该控件便是配置信息中所述控件信息所指示的控件。
当配置信息中还包括关联控件ID时,则会存在某个控件关联另外一个控件的情况。例如可以是一个按钮控件关联一个编辑框控件,基于此,可对按钮控件进行点击行为采集,并对输入编辑框里面的内容进行采集。本公开实施例中,通过服务器下发配置信息,终端动态监控控件事件。当服务器下发的配置信息中控件信息包括关联控件ID时,可使事件携带其他控件行为数据信息。
请求接收器60,当接收到页面数据采集装置发送的获取所述配置信息的请求时,将所述配置信息发送至所述页面数据采集装置。
基于此,在终端设备获取该配置信息后,在用户浏览当前页面时,仅对配置信息中指示的控件,为其设置新的监听器,而该新的监听器在原有监听器的基础上,增加了与所述控件的类型相对应的行为数据采集功能,实现对行为数据进行采集。由于行为数据采集功能会提前预置到程序中,在为控件设置监听器时,将其添加进来,因而,相对 参考技术中采用的埋点方式(即,在事件处理函内写入代码),本公开不需要在每个控件事件处理的时候添加代码,可降低开发过程复杂度。
在一个实施例中,如图13所示,所述服务器还包括收集器70,配置为将页面数据采集装置上传的行为数据存储、并分析。将采集的行为数据上传服务器,服务器进行存储后,可进行后续分析处理。
在所述配置信息还包括页面信息的情况下,收集器70还被配置为将页面数据采集装置上传的从进入到退出当前页面的持续时长和页面名称存储、并分析。以便可对用户行为进行更深入的分析。
本公开实施例还提供一种电子设备,包括:处理器、存储器;所述存储器用于存储一个或多个程序;当所述一个或多个程序被所述处理器执行时,实现上述的页面数据采集方法。
本公开实施例还提供一种计算机可读介质,其上存储有计算机程序,所述计算机程序被执行时,实现上述的页面数据采集方法。
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
本领域普通技术人员可以理解:本公开实施例中的方法步骤的示出顺序并不代表该步骤的执行顺序,所示出的方法步骤可以以任何合理的顺序执行,包括以各种可能的顺序先后执行和同时执行。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。

Claims (25)

  1. 一种页面数据采集的方法,包括:
    与服务器进行通信,从服务器获取配置信息,所述配置信息包括控件信息;
    遍历当前页面中的所有控件,针对每个所述控件,判断所述控件是否为所述配置信息中所述控件信息所指示的控件;
    响应于所述控件是所述配置信息中所述控件信息所指示的控件,为所述控件设置监听器;
    通过所述监听器,对所述控件进行行为数据采集。
  2. 根据权利要求1所述的方法,其中,在判断所述控件为所述配置信息中所述控件信息所指示的控件之后,在为所述控件设置监听器之前,所述方法还包括:查找是否有所述控件的记录。
  3. 根据权利要求2所述的方法,进一步包括:
    响应于确定没有所述控件的记录:
    对所述控件进行记录;
    确定所述控件是否已有监听器;
    响应于确定所述控件已有监听器,将已有的监听器替换为新的监听器,其中所述新的监听器是在所述已有的监听器上增加与所述控件的类型相对应的行为数据采集功能;
    响应于确定所述控件没有监听器,为所述控件设置监听器,所述监听器具有与所述控件的类型相对应的行为数据采集功能。
  4. 根据权利要求3所述的方法,进一步包括:
    响应于确定有所述控件的记录:则续用原有的监听器。
  5. 根据权利要求1所述的方法,其中,利用反射和动态代理的方式,为所述控件设置监听器。
  6. 根据权利要求1-5任一项所述的方法,其中,在从服务器获取所述配置信息之后,遍历当前页面中的所有控件之前,所述方法还包括:将所述配置信息进行解析并存储于本地。
  7. 根据权利要求1所述的方法,其特征在于,所述配置信息还包括页面信息;
    所述方法还包括:获取从进入到退出当前页面的持续时长和页面 名称。
  8. 根据权利要求7所述的方法,其中,获取从进入到退出当前页面的持续时长和页面名称,包括:获取进入当前页面的时间和页面名称;
    获取进入当前页面的时间和页面名称,具体包括:
    响应于进入当前页面,记录进入当前页面的时间,将当前页面的状态标识为可见,并存储包括当前页面的页面名称和页面对象的页面信息;
    在存储所述页面信息时,判断当前存储目录中是否存在可见状态的主窗口页面;响应于存在可见状态的主窗口页面,则把当前页面作为该可见状态主窗口页面的子窗口页面;否则,把当前页面作为主窗口页面。
  9. 根据权利要求8所述的方法,其中,获取进入当前页面的时间和页面名称之后,所述方法进一步包括:
    响应于退出当前页面,判断当前页面是否为子窗口页面;
    响应于当前页面是子窗口页面,将当前时间减去进入当前页面的时间作为从进入到退出当前页面的持续时长;并将当前页面的状态标识为不可见;
    响应于当前页面不是子窗口页面,将该当前页面及附属于该当前页面且标识为可见状态的子窗口页面,都采用当前时间减去各自进入的时间,作为各自页面从进入到退出的持续时长;并将当前页面及附属于该当前页面且标识为可见状态的子窗口页面的状态标识为不可见。
  10. 根据权利要求1-5、7-9任一项所述的方法,其中,所述控件信息包括控件ID、关联控件ID。
  11. 根据权利要求1-5、7-9任一项所述的方法,其中,所述方法还包括:至少将采集到的行为数据上传至服务器。
  12. 一种页面数据采集装置,包括:
    通信器,配置为与服务器进行通信,从服务器获取配置信息,所述配置信息包括控件信息;
    控件事件监控器,配置为遍历当前页面中的所有控件,针对每个所述控件,判断所述控件是否为所述配置信息中所述控件信息所指示 的控件;响应于所述控件是所述配置信息中所述控件信息所指示的控件,为所述控件设置监听器;通过所述监听器,对所述控件进行行为数据采集。
  13. 根据权利要求10所述的页面数据采集装置,其中,所述控件事件监控器进一步配置为,在判断所述控件为所述配置信息中所述控件信息所指示的控件之后,在为所述控件设置监听器之前,还查找是否有所述控件的记录。
  14. 根据权利要求13所述的页面数据采集装置,其中,所述控件事件监控器进一步配置为:
    响应于确定没有所述控件的记录:
    对所述控件进行记录;
    确定所述控件是否已有监听器;
    响应于确定所述控件已有监听器,将已有的监听器替换为新的监听器,其中所述新的监听器是在所述已有的监听器上增加与所述控件的类型相对应的行为数据采集功能;
    响应于确定所述控件没有监听器,为所述控件设置监听器,所述监听器具有与所述控件的类型相对应的行为数据采集功能。
  15. 根据权利要求14所述的页面数据采集装置,其中,所述控件事件监控器进一步配置为:
    响应于确定有所述控件的记录:续用原有的监听器。
  16. 根据权利要求12-15任一项所述的页面数据采集装置,其中,还包括解析器,配置为将从服务器获取的所述配置信息进行解析,并存储于本地。
  17. 根据权利要求12所述的页面数据采集装置,其中,所述配置信息还包括页面信息;
    所述页面数据采集装置还包括页面统计器,配置为获取从进入到退出当前页面的持续时长和页面名称。
  18. 根据权利要求17所述的页面数据采集装置,其中,所述页面统计器获取从进入到退出当前页面的持续时长和页面名称,包括:所述页面统计器获取进入当前页面的时间和页面名称;
    其中,所述页面统计器获取进入当前页面的时间和页面名称,包括:
    响应于进入当前页面,记录进入当前页面的时间,将当前页面的状态标识为可见,并存储包括当前页面的页面名称和页面对象的页面信息;
    在存储所述页面信息时,判断当前存储目录中是否存在可见状态的主窗口页面;响应于存在可见状态的主窗口页面,则把当前页面作为该可见状态主窗口页面的子窗口页面;响应于不存在可见状态的主窗口页面,把当前页面作为主窗口页面。
  19. 根据权利要求18所述的页面数据采集装置,其中,所述页面统计器配置为获取进入当前页面的时间和页面名称后,还获取从进入到退出当前页面的持续时长;
    其中,所述页面统计器获取从进入到退出当前页面的持续时长,包括:
    在当前页面退出时,判断当前页面是否为子窗口页面;
    响应于当前页面是子窗口页面,将当前时间减去进入当前页面的时间作为从进入到退出当前页面的持续时长;并将当前页面的状态标识为不可见;
    响应于当前页面不是子窗口页面,将该当前页面及附属于该当前页面且标识为可见状态的子窗口页面,都采用当前时间减去各自进入的时间,作为各自页面从进入到退出的持续时长;并将当前页面及附属于该当前页面且标识为可见状态的子窗口页面的状态标识为不可见。
  20. 根据权利要求12-15、17-19任一项所述的页面数据采集装置,其中,所述通信器,还配置为至少将采集到的行为数据上传至服务器。
  21. 一种服务器,包括:
    配置存储器,配置为存储配置信息;所述配置信息包括控件信息;
    请求接收器,配置为当接收到页面数据采集装置发送的获取所述配置信息的请求时,将所述配置信息发送至所述页面数据采集装置。
  22. 根据权利要求21所述的服务器,其中,还包括收集器,配置为将页面数据采集装置上传的行为数据存储、并分析。
  23. 根据权利要求22所述的服务器,其中,所述配置信息还包括页面信息;
    所述收集器还被配置为将页面数据采集装置上传的从进入到退出 当前页面的持续时长和页面名称存储、并分析。
  24. 一种电子设备,包括:处理器、存储器;所述存储器用于存储一个或多个程序;
    当所述一个或多个程序被所述处理器执行时,实现如权利要求1-11任一项所述的方法。
  25. 一种计算机可读介质,其上存储有计算机程序,所述计算机程序被执行时,实现如权利要求1-11任一项所述的方法。
PCT/CN2018/122297 2018-04-12 2018-12-20 页面数据采集的方法、装置、服务器、电子设备及计算机可读介质 WO2019196498A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US16/474,478 US11538046B2 (en) 2018-04-12 2018-12-20 Page data acquisition method, apparatus, server, electronic device and computer readable medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810328622.5 2018-04-12
CN201810328622.5A CN109739717B (zh) 2018-04-12 2018-04-12 一种页面数据采集的方法及装置、服务器

Publications (1)

Publication Number Publication Date
WO2019196498A1 true WO2019196498A1 (zh) 2019-10-17

Family

ID=66354398

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/122297 WO2019196498A1 (zh) 2018-04-12 2018-12-20 页面数据采集的方法、装置、服务器、电子设备及计算机可读介质

Country Status (3)

Country Link
US (1) US11538046B2 (zh)
CN (1) CN109739717B (zh)
WO (1) WO2019196498A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114374663A (zh) * 2022-01-10 2022-04-19 维沃移动通信有限公司 消息处理方法和消息处理装置
CN114816204A (zh) * 2021-01-27 2022-07-29 北京猎户星空科技有限公司 智能机器人的控制方法、控制装置、控制设备及存储介质
CN116089256A (zh) * 2022-05-13 2023-05-09 荣耀终端有限公司 终端测试方法、装置及存储介质

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110245046B (zh) * 2019-05-29 2023-05-02 吉旗(成都)科技有限公司 一种针对Android App无埋点的数据统计方法及装置
CN110515679B (zh) * 2019-08-28 2023-09-19 北京思维造物信息科技股份有限公司 数据采集方法、装置、设备及存储介质
CN113127851A (zh) * 2020-01-16 2021-07-16 北京沃东天骏信息技术有限公司 数据收集方法和装置
CN111523074A (zh) * 2020-04-26 2020-08-11 成都思维世纪科技有限责任公司 一种前端渲染网站的动态页面敏感数据的采集系统
CN112102008A (zh) * 2020-09-25 2020-12-18 中国建设银行股份有限公司 一种可配置化的用户行为采集方法及装置
CN112463519A (zh) * 2020-11-05 2021-03-09 广州博恒信息科技有限责任公司 基于Flutter的页面使用行为数据无埋点统计方法、设备及存储介质
CN112560090B (zh) * 2020-12-15 2023-01-24 建信金融科技有限责任公司 一种数据检测方法和装置
CN112787892B (zh) * 2021-02-03 2022-03-25 上海哔哩哔哩科技有限公司 流量数据的统计方法及装置
CN113626111A (zh) * 2021-07-16 2021-11-09 北京澎思科技有限公司 信息获取方法、装置、电子设备及存储介质
CN113742190A (zh) * 2021-09-06 2021-12-03 联想(北京)有限公司 控制方法及电子设备
CN114489830A (zh) * 2021-12-23 2022-05-13 阿里巴巴(中国)有限公司 配置页面操作方法、处理方法和计算设备
CN114489620A (zh) * 2022-01-27 2022-05-13 京东方科技集团股份有限公司 页面配置方法、页面配置系统、电子设备和可读存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100125657A1 (en) * 2008-11-14 2010-05-20 Interpret, Llc System for Collecting Computer Application Usage Data from a Plurality of Client Devices
CN104346276A (zh) * 2013-08-08 2015-02-11 腾讯科技(深圳)有限公司 软件测试的方法及装置
CN106598868A (zh) * 2016-12-24 2017-04-26 上海亿账通互联网科技有限公司 对客户端的应用程序动态埋点的方法及系统
CN106933472A (zh) * 2017-05-20 2017-07-07 南京西桥科技有限公司 一种基于手机app的用户行为数据采集系统及其控制方法
CN107864065A (zh) * 2017-08-16 2018-03-30 上海壹账通金融科技有限公司 无埋点数据采集方法、系统及计算机可读存储介质

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060184410A1 (en) * 2003-12-30 2006-08-17 Shankar Ramamurthy System and method for capture of user actions and use of capture data in business processes
US7577955B2 (en) * 2004-11-04 2009-08-18 Pixar Renderfarm monitoring system
US10637724B2 (en) * 2006-09-25 2020-04-28 Remot3.It, Inc. Managing network connected devices
WO2009043033A2 (en) * 2007-09-28 2009-04-02 Xcerion Aktiebolag Network operating system
CN104408204A (zh) * 2014-12-18 2015-03-11 北京国双科技有限公司 网页页面链接地址的获取方法和装置
US10234953B1 (en) * 2015-09-25 2019-03-19 Google Llc Cross-device interaction through user-demonstrated gestures
US10512053B2 (en) * 2016-05-10 2019-12-17 Servicenow, Inc. System and method for selectively hibernating and restarting a node of an application instance
CN106100908B (zh) * 2016-08-16 2024-02-20 南京航空航天大学 一种稳定的通用型数据状态采集兼远程监控多功能系统
CN106776247B (zh) * 2016-11-23 2020-07-14 腾云天宇科技(北京)有限公司 一种监控应用中控件的方法、服务器及系统
CN107800757B (zh) * 2017-03-28 2020-10-27 平安壹钱包电子商务有限公司 用户行为记录方法及装置
CN107491488B (zh) * 2017-07-18 2020-05-01 北京京东尚科信息技术有限公司 页面数据采集的方法和装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100125657A1 (en) * 2008-11-14 2010-05-20 Interpret, Llc System for Collecting Computer Application Usage Data from a Plurality of Client Devices
CN104346276A (zh) * 2013-08-08 2015-02-11 腾讯科技(深圳)有限公司 软件测试的方法及装置
CN106598868A (zh) * 2016-12-24 2017-04-26 上海亿账通互联网科技有限公司 对客户端的应用程序动态埋点的方法及系统
CN106933472A (zh) * 2017-05-20 2017-07-07 南京西桥科技有限公司 一种基于手机app的用户行为数据采集系统及其控制方法
CN107864065A (zh) * 2017-08-16 2018-03-30 上海壹账通金融科技有限公司 无埋点数据采集方法、系统及计算机可读存储介质

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114816204A (zh) * 2021-01-27 2022-07-29 北京猎户星空科技有限公司 智能机器人的控制方法、控制装置、控制设备及存储介质
CN114816204B (zh) * 2021-01-27 2024-01-26 北京猎户星空科技有限公司 智能机器人的控制方法、控制装置、控制设备及存储介质
CN114374663A (zh) * 2022-01-10 2022-04-19 维沃移动通信有限公司 消息处理方法和消息处理装置
CN114374663B (zh) * 2022-01-10 2024-04-12 维沃移动通信有限公司 消息处理方法和消息处理装置
CN116089256A (zh) * 2022-05-13 2023-05-09 荣耀终端有限公司 终端测试方法、装置及存储介质
CN116089256B (zh) * 2022-05-13 2024-03-12 荣耀终端有限公司 终端测试方法、装置及存储介质

Also Published As

Publication number Publication date
US20200357007A1 (en) 2020-11-12
CN109739717A (zh) 2019-05-10
US11538046B2 (en) 2022-12-27
CN109739717B (zh) 2021-01-26

Similar Documents

Publication Publication Date Title
WO2019196498A1 (zh) 页面数据采集的方法、装置、服务器、电子设备及计算机可读介质
CN110971655B (zh) 离线客户端重放和同步
US20140137006A1 (en) Graphical Overlay Related To Data Mining And Analytics
CN110309005B (zh) 一种功能调用方法、装置、终端设备及存储介质
WO2021031688A1 (zh) 业务参数采集方法、装置、计算机设备和存储介质
US20150227566A1 (en) Content Display Device, Content Display System, Data Structure, Content Display Method, and Content Display Program
US20150180911A1 (en) Feedback channel for feedback from software
CN110874307A (zh) 事件埋点的收集上报方法和装置
JPWO2013175560A1 (ja) 情報通信システム及び情報変換方法
US20140006000A1 (en) Built-in response time analytics for business applications
US20120311538A1 (en) Capturing Rich Actionable Feedback on Working Software
CN110188308B (zh) 客户端自动打点上报方法、存储介质、设备及系统
CN112817817B (zh) 埋点信息查询方法、装置、计算机设备和存储介质
US11693909B2 (en) Data sharing tool for facilitating real-time access to current or updated datasets
CN114443905A (zh) 接口文档更新方法、装置、电子设备及可读存储介质
KR101865343B1 (ko) 웹 서비스 애플리케이션 개발을 위한 서버측 프레임워크 장치, 이에 의해 개발된 웹 서비스 애플리케이션의 실행 방법 및 이를 위한 컴퓨터 프로그램
JP5393242B2 (ja) データ提供方法および中間サーバ装置
CN113515715B (zh) 埋点事件编码的生成方法、处理方法及相关设备
CN111435326A (zh) 一种分析崩溃日志的方法和装置
CN114185795A (zh) 埋点配置方法、装置、电子设备及存储介质
KR101950074B1 (ko) 복수의 오픈 api로부터 통합적인 데이터 수집방법
CN114185845A (zh) 一种文件管理方法、装置、计算机设备及存储介质
JP5835447B2 (ja) 情報処理装置、情報処理システム、制御方法、およびプログラム
CN112306324B (zh) 信息处理方法、装置、设备和介质
TWI576710B (zh) 預載關注網頁的啓動方法以及系統

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18914038

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18914038

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 21.01.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 18914038

Country of ref document: EP

Kind code of ref document: A1