CN110347562B - Data acquisition method and device, computer readable medium and intelligent terminal equipment - Google Patents
Data acquisition method and device, computer readable medium and intelligent terminal equipment Download PDFInfo
- Publication number
- CN110347562B CN110347562B CN201810307542.1A CN201810307542A CN110347562B CN 110347562 B CN110347562 B CN 110347562B CN 201810307542 A CN201810307542 A CN 201810307542A CN 110347562 B CN110347562 B CN 110347562B
- Authority
- CN
- China
- Prior art keywords
- data
- sub
- application
- lifecycle
- user access
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3089—Monitoring arrangements determined by the means or processing involved in sensing the monitored data, e.g. interfaces, connectors, sensors, probes, agents
- G06F11/3093—Configuration details thereof, e.g. installation, enabling, spatial arrangement of the probes
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording 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/3438—Recording 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
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording 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/3466—Performance evaluation by tracing or monitoring
- G06F11/3476—Data logging
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Debugging And Monitoring (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The embodiment of the invention provides a data acquisition method and device for a sub-application, a computer readable medium and intelligent terminal equipment. The data acquisition method is suitable for intelligent terminal equipment, and the sub-application runs in a sub-application container based on a sub-application framework. The data acquisition method comprises the following steps: integrating a data collection toolset in a sub-application; implanting an initialization method of a data acquisition tool set in a life cycle function of the sub-application; collecting channel data through context data of the sub-applications; acquiring user access data by rewriting a lifecycle function of a sub-application framework; acquiring bottom layer environment data of the intelligent terminal equipment through a system interface of the sub-application framework; reporting the collected data including at least a portion of the channel data, the user access data, and the underlying environmental data to a server.
Description
Technical Field
The application relates to the technical field of computers, in particular to a data acquisition method, a data acquisition device, a computer readable medium and intelligent terminal equipment.
Background
With the popularization and the progress of the intelligent terminal equipment, more and more applications are operated on the intelligent terminal equipment. These applications include, but are not limited to, web page applications, H5 light applications, hybrid applications, client-embedded html pages, applet applications, and the like. In order to better serve the client, user behavior data such as the use of the intelligent terminal device and various applications by the client needs to be collected.
In the related art, the collection of user behavior data is mainly based on a browser. However, for sub-applications like applets, the browser-based approach has not yet met the data collection requirements well. For example, browser-based solutions are not suitable for environments without these grammatical sugar objects, windows, documents, etc.
Therefore, there is still a need to develop new user behavior data collection schemes to meet new data collection requirements.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present invention and therefore may include information that does not constitute prior art known to a person of ordinary skill in the art.
Disclosure of Invention
The embodiment of the invention relates to a data acquisition method, a data acquisition device, a computer readable medium and intelligent terminal equipment, which can acquire various user behavior data from sub-applications, thereby providing a data source for user statistical analysis.
Additional features and advantages of the invention will be set forth in the detailed description which follows, or may be learned by practice of the invention.
According to an aspect of the embodiments of the present invention, there is provided a data acquisition method for a sub-application, which is used for an intelligent terminal device, where the sub-application runs in a sub-application container based on a sub-application framework, and the data acquisition method includes: integrating a data collection toolset in the sub-application; implanting an initialization method of the data acquisition toolset in a lifecycle function of the sub-application; collecting channel data through context data of the sub-applications; acquiring user access data by rewriting the lifecycle function of the sub-application framework; acquiring bottom layer environment data of the intelligent terminal equipment through a system interface of the sub-application framework; reporting collected data including at least a portion of the channel data, the user access data, and the underlying environmental data to a server.
According to an aspect of the embodiments of the present invention, there is provided a data acquisition apparatus for a sub-application, for an intelligent terminal device, where the sub-application runs in a sub-application container based on a sub-application framework, the data acquisition apparatus including: an integration unit for integrating a data collection toolset in the sub-application; the attachment unit is used for implanting an initialization method of the data acquisition tool set in the life cycle function of the sub-application; the channel data acquisition unit is used for acquiring channel data through the context data of the sub-application; the user access data acquisition unit is used for acquiring user access data by rewriting the life cycle function of the sub application framework; the bottom layer environment data acquisition unit is used for acquiring the bottom layer environment data of the intelligent terminal equipment through a system interface of the sub-application framework; a reporting unit, configured to report the collected data including at least one part of the channel data, the user access data, and the underlying environment data to a server.
According to some embodiments, based on the foregoing, a user access data acquisition unit includes: a rewriting unit for rewriting the lifecycle function of the sub-application framework, wherein custom logic is injected in the rewritten lifecycle function; a return unit for returning to the inherent logic of the lifecycle function of the sub-application framework.
According to some embodiments, based on the foregoing scheme, the rewriting unit is a configured rewriting unit for collecting user access data by configuring a lifecycle function of the rewritten sub-application framework.
According to some embodiments, based on the foregoing scheme, the rewrite unit may include: the page rewriting unit is used for rewriting the page life cycle function so as to acquire user access data; and/or the operation rewriting unit is used for rewriting the page operation life cycle function so as to collect the user use data.
According to some embodiments, based on the foregoing solution, the data collection toolset further comprises an identification generation unit configured to: utilizing a metson prime number greater than one billion as a first factor in generating the unique identifier; using a current system timestamp as a second factor for generating the unique identifier; a random number is used as a third factor for generating the unique identifier.
According to some embodiments, based on the foregoing scheme, the reporting unit is configured to: packing the acquired data into a key-value pair sequence; and reporting the key-value pair sequence to a server through a system interface of the sub-application framework in a mode of inquiring character strings.
According to some embodiments, based on the foregoing scheme, the data acquisition device further includes a custom event acquisition unit configured to report custom event data through the acquisition interface.
According to an aspect of embodiments of the present invention, there is provided a computer readable medium, on which a computer program is stored, which when executed by a processor, implements the data acquisition method as described in the above embodiments. .
According to an aspect of the embodiments of the present invention, there is provided an intelligent terminal device, including: one or more processors; a storage device for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the data acquisition method as described in the embodiments above.
In the technical solutions provided in some embodiments of the present invention, the system api of the sub-application framework is used to communicate with the bottom layer hardware, so that the bottom layer environment data such as the device model and the operating system can be collected.
In the technical solutions provided by some embodiments of the present invention, data acquisition is performed by means of attaching and rewriting a frame lifecycle function, and automatic or configurable acquisition of most data can be achieved.
In the technical solutions provided by some embodiments of the present invention, channel scenes, paths, parameters, and the like of sub-applications, such as a WeChat applet, can be collected and restored by using context data of the sub-applications, and data support can be provided for developers and operators to perform refined operations.
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 invention, as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention. It is obvious that the drawings in the following description are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without inventive effort. In the drawings:
FIG. 1A shows a schematic diagram of an exemplary system architecture to which a data acquisition method or apparatus of an embodiment of the invention may be applied;
FIGS. 1B-1H illustrate application scenarios for statistical analysis using collected data according to embodiments of the present invention;
FIG. 2 illustrates a schematic structural diagram of a computer system suitable for use with intelligent terminal devices and servers to implement embodiments of the present invention;
FIG. 3 schematically illustrates a data collection method for a sub-application in accordance with an embodiment of the invention;
FIG. 4 schematically illustrates a method of generating a unique identification for accessing people number data and/or opening times data, according to an embodiment of the invention;
FIG. 5 schematically shows a block diagram of a data acquisition device for a sub-application according to an exemplary embodiment of the present invention;
fig. 6 schematically shows the overall architecture of the front-end and back-end of a data acquisition system according to an embodiment of the invention.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to provide a thorough understanding of embodiments of the invention. One skilled in the relevant art will recognize, however, that the invention may be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations or operations have not been shown or described in detail to avoid obscuring aspects of the invention.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
FIG. 1A shows a schematic diagram of an exemplary system architecture 100 to which the data acquisition method or apparatus of embodiments of the present invention may be applied.
As shown in fig. 1A, the system architecture 100 may include one or more of terminal devices 101, 102, 103, as well as a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wifi, 4G, 5G, and so on.
It should be understood that the number of terminal devices, networks, and servers in FIG. 1A are merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. For example, server 105 may be a server cluster comprised of multiple servers, or the like.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may be various electronic devices having a display screen, including but not limited to smart phones, tablet computers, and the like. The server 105 may be a server that provides various services.
As more and more applications are running on the intelligent terminal device, various modes of application architectures have emerged in order to improve the processing power of the applications and facilitate the development and management of the applications. One mode may be referred to as a child application mode (or as applet mode), in which a child application (or applet) runs in a parent application, which may also be referred to as a child application container. In this mode, the sub-applications running in the container may be based on a canonical sub-application framework, thereby facilitating development and management of the sub-applications. For example, a sub-application may be a wechat applet that may be employed in a sub-application container wechat.
On the other hand, in order to better serve the customer, user behavior data such as the use of the intelligent terminal device and various sub-applications by the customer needs to be collected, so that a data source is provided for user statistical analysis. The data acquisition of the sub-applications is the basis of the data source and is crucial for statistical analysis.
However, in the related art, the collection of the user behavior data is mainly based on a browser. Depending strongly on the browser, window and document objects are frequently used in data collection, and the sub-applications such as the applet have no browser concept, and the jssdk cannot run in the applet without these grammar objects such as window and document. Furthermore, js sdk is 10kb or more, and the sub-application itself generally has a limitation on the program size.
In addition, because the browser is relied on, and the safety of the browser is limited, the data acquisition function cannot perform data communication with the underlying equipment, so that the required data of the model, the operating system and the like cannot be accurately acquired (even cannot be acquired).
According to the data acquisition method of the sub-application, the data acquisition is carried out without depending on a global object of a browser, so that js sdk does not need to be loaded, a data acquisition tool set is integrated in the sub-application, and user data is acquired by means of attaching to a life cycle function or rewriting the life cycle function. In addition, the system api exposed by the sub-application framework can be fully utilized to acquire the underlying environment data. According to one embodiment, the data collection tool set sdk is only 4 kb.
Fig. 1B-1H illustrate application scenarios for statistical analysis using collected data, which may be presented to terminal devices 101, 102, 103 and/or server 105, according to embodiments of the present invention.
FIG. 1B illustrates user access data being applied to a base report. As shown in FIG. 1B, the base report may include, but is not limited to, number of visits (PV), number of visitors (unique view), number of opens (session view), number of independent IPs (IP view). For example, accessing a page may count as a number of accesses, a repeat statistic. The number of visitors is the number of visitors to the sub-application, and the statistics are not repeated. The number of times of opening is the number of times of opening the sub-application. The number of independent ips is the number of ips that access the child application.
Fig. 1C and 1D show the application of the underlying environment data on the terminal environment analysis. As shown in fig. 1C, the proportions of the network connection environments 4G, wifi and 3G in the number of accesses are 63.19%, 20.08%, and 8.73%, respectively. Fig. 1D shows the access number ratio from the four models of terminals.
FIG. 1E illustrates a product scenario screenshot of channel source data used in a channel analysis model, including a proportion of visits from channels such as a find bar applet portal, a scan two-dimensional code, a search results page for a top search box, a one-man chat session, a community number profile page related applet list, and the like.
FIGS. 1F and 1G illustrate screenshots of a product scenario in which user usage data is applied to a usage analytics report, including a share times trend graph (FIG. 1F) and a pull-down refresh times trend graph (FIG. 1G).
FIG. 1H shows a product scenario screenshot for drill-down analysis for page path and custom source parameters. The figure shows the access frequency distribution corresponding to different channel entry pages (or landing pages) and the access frequency distribution corresponding to different channel parameters in the channel scene of scanning the two-dimensional code.
Fig. 2 shows a schematic structural diagram of a computer system suitable for implementing the intelligent terminal device and the server according to the embodiment of the invention.
It should be noted that the computer system 200 of the electronic device shown in fig. 2 is only an example, and should not bring any limitation to the functions and the scope of the application of the embodiment of the present invention.
As shown in fig. 2, the computer system 200 includes a Central Processing Unit (CPU)201 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)202 or a program loaded from a storage section 208 into a Random Access Memory (RAM) 203. In the RAM 203, various programs and data necessary for system operation are also stored. The CPU 201, ROM202, and RAM 203 are connected to each other via a bus 204. An input/output (I/O) interface 205 is also connected to bus 204.
The following components are connected to the I/O interface 205: an input section 206 including a touch screen, a keyboard, and the like; an output section 207 including a display such as a Liquid Crystal Display (LCD) and a speaker; a storage portion 208 including a flash memory or the like; and a communication section 209 including such as a wireless network card, a high-speed network card, and the like. The communication section 209 performs communication processing via a network such as the internet. A drive 210 is also connected to the I/O interface 205 as needed. A removable medium 211 such as a semiconductor memory, a magnetic disk, or the like is mounted on the drive 210 as necessary, so that a computer program read out therefrom is mounted into the storage section 208 as necessary.
In particular, according to an embodiment of the present invention, the processes described below with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the invention include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 209 and/or installed from the removable medium 211. The computer program executes various functions defined in the system of the present application when executed by a Central Processing Unit (CPU) 201.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present invention may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by an electronic device, cause the electronic device to implement the method as described in the embodiments below.
Fig. 3 schematically illustrates a data acquisition method for sub-applications according to an embodiment of the present invention, which may be used for the aforementioned intelligent terminal device.
As previously described, a child application, such as an applet (e.g., a WeChat applet), can run in a child application container (parent application) based on a child application framework. The sub-applications may include lifecycle functions for creation, activity, background activity, destruction of the sub-applications, and creation, rendering, activity, background activity, destruction, etc. of related pages.
According to one embodiment, the sub-applications may include web-like applications, for example, running in a sub-application container in html + js + css. According to one embodiment, a web-like sub-application may include one application thread and multiple page threads, in which case the lifecycle functions may include an application thread lifecycle function and a page thread lifecycle function.
Referring to fig. 3, the data acquisition method of the sub-application according to an embodiment of the present invention may include steps S310 to S360, which will be described in detail below.
In step S310, a data collection tool set is integrated in the sub-application, so that the data collection operation can be performed using the interface and function provided by the data collection tool set.
According to an example embodiment for a wechat applet, a data collection toolset is integrated in the wechat applet by a program statement similar to:
var SDK=require('./vendor/analysis_sdk')。
at step S320, an initialization method for the data collection toolset (sdk) is implanted in the lifecycle function of the sub-application.
To enable data collection by the sub-application, an initialization entry of the data collection toolset (sdk) may be affiliated or actively called in the lifecycle function of the sub-application, data collection is started, and initialization is completed.
According to one embodiment, an initialization method for implanting a corresponding data collection toolset (sdk) in an application thread lifecycle function and a page thread lifecycle function, respectively, of a sub-application.
Taking the wechat applet as an example, a bridge (bridge) is set up between the front js and the bottom operating system by the wechat applet framework, so that characteristics that the activity is smooth and cannot be realized by the front js, such as a hardware interface, a network interface, even an address book and a call, can be realized only by native application (app), can be realized through the js. Under a development framework of an mvvm (model-view-view model) front end defined by a WeChat applet, response to user interaction and load data flow mainly depend on an application (app) thread and a page (page) thread, and each applet is started and maintained by an independent app thread and comprises a plurality of page threads. The whole lifecycle of the applet app thread goes through creation, active, background active, destruction stages, and the WeChat applet framework provides lifecycle functions of onLannch, onShow, onHide, etc. Similarly, when rendering page content, the page thread may go through the stages of creating, rendering data, activating, pushing background activating, destroying, etc., and the WeChat applet framework provides lifecycle functions of onLoad, onShow, onReady, onHide, onUnload, etc. These lifecycle functions exposed to the outside act as hook functions, allowing the developer to make modifications (hack). For example, the lifecycle function onLauch for app startup may include rich parameters related to applet startup, such as source scenes, and the like, where an initialization entry function may be attached (implanted), some startup related data may be obtained, and statistics may be initialized. For example:
in the example above, when the wechat applet app thread initializes, an initialization method sdk. app. init ({ … }) in the data collection tool set is implanted (or actively called) in the app lifecycle function onLauch, with the parameter imported, where appID is the assigned application ID number; eventID is the distributed event statistic ID; configuring a parameter statpuldownfresh to take the value of true/false for determining whether to rewrite the pull-down refresh method of the system, wherein small programs of some users have scenes with special functions of pull-down refresh, so that the trigger operation of how many times of pull-down refresh is needed to be counted; configuring a parameter statsharapp to true/false for determining whether to rewrite the sharing operation of the system and providing a specifically shared url and shared parameter information (title and the like); the configuration parameter statreadBottom takes the value of true/false and is used for determining whether page paging operation of the system is rewritten or not and counting the triggering times of the specific paging operation; the launchOpts can be used for transmitting context data of the WeChat applet, counting parameters of a scene value started by the app, directly acquiring a system value, and helping a user count the scene value opened by the applet and the corresponding parameters.
In the above example, after the app initialization is completed, the landing Page is loaded, and an initialization method sdk. The lifecycle function page is invoked each time the applet page is pushed to the background and then invoked, so that page browsing statistics still play a role, and data collection processes are executed when going to other pages.
In step S330, channel data is collected through the context data of the sub-application.
Channel data is contextual data of the sub-application. When the sub-application is started, it can be brought in the form of parameters.
According to one embodiment, the contextual data of the sub-application may be brought into the initialization portal of the data collection toolset in the form of parameters, such that the sub-application framework api is utilized to retrieve scene values, landing pages, custom source parameters for drill-down analysis, and the like in the data collection toolset (sdk).
The parsed scene values, landing pages, custom source parameters for drill-down analysis, and the like may be used for channel drill-down analysis, as previously described with reference to fig. 1H. The scene values are channel scene values of the open sub-application (e.g., the WeChat applet), such as two-dimensional codes, public number links, group sessions, etc., and the following table is some examples of scene values.
| Scene value | Description of the invention |
| 1001 | Discovery portlet entry |
| 1005 | Search results page for top search box |
| 1006 | Search results page for discovering portlet main entry search box |
| 1007 | Small program message card in single chat conversation |
| 1008 | Applet message card in group chat session |
| 1011 | Scanning two-dimensional code |
| 1012 | Long-press picture identification two-dimensional code |
| 1013 | Two-dimensional code is selected to cell-phone album |
| 1014 | Applet template message |
| 1019 | Electronic purse |
| 1020 | Short-cut sequence list related to public number profile page |
In step S340, user access data is collected by rewriting the lifecycle functions of the sub-application framework.
As previously described, the lifecycle functions of the sub-application framework can be related to the lifecycle of the sub-application page. By rewriting the lifecycle functions of the sub-application framework, user data related to the sub-application page can be obtained.
According to an embodiment, collecting user access data by rewriting the lifecycle functions of the sub-application framework may comprise: rewriting the life cycle function of the sub application frame, and injecting custom logic into the life cycle function of the sub application frame, for example, injecting the custom logic for data acquisition; then, turn back to the inherent logic of the lifecycle functions of the sub-application framework.
According to one embodiment, user access data is collected by configuring a lifecycle function of an overwrite sub-application framework. For example, if the corresponding configuration parameter is set to true (true), the lifecycle functions of the child application frameworks are rewritten; otherwise, the lifecycle functions of the sub-application frameworks are not overwritten.
The lifecycle functions of the sub-application framework may include a page class lifecycle function and a page operation class lifecycle function. According to an embodiment, collecting the user access data by rewriting the lifecycle function of the sub-application framework may include at least one of rewriting a page class lifecycle function to collect the user access data and rewriting a page operation class lifecycle function to collect the user usage data. The page-like lifecycle function is related to page visits, which can be rewritten to collect user visit data, such as number of visits, number of visitors, etc. The page operation life cycle function is related to operation events on the page, such as pull-down refresh (a user behavior for refreshing page data is achieved by pulling down the page), page bottom-down (page up-sliding, to page bottom, if content needs to be dynamically loaded and displayed, the user behavior is used for displaying), and the like. These lifecycle functions can be rewritten to collect user usage data, such as number of shares, number of pull-down refresh events, number of page bottoming events, and the like.
Taking the WeChat applet as an example, according to an exemplary embodiment of the present invention, data related to a user access page is collected by rewriting lifecycle functions such as onShow, onShareApMessage, onPullDownRefresh, and the like. For example:
in the above implementation code, when the configuration parameter SDK _ config, state _ pull _ down _ front is true (true), the lifecycle function _ page _ onpulldown refresh is rewritten, and the custom logic is injected into the lifecycle function _ page. Similarly, other lifecycle functions, such as page bottoming, may be configured for overwriting.
In step S350, the bottom-layer environment data of the intelligent terminal device is collected through the system interface of the sub-application framework.
The sub-application framework can be communicated with the bottom system and hardware, and bottom environment data of the intelligent terminal equipment, such as terminal model, operating system, network type, operator and the like, can be collected through a system interface of the sub-application framework.
Taking the wechat applet as an example, according to an example embodiment of the present invention, the underlying environment data may be obtained by using the wechat applet system api:
wherein wx is a super object of the applet framework, and the developer can use the wx object to call the capability provided by the underlying framework of the wechat applet; adt denotes the device model, scl denotes the pixel ratio, scr denotes the screen width and height, lg denotes the language, fl denotes the version number, jv denotes the operating system version, and tz denotes the platform of the client.
At step S360, collected data including at least a portion of the channel data, the user access data, and the underlying environmental data is reported to the server.
According to actual requirements, part or all of the channel data, the user access data and the underlying environment data can be reported to a server, so that a data source for statistical analysis is constructed.
According to an embodiment, reporting the collected data to the server may include: packing the acquired data into k-v key value pair sequences; reporting the key-value pair sequence to a server through a system interface of the sub-application framework in a query string (Querystring) mode. Taking the WeChat applet as an example, the collected data can be reported in the following way:
wx.request({
url:SDK_CONFIG.api_base+'?'+pool.join('&').toLowerCase()
})
wherein, the pool stores the key value pair of the collected data, and the SDK _ config.api _ base represents the configured server URL address.
Of course, the solution of the present disclosure is not limited thereto, and the collected data may be packaged in other manners and the packaged data may be sent to the server.
As described above, according to the data collection method of the embodiment of the present invention, automatic or configurable collection of user data can be achieved, or some data can be collected by transferring context data of sub-applications and parsing the data in the data collection tool set (sdk). However, the present disclosure is not limited thereto. The data collection toolset (sdk) may also provide a collection interface for reporting custom event data. By utilizing the collection interface of the data collection tool set, the user can report the user-defined event data instead of being limited to the event preset by the system.
For example, according to an embodiment, in order to count the number of clicks of the search button, a custom event is bound to the search button, and each time the user clicks the search button, the user triggers reporting of the custom event. A specific implementation procedure may be to actively invoke a statistics collection method (e.g., sdk. event. stat (…) method) in an event response method (e.g., searchClickEvent) of a search button.
According to an example embodiment of the present invention, collecting user access data by rewriting the lifecycle function of the sub-application framework includes generating a unique identifier for collecting visitor number data and/or open times data, and the like, as described below with reference to FIG. 4.
Fig. 4 schematically shows a method of generating a unique identification according to an embodiment of the invention.
The number of visitors is the number of visitors to the sub-application, and the statistics are not repeated. The number of times of opening is the number of times of opening the sub-application, and the statistics is repeated. When the number of visiting people is counted, different users need to be distinguished; in this regard, different identifications may be set for different users. When the number of times of opening is repeatedly counted, a unique session identifier needs to be set for each sub-application on the same terminal device, but different sub-applications or the same sub-application on different terminal devices need different session identifiers.
Referring to fig. 4, a method of generating a unique identifier according to an embodiment of the present invention may include steps S410 to S430, which will be described in detail below.
At step S410, a metson prime number greater than one billion is utilized as a first factor in generating the unique identifier. For example, a metson prime number 2147483647 is selected as the first factor to generate a unique identifier.
In step S420, the current system timestamp is used as a second factor for generating the unique identifier. For example, the system time is generated using the function Date ().
In step S430, the concurrency issue can be resolved using the random number as a third factor for generating the unique identifier. Random () is introduced to generate random numbers, for example.
According to an embodiment, a js example method for generating a unique identifier is as follows:
(Math.round((Math.random()||0.5)*2147483647)*(+new Date()))%10000000000
that is, the product of the random decimal of 17 significant digits and the 10-bit Messen prime number is rounded and multiplied by the current system timestamp, and the remainder is taken for 10 billion to obtain a completely random 10-digit number, and this number or the combination of this number and other identifiers can be used as the unique user identifier and/or the unique session identifier.
When the user identification uid or session identification sid needs to be used, it can be tried to obtain it from the storage first. If the history uid or sid is obtained, setting the user type identifier as an old user; if not, a user id uid or session id sid is generated by the method, written to storage, and the user type id is set as the new user.
Fig. 5 schematically shows a block diagram of a data acquisition arrangement for a sub-application according to an exemplary embodiment of the present invention.
As shown in fig. 5, the data collecting apparatus 500 for sub-applications according to an exemplary embodiment of the present invention includes an integrating unit 510, an attaching unit 520, a channel data collecting unit 530, a user access data collecting unit 540, an underlying environment data collecting unit 550, and a reporting unit 560.
An integration unit 510 for integrating a data collection toolset in the sub-application; the attachment unit 520 is used for implanting the initialization method of the data acquisition toolset in the life cycle function of the sub-application; the channel data collecting unit 530 is configured to collect channel data through context data of the sub-application; the user access data acquisition unit 540 is used for acquiring user access data by rewriting the lifecycle function of the sub-application framework; the bottom layer environment data acquisition unit 550 is configured to acquire bottom layer environment data of the intelligent terminal device through a system interface of the sub application framework; the reporting unit 560 is configured to report the collected data including at least a part of the channel data, the user access data, and the underlying environment data to a server.
According to an exemplary embodiment, the contextual data of the sub-application is passed in the form of parameters to an initialization method of the data collection toolset.
According to an example embodiment, the user access data collection unit 540 includes: a rewriting unit for rewriting the lifecycle function of the sub-application framework, wherein custom logic is injected in the rewritten lifecycle function; a return unit for returning to the inherent logic of the lifecycle function of the sub-application framework. According to an example embodiment, the rewriting unit is a configured rewriting unit for collecting user access data by configuring a lifecycle function of the rewritten sub-application framework. According to an example embodiment, the rewriting unit may include: the page rewriting unit is used for rewriting the page life cycle function so as to acquire user access data; and/or the operation rewriting unit is used for rewriting the page operation life cycle function so as to collect the user use data.
According to an example embodiment, the data collection toolset further comprises an identification generation unit configured to: utilizing a metson prime number greater than one billion as a first factor in generating the unique identifier; using a current system timestamp as a second factor for generating the unique identifier; a random number is used as a third factor for generating the unique identifier.
According to an example embodiment, the reporting unit 560 is configured to: packing the acquired data into a key-value pair sequence; and reporting the key-value pair sequence to a server through a system interface of the sub-application framework in a mode of inquiring character strings.
According to an exemplary embodiment, the data collecting apparatus 500 further includes a custom event collecting unit, configured to report custom event data through a collecting interface.
Fig. 6 schematically shows an overall architecture of the front end and the back end of the data acquisition system according to the embodiment of the present invention, which is suitable for establishing a statistical data source by using the data acquisition method for sub-applications according to the embodiment of the present invention, and further performing application scenario statistical analysis and other operations by using the statistical data source.
As shown in fig. 6, the overall architecture includes an applet and data collection toolset 610, a gateway 620, an access layer 630, a real-time metrics processing layer 640, message middleware 650, a distributed file system 660, a business data repository 670, and a data storage system 680.
The applet and data collection toolset 610 may perform the data collection method for sub-applications according to embodiments of the present invention as previously described. The gateway 620 is used for domain name resolution, SSL encryption, and the like. The access layer 630 is used to parse the reported fields, including query string and HTTP header. The real-time indicator processing layer 640 includes: the configuration center is used for character textual configuration conversion; the accumulation node is used for calculating an accumulation index; and the deduplication node is used for calculating the deduplication index. The message middleware 650 is a data access platform, and reports data by means of message forwarding, files, message queues, and the like. Distributed file system 660, business data repository 670, and data storage system 680 are used to store various business data, raw data, derived data, statistical data, and the like. Data storage system 680 supports real-time storage and offline storage.
The data acquisition method, the data acquisition device and the data acquisition system architecture for the sub-application according to the embodiment of the invention are described above. Those skilled in the art will readily appreciate from the foregoing detailed description that methods and apparatus according to embodiments of the present invention may have one or more of the following advantages.
According to the embodiment of the invention, the data acquisition method disclosed by the invention does not depend on any browser environment, and has good universality.
According to the embodiment of the invention, the data acquisition method disclosed by the invention does not depend on the global object of the browser to acquire data, and can realize data acquisition in the sub-application such as the WeChat applet.
According to the embodiment of the invention, the data acquisition method disclosed by the invention utilizes the system api of the sub-application framework to communicate with the bottom layer hardware, so that the bottom layer environment data such as the equipment model, the operating system and the like can be acquired.
According to the embodiment of the invention, the data acquisition tool set disclosed by the invention is only about 4kb, and the data acquisition is comprehensive.
According to the data acquisition method disclosed by the embodiment of the invention, channel scenes, paths, parameters and the like of the sub-applications such as the WeChat applet can be acquired and restored by utilizing the context data of the sub-applications, and data support can be provided for developers and operators to perform fine operation.
According to the embodiment of the invention, the data acquisition is carried out in a mode of attaching and rewriting the life cycle function of the frame, so that the automatic or configuration acquisition of most data can be realized.
It will be readily appreciated that although several modules or units of the apparatus for action execution are mentioned in the above detailed description, such division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the invention. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiment of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiment of the present invention.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.
Claims (15)
1. A data acquisition method of a sub-application is used for intelligent terminal equipment, the sub-application runs in a sub-application container based on a sub-application framework, and the data acquisition method is characterized by comprising the following steps:
integrating a data collection toolset in the sub-application;
implanting an initialization method of the data acquisition toolset in a lifecycle function of the sub-application;
collecting channel data through context data of the sub-applications;
acquiring user access data by rewriting the lifecycle function of the sub-application framework;
acquiring bottom layer environment data of the intelligent terminal equipment through a system interface of the sub-application framework;
reporting collected data including at least a portion of all of the collected data of the channel data, the user access data, and the underlying environmental data to a server.
2. A data acquisition method as claimed in claim 1, characterized in that the contextual data of the sub-applications are brought into the initialization method in the form of parameters.
3. The data collection method of claim 1, wherein the channel data comprises at least one of a scene value, a landing page, and custom source parameters for drill-down analysis.
4. The data collection method of claim 1, wherein collecting user access data by rewriting the lifecycle functions of the sub-application framework comprises:
rewriting lifecycle functions of the sub-application frameworks, wherein custom logic is injected in the rewritten lifecycle functions;
turning back to the inherent logic of the lifecycle functions of the sub-application framework.
5. The data collection method of claim 1, wherein collecting user access data by rewriting the lifecycle functions of the sub-application framework comprises:
collecting user access data by configuring a lifecycle function that overwrites the sub-application framework.
6. The data collection method of claim 1, wherein collecting user access data by rewriting a lifecycle function of a sub-application framework comprises:
rewriting a page life cycle function to acquire user access data; and/or
The page operation class lifecycle functions are rewritten to collect user usage data.
7. The data collection method of claim 6, wherein the user access data comprises at least one of visitor count data and open times data, wherein collecting user access data by rewriting a lifecycle function of a sub-application framework comprises generating a unique identification for collecting visitor count data and/or open times data by:
utilizing a metson prime number greater than one billion as a first factor in generating the unique identifier;
using a current system timestamp as a second factor for generating the unique identifier;
a random number is used as a third factor for generating the unique identifier.
8. The data collection method of claim 1, wherein the underlying environmental data comprises at least one of a terminal model, an operating system, a network type, an operator.
9. The data collection method of claim 1, wherein reporting collected data to a server that includes at least a portion of all collected data of the channel data, the user access data, and the underlying environment data comprises:
packing the acquired data into a key-value pair sequence;
and reporting the key-value pair sequence to a server through a system interface of the sub-application framework in a mode of inquiring character strings.
10. The data collection method of claim 1, wherein the sub-application comprises a web-like application.
11. The data collection method of claim 10, wherein the sub-applications comprise an application thread and a plurality of page threads, and the lifecycle functions of the sub-applications comprise application thread lifecycle functions and page thread lifecycle functions.
12. The data acquisition method of claim 1, further comprising:
and reporting the user-defined event data through the acquisition interface.
13. A data acquisition device of a sub-application is used for intelligent terminal equipment, the sub-application runs in a sub-application container based on a sub-application framework, and the data acquisition device is characterized by comprising:
an integration unit for integrating a data collection toolset in the sub-application;
the attachment unit is used for implanting an initialization method of the data acquisition tool set in the life cycle function of the sub-application;
the channel data acquisition unit is used for acquiring channel data through the context data of the sub-application;
the user access data acquisition unit is used for acquiring user access data by rewriting the life cycle function of the sub application framework;
the bottom layer environment data acquisition unit is used for acquiring the bottom layer environment data of the intelligent terminal equipment through a system interface of the sub-application framework;
and the reporting unit is used for reporting at least part of the collected data in all the collected data including the channel data, the user access data and the bottom-layer environment data to a server.
14. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the data acquisition method according to any one of claims 1 to 12.
15. An intelligent terminal device, comprising:
one or more processors;
storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement a data acquisition method as claimed in any one of claims 1 to 12.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810307542.1A CN110347562B (en) | 2018-04-08 | 2018-04-08 | Data acquisition method and device, computer readable medium and intelligent terminal equipment |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810307542.1A CN110347562B (en) | 2018-04-08 | 2018-04-08 | Data acquisition method and device, computer readable medium and intelligent terminal equipment |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN110347562A CN110347562A (en) | 2019-10-18 |
| CN110347562B true CN110347562B (en) | 2022-02-25 |
Family
ID=68173200
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201810307542.1A Active CN110347562B (en) | 2018-04-08 | 2018-04-08 | Data acquisition method and device, computer readable medium and intelligent terminal equipment |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN110347562B (en) |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111414525B (en) * | 2020-03-25 | 2024-01-02 | 深圳市腾讯网域计算机网络有限公司 | Method, device, computer equipment and storage medium for acquiring data of applet |
| CN111767201B (en) * | 2020-06-29 | 2023-08-29 | 百度在线网络技术(北京)有限公司 | User behavior analysis method, terminal device, server and storage medium |
| CN114116388A (en) * | 2021-11-24 | 2022-03-01 | 天翼数字生活科技有限公司 | A method, device, device and readable storage medium for data collection of applet |
| CN116842372A (en) * | 2023-07-31 | 2023-10-03 | 杨柳 | Deep learning sample labeling method and system based on online education big data |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106339658A (en) * | 2015-07-09 | 2017-01-18 | 阿里巴巴集团控股有限公司 | Data processing method and device |
| CN107018046A (en) * | 2017-06-06 | 2017-08-04 | 上海鋆创信息技术有限公司 | A kind of collecting method, device, terminal and storage medium |
| CN107239318A (en) * | 2017-06-13 | 2017-10-10 | 腾讯科技(深圳)有限公司 | Application conversion method, device and equipment |
| CN107566480A (en) * | 2017-08-30 | 2018-01-09 | 北京京东尚科信息技术有限公司 | The user activity information acquisition method and device, storage medium of mobile terminal application |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9361163B2 (en) * | 2013-11-28 | 2016-06-07 | Good Technology Corporation | Managing containerized applications on a mobile device while bypassing operating system implemented inter process communication |
-
2018
- 2018-04-08 CN CN201810307542.1A patent/CN110347562B/en active Active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106339658A (en) * | 2015-07-09 | 2017-01-18 | 阿里巴巴集团控股有限公司 | Data processing method and device |
| CN107018046A (en) * | 2017-06-06 | 2017-08-04 | 上海鋆创信息技术有限公司 | A kind of collecting method, device, terminal and storage medium |
| CN107239318A (en) * | 2017-06-13 | 2017-10-10 | 腾讯科技(深圳)有限公司 | Application conversion method, device and equipment |
| CN107566480A (en) * | 2017-08-30 | 2018-01-09 | 北京京东尚科信息技术有限公司 | The user activity information acquisition method and device, storage medium of mobile terminal application |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110347562A (en) | 2019-10-18 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN110198247B (en) | Interface test method and system | |
| US10951552B2 (en) | Generation of a chatbot interface for an application programming interface | |
| CN110347562B (en) | Data acquisition method and device, computer readable medium and intelligent terminal equipment | |
| CN111901192B (en) | A statistical method and device for page access data | |
| Badii et al. | Snap4city: A scalable iot/ioe platform for developing smart city applications | |
| US9372688B1 (en) | Automatic discovery of a JavaScript API | |
| US8271940B2 (en) | System and method for dynamic generation and customization of web service client applications for terminals | |
| CN113067709B (en) | Charging method, device and equipment based on cloud service and readable storage medium | |
| CN106796526A (en) | JSON stylesheet language transformation | |
| CN111177618A (en) | Website building method, device, equipment and computer readable storage medium | |
| US20150363492A1 (en) | Use of collected data for web api ecosystem analytics | |
| CN113505302A (en) | Method, device and system for supporting dynamic acquisition of buried point data and electronic equipment | |
| CN116569165B (en) | Page display method and device, storage medium and electronic equipment | |
| WO2017132269A1 (en) | Service component management methods and systems | |
| WO2021129812A1 (en) | Method and system for running artificial intelligence application, and device | |
| CN112699111B (en) | Report generation method and device, electronic equipment and computer readable medium | |
| CN111158797A (en) | Method, system and engine device for operating artificial intelligence application | |
| Godinho et al. | Method for evaluating the performance of web-based apis | |
| CN115600023A (en) | Client page skipping method, device and equipment and storage medium | |
| KR100496871B1 (en) | Web service tester and method of testing web service | |
| Wang et al. | Design and implementation of WeChat mini program for university dormitory based on SOA | |
| CN115809056B (en) | Component multiplexing implementation method and device, terminal equipment and readable storage medium | |
| Perera et al. | Enhancing the front end web applications performance using design patterns and microservices based architecture | |
| CN114721929A (en) | Test method, test device, storage medium and equipment | |
| CN111367517B (en) | Information generation method and device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |