CN113282865A - Page access data acquisition method and device - Google Patents

Page access data acquisition method and device Download PDF

Info

Publication number
CN113282865A
CN113282865A CN202110703900.2A CN202110703900A CN113282865A CN 113282865 A CN113282865 A CN 113282865A CN 202110703900 A CN202110703900 A CN 202110703900A CN 113282865 A CN113282865 A CN 113282865A
Authority
CN
China
Prior art keywords
page
access data
callback
page access
life cycle
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.)
Pending
Application number
CN202110703900.2A
Other languages
Chinese (zh)
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.)
Guangdong Huanwang Technology Co Ltd
Original Assignee
Guangdong Huanwang 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 Guangdong Huanwang Technology Co Ltd filed Critical Guangdong Huanwang Technology Co Ltd
Priority to CN202110703900.2A priority Critical patent/CN113282865A/en
Publication of CN113282865A publication Critical patent/CN113282865A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • G06F16/986Document structures and storage, e.g. HTML extensions

Abstract

The page access data acquisition method comprises a registration callback method, wherein the callback method is used for calling back a life cycle function, when a page is opened, a first life cycle function is called back through the callback method to acquire first page access data, and when the page is closed, a second life cycle function is called back through the callback method to acquire second page access data. The method and the device for counting the page access data do not invade the source code of each page, can realize counting page access data in the APP, do not influence the running state of the original APP, and improve user experience.

Description

Page access data acquisition method and device
Technical Field
The application belongs to the field of computer technology, and particularly relates to a page access data acquisition method and device.
Background
The page access data of the APP (Application) is collected and analyzed, so that the preference of a user can be confirmed, and the APP can be better improved. At present, the existing website analysis tool realizes acquisition of mobile phone website access data by recording user browsing behaviors, and provides various statistical analysis services such as flow trend, source analysis, conversion tracking, page thermodynamic diagram, access flow and the like, so as to help enterprises to perfect APP better and create benefits. In the related technology, the page access data is acquired by dotting inside the software code of the APP, but the mode can invade the software code inside the APP, so that the acquisition process is complicated, the running speed of the code can be reduced, and the user experience is influenced.
Disclosure of Invention
In order to overcome the correlation technique at least to a certain extent, through getting page access data by dotting inside the software code of APP, this kind of mode can invade the inside software code of APP, not only causes the collection process loaded down with trivial details, still can reduce code running speed, influences user experience's problem, and this application provides a page access data acquisition method and device.
In a first aspect, the present application provides a method for acquiring page access data, including:
registering a callback method, wherein the callback method is used for calling back a life cycle function;
when a page is opened, calling back a first life cycle function through the call-back method to acquire first page access data;
and when the page is closed, calling back the second life cycle function through the call-back method to acquire second page access data.
Further, the first life cycle function includes:
OnStart function.
Further, the first page access data includes: the page path and page open time are accessed.
Further, the second lifecycle function, comprises:
OnStop function.
Further, the second page access data includes: a page path and a page close time are accessed.
Further, the method also comprises the following steps:
and calculating the retention time of the page according to the page opening time and the page closing time.
Further, the method also comprises the following steps:
after entering the APP, storing the access page path into a linked list of the APP;
and when exiting the APP, reporting the data in the linked list, the corresponding page opening time and the page closing time to a data analysis platform.
Further, the registration callback method includes:
the callback method, registeractive lifecyclecallbacks, is registered in the OnCreate () method through the callback interface ActivityLifecycleCallbacks.
In a second aspect, the present application provides a page access data collecting apparatus, including:
the registration module is used for registering a callback method, and the callback method is used for calling back a life cycle function;
the first callback module is used for calling back a first life cycle function by the callback method to acquire first page access data when a page is opened;
and the second callback module is used for calling back the second life cycle function by the callback method to acquire the second page access data when the page is closed.
The technical scheme provided by the embodiment of the application can have the following beneficial effects:
according to the page access data acquisition method and device provided by the embodiment of the invention, the callback method is used for calling back the life cycle function through the registration callback method, the first life cycle function is called back through the callback method to acquire the first page access data when the page is opened, and the second life cycle function is called back through the callback method to acquire the second page access data when the page is closed, so that the source code of each page is not invaded, the page access data in the APP can be counted, the running state of the original APP is not influenced, and the user experience is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
Fig. 1 is a flowchart of a page access data collection method according to an embodiment of the present application.
Fig. 2 is a flowchart of a page access data collection method according to another embodiment of the present application.
Fig. 3 is a functional block diagram of a page access data acquisition apparatus according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail below. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the examples given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is a flowchart of a page access data acquisition method according to an embodiment of the present application, and as shown in fig. 1, the page access data acquisition method includes:
s11: registering a callback method, wherein the callback method is used for calling back a life cycle function;
s12: when a page is opened, a first life cycle function is called back through a call-back method so as to acquire first page access data;
s13: and when the page is closed, calling back the second life cycle function through a call-back method so as to acquire second page access data.
In the related technology, the method for acquiring the page access data is to obtain the page access data by dotting inside the software code of the APP, but the method can invade the software code inside the APP, so that the acquisition process is complicated, the code running speed can be reduced, and the user experience is influenced.
In the embodiment, the callback method is used for calling back the lifecycle function, when the page is opened, the first lifecycle function is called back by the callback method to acquire the first page access data, and when the page is closed, the second lifecycle function is called back by the callback method to acquire the second page access data, so that the source code of each page is not invaded, the statistics of the page access data in the APP can be realized, the running state of the original APP cannot be influenced, and the user experience is improved.
Fig. 2 is a flowchart of a page access data acquisition method according to an embodiment of the present application, and as shown in fig. 2, the page access data acquisition method includes:
s21: registering a callback method, namely, a register activtyflifecyclecallbacks, in the onCreate () method through a callback interface activtyflifecyclecallbacks, wherein the callback method is used for calling back a life cycle function;
s22: when a page is opened, an OnStart function is called back through a callback method so as to acquire a path of the page to be accessed and the opening time of the page;
s23: when the page is closed, the OnStop function is called back through a callback method to collect the path of the page to be accessed and the closing time of the page.
S24: calculating the retention time of the page according to the page opening time and the page closing time;
s25: after entering the APP, storing the access page path into a linked list of the APP;
s26: and when exiting the APP, reporting the data in the linked list, the corresponding page opening time and the page closing time to a data analysis platform.
Therefore, the data analysis platform analyzes the user preference according to the page access data, and perfects the APP according to the user preference.
In the embodiment, after the APP is entered, the access page path is stored in the chain table of the APP, when the APP exits, the data in the chain table, the corresponding page open time and the page close time are reported to the data analysis platform, the page dwell time is calculated according to the page open time and the page close time, the statistics on the dwell time of the page access path and each page in the APP can be realized, the running state of the original APP cannot be influenced, and the user experience is improved.
An embodiment of the present invention provides a page access data acquisition apparatus, as shown in a functional structure diagram of fig. 3, where the page access data acquisition apparatus includes:
a registration module 31, configured to register a callback method, where the callback method is used to callback a lifecycle function;
the first callback module 32 is used for calling back the first life cycle function by a callback method to acquire first page access data when a page is opened;
and the second callback module 33 is configured to, when the page is closed, callback the second lifecycle function by a callback method to collect second page access data.
In the embodiment, the registration module is used for registering the callback method, the callback method is used for calling back the life cycle function, the first callback module is used for calling back the first life cycle function by the callback method to acquire the first page access data when the page is opened, the second callback module is used for calling back the second life cycle function by the callback method to acquire the second page access data when the page is closed, the source code of each page is not invaded, the statistics of the page access data in the APP can be realized, the running state of the original APP cannot be influenced, and the user experience is improved.
It is understood that the same or similar parts in the above embodiments may be mutually referred to, and the same or similar parts in other embodiments may be referred to for the content which is not described in detail in some embodiments.
It should be noted that, in the description of the present application, the terms "first", "second", etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. Further, in the description of the present application, the meaning of "a plurality" means at least two unless otherwise specified.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and the scope of the preferred embodiments of the present application includes other implementations in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional component mode. The integrated module, if implemented in the form of a software functional component and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.
It should be noted that the present invention is not limited to the above-mentioned preferred embodiments, and those skilled in the art can obtain other products in various forms without departing from the spirit of the present invention, but any changes in shape or structure can be made within the scope of the present invention with the same or similar technical solutions as those of the present invention.

Claims (9)

1. A method for acquiring page access data is characterized by comprising the following steps:
registering a callback method, wherein the callback method is used for calling back a life cycle function;
when a page is opened, calling back a first life cycle function through the call-back method to acquire first page access data;
and when the page is closed, calling back the second life cycle function through the call-back method to acquire second page access data.
2. The method of claim 1, wherein the first lifecycle function, comprises:
OnStart function.
3. The method of claim 1, wherein the first page access data comprises: the page path and page open time are accessed.
4. The method for collecting page access data of claim 1, wherein said second lifecycle function comprises:
OnStop function.
5. The method of claim 3, wherein the second page access data comprises: a page path and a page close time are accessed.
6. The method for collecting page access data of claim 5, further comprising:
and calculating the retention time of the page according to the page opening time and the page closing time.
7. The page access data collection method of claim 3 or 5, further comprising:
after entering the APP, storing the access page path into a linked list of the APP;
and when exiting the APP, reporting the data in the linked list, the corresponding page opening time and the page closing time to a data analysis platform.
8. The method for collecting page access data according to claim 1, wherein said registration callback method comprises:
the callback method, registeractive lifecyclecallbacks, is registered in the OnCreate () method through the callback interface ActivityLifecycleCallbacks.
9. A page access data collection apparatus, comprising:
the registration module is used for registering a callback method, and the callback method is used for calling back a life cycle function;
the first callback module is used for calling back a first life cycle function by the callback method to acquire first page access data when a page is opened;
and the second callback module is used for calling back the second life cycle function by the callback method to acquire the second page access data when the page is closed.
CN202110703900.2A 2021-06-24 2021-06-24 Page access data acquisition method and device Pending CN113282865A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110703900.2A CN113282865A (en) 2021-06-24 2021-06-24 Page access data acquisition method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110703900.2A CN113282865A (en) 2021-06-24 2021-06-24 Page access data acquisition method and device

Publications (1)

Publication Number Publication Date
CN113282865A true CN113282865A (en) 2021-08-20

Family

ID=77285404

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110703900.2A Pending CN113282865A (en) 2021-06-24 2021-06-24 Page access data acquisition method and device

Country Status (1)

Country Link
CN (1) CN113282865A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105740028A (en) * 2016-03-03 2016-07-06 北京金山安全软件有限公司 Access control method and device
CN106444579A (en) * 2016-10-09 2017-02-22 鼎点视讯科技有限公司 Spectrum data multiplexing system and method
US20170212775A1 (en) * 2016-01-25 2017-07-27 International Business Machines Corporation Program execution without the use of bytecode modification or injection
CN109284470A (en) * 2018-10-25 2019-01-29 天津字节跳动科技有限公司 Page window communication means and device
CN111782490A (en) * 2019-04-04 2020-10-16 北京奇虎科技有限公司 Data acquisition method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170212775A1 (en) * 2016-01-25 2017-07-27 International Business Machines Corporation Program execution without the use of bytecode modification or injection
CN105740028A (en) * 2016-03-03 2016-07-06 北京金山安全软件有限公司 Access control method and device
CN106444579A (en) * 2016-10-09 2017-02-22 鼎点视讯科技有限公司 Spectrum data multiplexing system and method
CN109284470A (en) * 2018-10-25 2019-01-29 天津字节跳动科技有限公司 Page window communication means and device
CN111782490A (en) * 2019-04-04 2020-10-16 北京奇虎科技有限公司 Data acquisition method and device

Similar Documents

Publication Publication Date Title
CN103136471B (en) A kind of malice Android application program detection method and system
CN110674408B (en) Service platform, and real-time generation method and device of training sample
EP2609501B1 (en) Dynamic calculation of sample profile reports
CN105930247A (en) Method, device and mobile terminal for processing problem of system restart
CN106484915B (en) A kind of cleaning method and system of mass data
CN102622238A (en) Method and device for interface layout of mobile devices
CN106354797A (en) Data recommendation method and device
CN106126592B (en) Processing method and device for search data
CN110399377A (en) Optimization method, device, electronic equipment and the computer readable storage medium of SQL
CN110377821A (en) Generate method, apparatus, computer equipment and the storage medium of interest tags
CN109634822A (en) A kind of function time-consuming statistical method, device, storage medium and terminal device
CN110599004A (en) Risk control method, equipment, medium and device
CN109918547A (en) A kind of database session management method and device
CN113282865A (en) Page access data acquisition method and device
CN110968483B (en) Service data acquisition method and device and electronic equipment
CN109039695B (en) Service fault processing method, device and equipment
CN115456801B (en) Artificial intelligence big data wind control system, method and storage medium for personal credit
CN110334909B (en) Risk management and control method, device and equipment
CN111461542A (en) Event statistical method and device
CN110147405A (en) A kind of monitoring method based on pedestal O&M, device, equipment and storage medium
CN115564450B (en) Wind control method, device, storage medium and equipment
CN112465075B (en) Metadata management method and system
CN117557157B (en) Quality assessment and evaluation method based on convolutional neural network
CN112165456B (en) Hijacking flow identification method and device and electronic equipment
CN112817948B (en) Data detection method and device, readable 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