CN111338885A - Dynamic collection and statistical method and device of APP data and data service center - Google Patents

Dynamic collection and statistical method and device of APP data and data service center Download PDF

Info

Publication number
CN111338885A
CN111338885A CN201811561882.3A CN201811561882A CN111338885A CN 111338885 A CN111338885 A CN 111338885A CN 201811561882 A CN201811561882 A CN 201811561882A CN 111338885 A CN111338885 A CN 111338885A
Authority
CN
China
Prior art keywords
data
indication
operation event
app
receiving
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
CN201811561882.3A
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.)
Qianxun Spatial Intelligence Inc
Qianxun Position Network Co Ltd
Original Assignee
Qianxun Spatial Intelligence Inc
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 Qianxun Spatial Intelligence Inc filed Critical Qianxun Spatial Intelligence Inc
Priority to CN201811561882.3A priority Critical patent/CN111338885A/en
Publication of CN111338885A publication Critical patent/CN111338885A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/3089Monitoring arrangements determined by the means or processing involved in sensing the monitored data, e.g. interfaces, connectors, sensors, probes, agents

Abstract

The invention is suitable for the technical field of data service, and provides a dynamic collection and statistical method and a device of APP data and a data service center, wherein the dynamic collection method comprises the following steps: receiving an APP data collection instruction, wherein the instruction carries an operation event; injecting an interception code corresponding to the operational event based on the indication; receiving data configuration corresponding to the indication and issued by a background server; when the operational event is generated, corresponding data is collected based on the data configuration. In the invention, the interception code is injected according to the operation event carried by the collection instruction, and when the operation event is generated, the corresponding data is collected immediately, so that the realization process is simple.

Description

Dynamic collection and statistical method and device of APP data and data service center
Technical Field
The invention belongs to the technical field of communication, and particularly relates to a method and a device for dynamically collecting and counting APP data and a data service center.
Background
The Android (Android) system has the advantages of simplicity in operation, multiple mobile phones, free majority, open platforms and the like, and is widely applied to electronic products such as tablet computers, televisions, smart phones, printers and vehicle navigation.
With the explosion of mobile internet, various mobile phone application clients (hereinafter abbreviated as APP) appear in our mobile phones. At present, most of APPs in the application market need network interaction, and the performance of the network interaction directly influences the user experience of the APP. Therefore, only by knowing network performance data of APP used in various regions throughout the country or even throughout the world can a method for improving APP user experience be found.
The behavior statistical analysis of a user is an important component for carrying out APP operation guidance, the data statistics of APP is a premise and a foundation, in the prior art, some open source frameworks can carry out data collection statistics, but manual point burying is usually required, and the invasion to codes is strong; in addition, revising the statistical data is needed, and the process is complicated.
Disclosure of Invention
The embodiment of the invention provides a method and a device for dynamically collecting and counting APP data and a data service center, and aims to solve the problem that the process of modifying data collection configuration is complex in the prior art.
A method for dynamically collecting APP data, comprising:
receiving an APP data collection instruction, wherein the instruction carries an operation event;
injecting an interception code corresponding to the operational event based on the indication;
receiving data configuration corresponding to the indication and issued by a background server;
when the operational event is generated, corresponding data is collected based on the data configuration.
Preferably, the APP data is based on an Android system, and injecting the interception code corresponding to the operation event based on the indication is specifically:
injecting an interception code corresponding to the operation event based on the indication after forming the class file.
Preferably, the interception code comprises: page code and/or event code, wherein injecting interception code corresponding to the operation event based on the indication after forming a class file comprises:
after a class file is formed and before an APK is not formed, traversing the type of a currently input file to obtain a target file, wherein the type of the target file is ended by the class;
and injecting a corresponding interception code into the target file according to the type of the target file.
Preferably, when the operational event is generated, collecting corresponding data based on the data configuration comprises:
when an operation event is generated, judging whether data needs to be collected currently;
and when the operation event is judged to be yes, collecting corresponding data according to the type of the operation event and the data configuration.
Preferably, the data configuration includes: page names and corresponding data descriptions.
Preferably, when an operation event is generated, the determining whether data collection is currently required specifically includes:
when an operation event is generated, judging whether the current page name is matched with the page name in the configuration data;
and when the judgment result is yes, determining that the data needs to be collected currently.
The invention also provides a device for dynamically collecting APP data, which comprises:
a first receiving unit for receiving an indication of APP data collection;
an injection unit for injecting an interception code based on the indication;
the second receiving unit is used for receiving data configuration corresponding to the indication and issued by the background server;
and the collecting unit is used for collecting corresponding data based on the data configuration when the operation event is generated.
The invention also provides an Android system, which comprises a dynamic collection device for APP data, wherein the dynamic collection device comprises:
a first receiving unit for receiving an indication of APP data collection;
an injection unit for injecting an interception code based on the indication;
the second receiving unit is used for receiving data configuration corresponding to the indication and issued by the background server;
and the collecting unit is used for collecting corresponding data based on the data configuration when the operation event is generated.
The invention also provides a statistical method of the APP data, which comprises the following steps:
receiving an indication of APP data collection;
injecting an interception code based on the indication;
receiving data configuration corresponding to the indication and issued by a background server;
when an operation event is generated, collecting corresponding data based on the data configuration;
statistics are performed on the collected data.
The invention also provides a statistical device of APP data, comprising:
an indication receiving unit for receiving an indication of APP data collection;
a code injection unit for injecting an interception code based on the indication;
the configuration receiving unit is used for receiving data configuration corresponding to the indication and issued by the background server;
the data collection unit is used for collecting corresponding data based on the data configuration when an operation event is generated;
and the data counting unit is used for counting the collected data.
The invention also provides a data service center, which comprises an APP data statistical device and a background server,
the background server is used for configuring data based on the indication;
the statistical device comprises:
an indication receiving unit for receiving an indication of APP data collection;
a code injection unit for injecting an interception code based on the indication;
the configuration receiving unit is used for receiving data configuration corresponding to the indication and issued by the background server;
the data collection unit is used for collecting corresponding data based on the data configuration when an operation event is generated;
and the data counting unit is used for counting the collected data.
The invention also provides a memory storing a computer program executed by a processor to perform the steps of:
receiving an APP data collection instruction, wherein the instruction carries an operation event;
injecting an interception code corresponding to the operational event based on the indication;
receiving data configuration corresponding to the indication and issued by a background server;
when the operational event is generated, corresponding data is collected based on the data configuration.
The invention also provides a service terminal, which comprises a memory, a processor and a computer program which is stored in the memory and can run on the processor, wherein the processor executes the computer program to realize the following steps:
receiving an APP data collection instruction, wherein the instruction carries an operation event;
injecting an interception code corresponding to the operational event based on the indication;
receiving data configuration corresponding to the indication and issued by a background server;
when the operational event is generated, corresponding data is collected based on the data configuration.
In the embodiment of the invention, the interception codes are injected according to the operation events carried by the collection instructions, and when the operation events are generated, the corresponding data are collected immediately, so that the implementation process is simple.
Drawings
Fig. 1 is a flowchart of a method for dynamically collecting APP data according to a first embodiment of the present invention;
fig. 2 is a flowchart illustrating a step S2 of a method for dynamically collecting APP data according to a first embodiment of the present invention;
fig. 3 is a flowchart illustrating a step S4 of a method for dynamically collecting APP data according to a first embodiment of the present invention;
fig. 4 is a structural diagram of an apparatus for dynamically collecting APP data according to a second embodiment of the present invention;
fig. 5 is a flowchart of an APP data statistical method according to a third embodiment of the present invention;
fig. 6 is a structural diagram of an APP data statistics apparatus according to a fourth embodiment of the present invention;
fig. 7 is a structural diagram of a service terminal according to a sixth embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In an embodiment of the present invention, a method for dynamically collecting APP data includes: receiving an indication of APP data collection; injecting an interception code based on the indication; receiving data configuration corresponding to the indication and issued by a background server; when an operational event is generated, corresponding data is collected based on the data configuration. In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
The first embodiment is as follows:
fig. 1 shows a flowchart of a dynamic collection method of APP data according to a first embodiment of the present invention, where the dynamic collection method includes:
step S1, receiving an indication of APP data collection;
specifically, when there is a new demand in APP operation, for example, statistical analysis needs to be performed on some data of the APP, data collection needs to be performed first, and then an instruction for data collection is sent, and the data collection needs to be performed in a buried processing manner, where the instruction for the data handset may include a type of data, a page name, an operation event, and the like.
Step S2, injecting an interception code corresponding to the operation event based on the instruction;
specifically, after receiving an instruction for data collection, it needs to perform a point burying process, and in this embodiment, an interception code corresponding to the operation event is injected based on the instruction, so as to achieve the purpose of point burying;
step S3, receiving data configuration corresponding to the indication sent by the background server;
specifically, after the operator initiates the data collection instruction, the background server converts the data to a corresponding format (i.e. data configuration) according to the needs of the embedded point (the location of the embedded point and the data to be collected) according to a predetermined protocol, for example: the user name needs to be uploaded when a certain button is clicked, and then the corresponding format is:
PageName:com.xx.xx/MainActivity
ViewPath:DecorView/.../ButtonFragment[0]/Button[0]
DataPath:this.context.mName
EventType:EventTypeClick;
and then the android system sends the format data to the background service development for issuing, so that corresponding data collection can be carried out after the data format is received. The data configuration may include: the name of the page and the corresponding data description.
Step S4, when an operation event is generated, collecting corresponding data based on data configuration;
specifically, when an operation event corresponding to a data configuration is generated, corresponding data is collected based on the aforementioned data configuration.
In this embodiment, the interception code is injected according to the operation event carried by the collection instruction, and when the operation event occurs, the corresponding data is collected immediately, so that the implementation process is simple.
In a preferable embodiment of this embodiment, the step S3 may further include:
a data protocol is preset;
specifically, a protocol of data to be collected needs to be formulated in advance, and when a certain operation event is generated on a page, a data burying point aims to know certain data related to the page currently, for example, when a certain button for adding a shopping cart is clicked, the current commodity price needs to be known, so that the contents of two parts need to be known for performing data statistics: the name and data description of the current page are mainly used for establishing a data protocol around the two aspects:
first, the view description, which contains two parts, first the name of the current page, PageName: the package name/class name and then the position of the view in the current page, wherein the page in the android is a tree structure, different layers are used/separated, and the same layer is marked by using serial numbers. For example:
ViewPath:DecorView/.../ViewPager[0]/ButtonFragment[0]/AppCompatButton[0]
next is data description, the role of which is to collect data according to the current description, (when the description is matched, data is collected according to this path) such as the following data path: context, demoList [5], where this refers to the current view, i.e. the view clicked, then obtain the current context, then use reflection to obtain the attribute field demoList, and finally obtain the 5 th element of demoList, as shown in table 1, the explanation of the keyword in the path is described above.
TABLE 1
Figure BDA0001913030230000071
In a preferred embodiment of this embodiment, the APP data is implemented under an Android system based on the Android system, and the interception code (embedded point code) includes: the page codes and/or event codes, namely the embedded points are divided into page embedded points and event embedded points, and the page embedded points mainly count the times of a user entering a certain page and stay in the page for a certain time. The event embedding points are mainly used for counting user data when a user clicks a certain control, such as a certain commodity price, a commodity name, a user type and the like. The page burying point is mainly to inject codes in the lifecycle method of activity or fragment, and the event burying point is mainly to aop all click events and to inject interception codes.
Further, the step S2 specifically includes: injecting an interception code corresponding to the operation event based on the indication after the class file is formed;
as shown in fig. 2, a detailed flowchart of step S2 of a dynamic APP data collection method according to a first embodiment of the present invention is provided, where the step S2 specifically includes:
step S21, after the class file is formed and before the APK is not formed, traversing the type of the currently input file to obtain a target file;
specifically, after the class file is formed and before the APK is not formed, the type of the currently input file is traversed to obtain a target file, and the type of the target file is finished by class.
Step S22, injecting corresponding interception codes into the target file according to the type of the target file;
specifically, the packaging process in the android system is as follows: the method comprises the steps of enabling java files- > classes files- > apk, injecting interception codes in the classes files- > apk, inputting files in a compilation plug-in gram of an Android system by using a transform method, then outputting the files after self-defining, and injecting the interception codes in the process.
In this embodiment, first, the type of the input file is traversed, whether the type ends in class is judged, then whether the type is activity or fragment is judged, if yes, the class needs to be intercepted is explained, and then, how to inject the code is shown below:
page code injection: using reflection to check whether an onResume method and an onPause method exist in an interception class, if so, using a bytecode modification tool javaassist or ASM to modify the class file, adding a monitor.enter () and a monitor.exit (), if not, using javaassist or ASM to add the onResume method and the onPause method first, and then adding an injection code;
event code injection: using reflection, find all onClick methods in the intercept class, still use bytecode modification tools to inject event codes, monitor.
In a preferred embodiment of this embodiment, as shown in fig. 3, a specific flowchart of step S4 of a method for dynamically collecting APP data according to a first embodiment of the present invention is provided, where the step S4 specifically includes:
step S41, when an operation event is generated, judging whether data collection is needed currently;
specifically, when an operation event is generated, first, it is determined whether data needs to be collected on the current page, preferably, it is determined whether the current page name matches a page name in the configuration data, and if so, it is determined that data needs to be collected on the current page, and then, the process goes to step S42; if not, determining that data does not need to be collected on the current page, turning to step S43, stopping the process, and continuing to determine whether the current page needs to collect data when turning to the next interface.
Step S42, when the judgment is yes, collecting corresponding data according to the type and data configuration of the operation event;
specifically, if data needs to be collected on the current page, the data is collected according to the type of the operation event and the corresponding data configuration;
for example: when the operation event is a page operation event (page code), that is, the operation event is an EventTypePage, which indicates that a page is a buried point, and the data to be collected is a page name and a dwell time in the page, the current page name and the entry and exit times are acquired and then stored locally.
If the operation event is a page click type event (event code), that is, the operation event is eventtecclick: if the type indicates a click type event, the page needs related data, whether the event generated by the current view click needs to be collected is judged according to the corresponding view description, and if the event needs to be collected, the data is acquired according to the corresponding data path to be locally stored (stored in the APP).
Step S43, ending the process;
specifically, if the current page does not need to be collected, the process is ended, and when the current page is changed to the next interface, whether the current page needs to collect data is continuously judged.
In a preferable embodiment of this embodiment, after step S4, the method further includes:
uploading the collected data to a server;
specifically, when the corresponding APP is re-entered, or every period of time, the data stored in the APP is uploaded to the server for storage through the thread of the background server.
In this embodiment, the interception code is injected according to the operation event carried by the collection instruction, and when the operation event occurs, the corresponding data is collected immediately, so that the implementation process is simple.
Secondly, after the class file is formed, the interception code is injected by utilizing the gradle plug-in, the code does not need to be manually modified in the java file, a new version does not need to be released, and the process is simplified.
Example two:
based on the first embodiment, as shown in fig. 4, a structure diagram of an apparatus for dynamically collecting APP data according to a second embodiment of the present invention is provided, where the apparatus includes: a first receiving unit 1, an injection unit 2 connected to the first receiving unit 1, a second receiving unit 3 connected to the injection unit 2, a collecting unit 4 connected to the second receiving unit 3, wherein:
a first receiving unit 1 for receiving an indication of APP data collection;
specifically, when there is a new demand in APP operation, for example, statistical analysis needs to be performed on some data of the APP, data collection needs to be performed first, and then an instruction for data collection is sent, and the data collection needs to be performed in a buried processing manner, where the instruction for the data handset may include a type of data, a page name, an operation event, and the like.
An injection unit 2 for injecting an interception code corresponding to the operation event based on the instruction;
specifically, after receiving an instruction for data collection, it needs to perform a point burying process, and in this embodiment, an interception code corresponding to the operation event is injected based on the instruction, so as to achieve the purpose of point burying;
the second receiving unit 3 is configured to receive data configuration corresponding to the indication sent by the background server;
specifically, after the operator initiates the data collection instruction, the background server converts the data to a corresponding format (i.e. data configuration) according to the needs of the embedded point (the location of the embedded point and the data to be collected) according to a predetermined protocol, for example: the user name needs to be uploaded when a certain button is clicked, and then the corresponding format is:
PageName:com.xx.xx/MainActivity
ViewPath:DecorView/.../ButtonFragment[0]/Button[0]
DataPath:this.context.mName
EventType:EventTypeClick;
and then the android system sends the format data to the background service development for issuing, so that corresponding data collection can be carried out after the data format is received. The data configuration may include: the name of the page and the corresponding data description.
A collecting unit 4 for collecting corresponding data based on data configuration when an operation event is generated;
specifically, when an operation event corresponding to a data configuration is generated, corresponding data is collected based on the aforementioned data configuration.
In this embodiment, the interception code is injected according to the operation event carried by the collection instruction, and when the operation event occurs, the corresponding data is collected immediately, so that the implementation process is simple.
In a preferable aspect of this embodiment, the collecting device further includes: a formulation unit connected to the second receiving unit 3, wherein:
the formulating unit is used for formulating a data protocol in advance;
specifically, a protocol of data to be collected needs to be formulated in advance, and when a certain operation event is generated on a page, a data burying point aims to know certain data related to the page currently, for example, when a certain button for adding a shopping cart is clicked, the current commodity price needs to be known, so that the contents of two parts need to be known for performing data statistics: the name and data description of the current page are mainly used for establishing a data protocol around the two aspects:
first, the view description, which contains two parts, first the name of the current page, PageName: the package name/class name and then the position of the view in the current page, wherein the page in the android is a tree structure, different layers are used/separated, and the same layer is marked by using serial numbers. For example:
ViewPath:DecorView/.../ViewPager[0]/ButtonFragment[0]/AppCompatButton[0];
next is data description, the role of which is to collect data according to the current description, (when the description is matched, data is collected according to this path) such as the following data path: context, demoList [5], where this refers to the current view, i.e. the view clicked, then obtain the current context, then use reflection to obtain the attribute field demoList, and finally obtain the 5 th element of demoList.
In a preferred embodiment of this embodiment, the APP data is implemented under an Android system based on the Android system, and the interception code (embedded point code) includes: the page codes and/or event codes, namely the embedded points are divided into page embedded points and event embedded points, and the page embedded points mainly count the times of a user entering a certain page and stay in the page for a certain time. The event embedding points are mainly used for counting user data when a user clicks a certain control, such as a certain commodity price, a commodity name, a user type and the like. The page burying point is mainly to inject codes in the lifecycle method of activity or fragment, and the event burying point is mainly to aop all click events and to inject interception codes.
Further, the injection unit 2 is specifically configured to: injecting an interception code corresponding to the operation event based on the indication after the class file is formed;
further, the injection unit 2 specifically includes: an acquisition subunit and an injection subunit connected thereto, wherein:
the acquisition subunit is used for traversing the type of the currently input file after the class file is formed and before the APK is not formed, and acquiring a target file;
specifically, after the class file is formed and before the APK is not formed, the type of the currently input file is traversed to obtain a target file, and the type of the target file is finished by class.
The injection subunit is used for injecting corresponding interception codes into the target file according to the type of the target file;
specifically, the packaging process in the android system is as follows: the method comprises the steps of enabling java files- > classes files- > apk, injecting interception codes in the classes files- > apk, inputting files in a compilation plug-in gram of an Android system by using a transform method, then outputting the files after self-defining, and injecting the interception codes in the process.
In this embodiment, first, the type of the input file is traversed, whether the type ends in class is judged, then whether the type is activity or fragment is judged, if yes, the class needs to be intercepted is explained, and then, how to inject the code is shown below:
page code injection: using reflection to check whether an onResume method and an onPause method exist in an interception class, if so, using a bytecode modification tool javaassist or ASM to modify the class file, adding a monitor.
Event code injection: using reflection, find all onClick methods in the intercept class, still use bytecode modification tools to inject event codes, monitor.
In a preferred aspect of the present embodiment, the collecting unit 4 includes: judge subunit and rather than the processing subunit who connects, wherein:
the judging subunit is used for judging whether data collection is needed currently or not when an operation event is generated;
specifically, when an operation event is generated, firstly, judging whether data needs to be collected on a current page, preferably, judging whether the current page name is matched with a page name in the configuration data, if so, determining that the data needs to be collected on the current page, and feeding back a result to the processing subunit; if not, determining that data do not need to be collected on the current page, ending the process, and continuing to judge whether the current page needs to collect data or not when the next interface is switched to.
The processing subunit is used for collecting corresponding data according to the type of the operation event and the data configuration when the judgment result is yes;
specifically, if data needs to be collected on the current page, the data is collected according to the type of the operation event and the corresponding data configuration;
for example: when the operation event is a page operation event (page code), that is, the operation event is an EventTypePage, which indicates that a page is a buried point, and the data to be collected is a page name and a dwell time in the page, the current page name and the entry and exit times are acquired and then stored locally.
If the operation event is a page click type event (event code), that is, the operation event is eventtecclick: if the type indicates a click type event, the page needs related data, whether the event generated by the current view click needs to be collected is judged according to the corresponding view description, and if the event needs to be collected, the data is acquired according to the corresponding data path to be locally stored (stored in the APP).
In a preferable aspect of this embodiment, the collecting device further includes: an upload unit connected with the collection unit 4, wherein:
the uploading unit is used for uploading the collected data to the server;
specifically, when the corresponding APP is re-entered, or every period of time, the data stored in the APP is uploaded to the server for storage through the thread of the background server.
In this embodiment, the interception code is injected according to the operation event carried by the collection instruction, and when the operation event occurs, the corresponding data is collected immediately, so that the implementation process is simple.
Secondly, after the class file is formed, the interception code is injected by utilizing the gradle plug-in, the code does not need to be manually modified in the java file, a new version does not need to be released, and the process is simplified.
The invention further provides an Android system, which includes the dynamic collection device for APP data described in the second embodiment, and the specific structure, the working principle, and the technical effects of the dynamic collection device are consistent with those described in the second embodiment, and are not described herein again.
Example three:
fig. 5 is a flowchart illustrating a statistical method for APP data according to a third embodiment of the present invention, where the statistical method includes:
step a1, receiving an indication of APP data collection;
specifically, when there is a new demand in APP operation, for example, statistical analysis needs to be performed on some data of the APP, data collection needs to be performed first, and then an instruction for data collection is sent, and the data collection needs to be performed in a buried processing manner, where the instruction for the data handset may include a type of data, a page name, an operation event, and the like.
Step A2, injecting an interception code corresponding to the operation event based on the instruction;
specifically, after receiving an instruction for data collection, it needs to perform a point burying process, and in this embodiment, an interception code corresponding to the operation event is injected based on the instruction, so as to achieve the purpose of point burying;
step A3, receiving data configuration corresponding to the indication sent by the background server;
specifically, after the operator initiates the data collection instruction, the background server converts the data to a corresponding format (i.e. data configuration) according to the needs of the embedded point (the location of the embedded point and the data to be collected) according to a predetermined protocol, for example: the user name needs to be uploaded when a certain button is clicked, and then the corresponding format is:
PageName:com.xx.xx/MainActivity
ViewPath:DecorView/.../ButtonFragment[0]/Button[0]
DataPath:this.context.mName
EventType:EventTypeClick;
and then the android system sends the format data to the background service development for issuing, so that corresponding data collection can be carried out after the data format is received. The data configuration may include: the name of the page and the corresponding data description.
Step A4, when an operation event is generated, collecting corresponding data based on data configuration;
specifically, when an operation event corresponding to a data configuration is generated, corresponding data is collected based on the aforementioned data configuration.
Step A5, counting the collected data;
specifically, the collected data are counted to obtain a statistical result;
in this embodiment, the interception code is injected according to the operation event carried by the collection instruction, and when the operation event occurs, the corresponding data is collected immediately, so that the implementation process is simple.
In this embodiment, the step a3 may further include:
a data protocol is preset;
specifically, a protocol of data to be collected needs to be formulated in advance, and when a certain operation event is generated on a page, a data burying point aims to know certain data related to the page currently, for example, when a certain button for adding a shopping cart is clicked, the current commodity price needs to be known, so that the contents of two parts need to be known for performing data statistics: the name and data description of the current page are mainly used for establishing a data protocol around the two aspects:
first, the view description, which contains two parts, first the name of the current page, PageName: the package name/class name and then the position of the view in the current page, wherein the page in the android is a tree structure, different layers are used/separated, and the same layer is marked by using serial numbers. For example:
ViewPath:DecorView/.../ViewPager[0]/ButtonFragment[0]/AppCompatButton[0]
next is data description, the role of which is to collect data according to the current description, (when the description is matched, data is collected according to this path) such as the following data path: context, demoList [5], where this refers to the current view, i.e. the view clicked, then obtain the current context, then use reflection to obtain the attribute field demoList, and finally obtain the 5 th element of demoList.
In a preferred embodiment of this embodiment, the APP data is implemented under an Android system based on the Android system, and the interception code (embedded point code) includes: the page codes and/or event codes, namely the embedded points are divided into page embedded points and event embedded points, and the page embedded points mainly count the times of a user entering a certain page and stay in the page for a certain time. The event embedding points are mainly used for counting user data when a user clicks a certain control, such as a certain commodity price, a commodity name, a user type and the like. The page burying point is mainly to inject codes in the lifecycle method of activity or fragment, and the event burying point is mainly to aop all click events and to inject interception codes.
In this embodiment, the specific implementation processes of steps a1 to a4 are the same as the specific processes of steps S1 to S4 in the first embodiment, and reference may be made to the description of the above embodiments for details, which are repeated herein.
In this embodiment, the interception code is injected according to the operation event carried by the collection instruction, and when the operation event occurs, the corresponding data is collected immediately, so that the implementation process is simple.
Secondly, after the class file is formed, the grad ] e plug-in is used for injecting the interception code, the code does not need to be manually modified in the java file, a new version does not need to be released, and the process is simplified.
Example four:
as shown in fig. 6, a structure diagram of an APP data statistics apparatus according to a fourth embodiment of the present invention is provided, where the statistics apparatus includes: an indication receiving unit 61, a code injecting unit 62 connected with the indication receiving unit 61, a configuration receiving unit 63 connected with the code injecting unit 62, a data receiving unit 64 connected with the configuration receiving unit 63, a data statistics unit 55 connected with the data receiving unit 64, wherein:
an instruction receiving unit 61 for receiving an instruction of APP data collection;
specifically, when there is a new demand in APP operation, for example, statistical analysis needs to be performed on some data of the APP, data collection needs to be performed first, and then an instruction for data collection is sent, and the data collection needs to be performed in a buried processing manner, where the instruction for the data handset may include a type of data, a page name, an operation event, and the like.
A code injection unit 62 for injecting an interception code corresponding to the operation event based on the instruction;
specifically, after receiving an instruction for data collection, it needs to perform a point burying process, and in this embodiment, an interception code corresponding to the operation event is injected based on the instruction, so as to achieve the purpose of point burying;
a configuration receiving unit 63, configured to receive data configuration corresponding to the indication sent by the background server;
specifically, after the operator initiates the data collection instruction, the background server converts the data to a corresponding format (i.e. data configuration) according to the needs of the embedded point (the location of the embedded point and the data to be collected) according to a predetermined protocol, for example: the user name needs to be uploaded when a certain button is clicked, and then the corresponding format is:
PageName:com.xx.xx/MainActivity
ViewPath:DecorView/.../ButtonFragment[0]/Button[0]
DataPath:this.context.mName
EventType:EventTypeClick;
and then the android system sends the format data to the background service development for issuing, so that corresponding data collection can be carried out after the data format is received. The data configuration may include: the name of the page and the corresponding data description.
A data collection unit 64 for collecting corresponding data based on the data configuration when the operation event is generated;
specifically, when an operation event corresponding to a data configuration is generated, corresponding data is collected based on the aforementioned data configuration;
a data statistic unit 65 for making statistics of the collected data;
specifically, statistics are performed on the collected data;
in this embodiment, the interception code is injected according to the operation event carried by the collection instruction, and when the operation event occurs, the corresponding data is collected immediately, so that the implementation process is simple.
In a preferable aspect of this embodiment, the statistical apparatus further includes: a protocol formulation unit connected to the configuration receiving unit 63, wherein:
the agreement making unit is used for specifically making an agreement of data to be collected in advance, and when a certain operation event is generated on a page, the objective of data burying point is to know certain data related to the page currently, for example, clicking a certain button of an adding shopping cart needs to know the current commodity price, so that the contents of two parts need to be known when data statistics is carried out: the name and data description of the current page are mainly used for establishing a data protocol around the two aspects:
first, the view description, which contains two parts, first the name of the current page, PageName: the package name/class name and then the position of the view in the current page, wherein the page in the android is a tree structure, different layers are used/separated, and the same layer is marked by using serial numbers. For example:
ViewPath:DecorView/.../ViewPager[0]/ButtonFragment[0]/AppCompatButton[0];
next is data description, the role of which is to collect data according to the current description, (when the description is matched, data is collected according to this path) such as the following data path: context, demoList [5], where this refers to the current view, i.e. the view clicked, then obtain the current context, then use reflection to obtain the attribute field demoList, and finally obtain the 5 th element of demoList.
In a preferred embodiment of this embodiment, the APP data is implemented under an Android system based on the Android system, and the interception code (embedded point code) includes: the page codes and/or event codes, namely the embedded points are divided into page embedded points and event embedded points, and the page embedded points mainly count the times of a user entering a certain page and stay in the page for a certain time. The event embedding points are mainly used for counting user data when a user clicks a certain control, such as a certain commodity price, a commodity name, a user type and the like. The page burying point is mainly to inject codes in the lifecycle method of activity or fragment, and the event burying point is mainly to aop all click events and to inject interception codes.
In this embodiment, the specific structures and operating principles of the indication receiving unit 61, the code injecting unit 62, the configuration receiving unit 63, and the data receiving unit 64 are the same as those of the first receiving unit 1, the injecting unit 2, the second receiving unit 3, and the collecting unit 4 described in the second embodiment, and reference may be specifically made to the description of the second embodiment, which is not repeated herein.
In this embodiment, the interception code is injected according to the operation event carried by the collection instruction, and when the operation event occurs, the corresponding data is collected immediately, so that the implementation process is simple.
Secondly, after the class file is formed, the interception code is injected by utilizing the gradle plug-in, the code does not need to be manually modified in the java file, a new version does not need to be released, and the process is simplified.
Example five:
the invention further provides a data service center, which comprises a background server and a statistical device consistent with the APP data, wherein the statistical device is consistent with the detailed structure and the working principle of the statistical device of the APP data described in the fourth embodiment, and the steps are repeated;
the background server is used for configuring data based on the indication;
specifically, the corresponding data configuration is performed according to the collection instruction issued by the operator.
In a preferred embodiment of this embodiment, the data service center further includes a server connected to the background server, where:
a server for storing data, which may be collected data, and/or statistical data. The statistical device uploads the collected data and/or the statistical data through a thread of the background server.
Example six:
fig. 7 is a block diagram illustrating a service terminal according to a sixth embodiment of the present invention, where the service terminal includes: a memory (memory)71, a processor (processor)72, a communication Interface (Communications Interface)73 and a bus 74, wherein the processor 72, the memory 71 and the communication Interface 73 are communicated with each other via the bus 74.
A memory 71 for storing various data;
specifically, the memory 71 is used for storing various data, such as data in communication, received data, and the like, and is not limited herein, and the memory also includes a plurality of computer programs.
A communication interface 73 for information transmission between communication devices of the service terminal;
a processor 72, for calling various computer programs in the memory 71 to execute a method for dynamically collecting APP data provided in the first embodiment, for example:
receiving an APP data collection instruction, wherein the instruction carries an operation event;
injecting an interception code corresponding to the operational event based on the indication;
receiving data configuration corresponding to the indication and issued by a background server;
when the operational event is generated, corresponding data is collected based on the data configuration.
In the embodiment, the interception codes are injected according to the operation events carried by the collection instructions, and when the operation events are generated, corresponding data are collected immediately, so that the implementation process is simple.
The present invention further provides a memory, where the memory stores a plurality of computer programs, and the computer programs are called by the processor to execute a dynamic collection method of APP data according to the first embodiment.
In the invention, the interception code is injected according to the operation event carried by the collection instruction, and when the operation event is generated, the corresponding data is collected immediately, so that the realization process is simple.
Secondly, after the class file is formed, the interception code is injected by utilizing the gradle plug-in, the code does not need to be manually modified in the java file, a new version does not need to be released, and the process is simplified.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation.
Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention. The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (13)

1. A method for dynamically collecting APP data, comprising:
receiving an APP data collection instruction, wherein the instruction carries an operation event;
injecting an interception code corresponding to the operational event based on the indication;
receiving data configuration corresponding to the indication and issued by a background server;
when the operational event is generated, corresponding data is collected based on the data configuration.
2. The dynamic collection method according to claim 1, wherein the APP data is based on an Android system, and the injecting of the interception code corresponding to the operation event based on the indication is specifically:
injecting an interception code corresponding to the operation event based on the indication after forming the class file.
3. The dynamic collection method of claim 2, wherein the intercepting code comprises: page code and/or event code, wherein injecting interception code corresponding to the operation event based on the indication after forming a class file comprises:
after a class file is formed and before an APK is not formed, traversing the type of a currently input file to obtain a target file, wherein the type of the target file is ended by the class;
and injecting a corresponding interception code into the target file according to the type of the target file.
4. The dynamic collection method of claim 1, wherein collecting corresponding data based on the data configuration when the operational event is generated comprises:
when an operation event is generated, judging whether data needs to be collected currently;
and when the operation event is judged to be yes, collecting corresponding data according to the type of the operation event and the data configuration.
5. The dynamic collection method of claim 4, wherein the data configuration comprises: page names and corresponding data descriptions.
6. The dynamic collection method of claim 5, wherein when an operation event occurs, determining whether data collection is currently required specifically comprises:
when an operation event is generated, judging whether the current page name is matched with the page name in the configuration data;
and when the judgment result is yes, determining that the data needs to be collected currently.
7. An apparatus for dynamically collecting APP data, comprising:
a first receiving unit for receiving an indication of APP data collection;
an injection unit for injecting an interception code based on the indication;
the second receiving unit is used for receiving data configuration corresponding to the indication and issued by the background server;
and the collecting unit is used for collecting corresponding data based on the data configuration when the operation event is generated.
8. Android system, characterized in that it comprises means of dynamic collection of APP data according to claim 7.
9. A statistical method of APP data, comprising:
receiving an indication of APP data collection;
injecting an interception code based on the indication;
receiving data configuration corresponding to the indication and issued by a background server;
when an operation event is generated, collecting corresponding data based on the data configuration;
statistics are performed on the collected data.
10. A statistical device of APP data, comprising:
an indication receiving unit for receiving an indication of APP data collection;
a code injection unit for injecting an interception code based on the indication;
the configuration receiving unit is used for receiving data configuration corresponding to the indication and issued by the background server;
the data collection unit is used for collecting corresponding data based on the data configuration when an operation event is generated;
and the data counting unit is used for counting the collected data.
11. A data service center, comprising a background server and the statistical apparatus of APP data as claimed in claim 8, wherein:
and the background server is used for configuring data based on the indication.
12. A memory storing a computer program, the computer program being executable by a processor to perform the steps of:
receiving an APP data collection instruction, wherein the instruction carries an operation event;
injecting an interception code corresponding to the operational event based on the indication;
receiving data configuration corresponding to the indication and issued by a background server;
when the operational event is generated, corresponding data is collected based on the data configuration.
13. A service terminal comprising a memory, a processor and a computer program stored in said memory and executable on said processor, characterized in that said processor implements the steps of the method of interaction of data according to any of claims 1 to 6 when executing said computer program.
CN201811561882.3A 2018-12-19 2018-12-19 Dynamic collection and statistical method and device of APP data and data service center Pending CN111338885A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811561882.3A CN111338885A (en) 2018-12-19 2018-12-19 Dynamic collection and statistical method and device of APP data and data service center

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811561882.3A CN111338885A (en) 2018-12-19 2018-12-19 Dynamic collection and statistical method and device of APP data and data service center

Publications (1)

Publication Number Publication Date
CN111338885A true CN111338885A (en) 2020-06-26

Family

ID=71183210

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811561882.3A Pending CN111338885A (en) 2018-12-19 2018-12-19 Dynamic collection and statistical method and device of APP data and data service center

Country Status (1)

Country Link
CN (1) CN111338885A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112130818A (en) * 2020-09-15 2020-12-25 北京值得买科技股份有限公司 Android automatic data point burying method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017091178A (en) * 2015-11-09 2017-05-25 横河電機株式会社 Event analysis device, event analysis system, event analysis method, and event analysis program
CN107423048A (en) * 2017-04-14 2017-12-01 网易乐得科技有限公司 Method, apparatus, medium and the computing device of Data Collection
CN108549537A (en) * 2018-04-08 2018-09-18 北京极数科技有限公司 The method and system of user data acquisition based on Android terminal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017091178A (en) * 2015-11-09 2017-05-25 横河電機株式会社 Event analysis device, event analysis system, event analysis method, and event analysis program
CN107423048A (en) * 2017-04-14 2017-12-01 网易乐得科技有限公司 Method, apparatus, medium and the computing device of Data Collection
CN108549537A (en) * 2018-04-08 2018-09-18 北京极数科技有限公司 The method and system of user data acquisition based on Android terminal

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112130818A (en) * 2020-09-15 2020-12-25 北京值得买科技股份有限公司 Android automatic data point burying method

Similar Documents

Publication Publication Date Title
US11025750B2 (en) Determining whether to perform requests at a server or at a client device based on resources provided by the client device
CN108509523B (en) Method and device for structured processing of block chain data and readable storage medium
JP6742650B2 (en) Application calling method and device using mobile browser
CN110232146B (en) Data grabbing method and grabbing device
CN111930472B (en) Code debugging method and device, electronic equipment and storage medium
CN110263070B (en) Event reporting method and device
CN103618606A (en) App login method verified through short message
CN110007819A (en) The operation indicating method, apparatus and computer readable storage medium of system
CN110750443A (en) Webpage testing method and device, computer equipment and storage medium
CN107193565B (en) Method for developing native APP (application) across mobile terminals
CN111338885A (en) Dynamic collection and statistical method and device of APP data and data service center
CN103324567B (en) A kind of adjustment method of application engine and debug system
CN111859083A (en) Service data processing method, device, equipment and computer readable storage medium
CN106933932B (en) Data processing method and device and application server
CN111796819A (en) Applet interface generation method and device, electronic equipment and readable storage medium
CN107426266A (en) Data processing method and server
CN112115041A (en) Dynamic point burying method and device for application program, storage medium and computer equipment
US20150081850A1 (en) Systems and methods for establishing non data delivery channel to check device capabilities
CN113709187B (en) Multi-server data request method, device, equipment and storage medium
CN111756916A (en) Application processing method and device, electronic equipment and computer storage medium
CN115599669A (en) Debugging method and device of microservice, electronic equipment and readable storage medium
CN113626789A (en) User operation request processing method and device and electronic equipment
CN103309897A (en) Firmware publishing method and system
CN110362701A (en) A kind of control method and device that picture fast information is shown
CN110866211B (en) Method and device for processing abnormal page of client

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