Data collection method and device

By obtaining buried point configuration files and using reflection mechanisms to correlate data collection methods, the problems of buried point code invasiveness and data loss in the prior art are solved, and flexibility and stability are improved.

CN113127336BActive Publication Date: 2024-11-22BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010049556.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-01-16
Publication Date
2024-11-22
Estimated Expiration
2040-01-16

AI Technical Summary

Technical Problem

The existing buried point technology requires serious intrusion into project code, and the main process crashes or stops will cause the buried point data to be lost, affecting the flexibility and stability of data collection.

Method used

By obtaining the buried point configuration file when the application is started, using the reflection mechanism to locate the buried point method and associate it with the preset data collection method, generate buried point record data, and create child processes in the main process to ensure data independence and storage security.

Benefits of technology

It realizes the collection of buried data without intruding into the project code, improves the flexibility of the project, and ensures the stability of data storage and upload when the main process crashes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113127336B_ABST
    Figure CN113127336B_ABST
Patent Text Reader

Abstract

The present invention discloses a data collection method and device, and relates to the field of computer technology. A specific implementation of the method includes: when an application is started, a point-burying configuration file is obtained; the point-burying configuration file includes at least one point-burying method to be buried and the path information of the point-burying method to be buried; the corresponding point-burying method to be buried is determined according to the path information, and the determined point-burying method to be buried is associated with a preset data collection method; when any point-burying method to be buried is called, the data collection method associated with the point-burying method to be buried is used to generate point-burying record data; the point-burying record data includes the identification information of the point-burying method to be buried and the time information when the point-burying method to be buried is called. This implementation can collect point-burying record data without intruding into the project code.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a data collection method and device. Background Art

[0002] Tracking is a term for data collection scenarios, which refers to the related technologies and implementation processes for capturing, processing and sending specific user behaviors or events. In the existing tracking technology, it is first necessary to implement the SDK (Software Development Kit) for tracking, then introduce the SDK in the project that needs tracking, and add the methods provided by the SDK to the locations where tracking is required, and then use this method to collect tracking data in the later stage. This tracking method requires serious intrusion into the project code, and the tracking code is highly coupled with the project code, which is not conducive to the later replacement or deletion of the SDK. At the same time, the main process of the application is used in the prior art to perform tracking data collection. If the main process crashes or stops, the tracking data will be lost. Summary of the invention

[0003] In view of this, an embodiment of the present invention provides a data collection method and device, which can collect tracking record data without intruding into the project code.

[0004] To achieve the above objective, according to one aspect of the present invention, a data collection method is provided.

[0005] The data collection method of an embodiment of the present invention includes: when an application is started, obtaining a burying point configuration file; the burying point configuration file includes at least one burying point method to be used and path information of the burying point method to be used; determining the corresponding burying point method to be used based on the path information, and associating the determined burying point method to be used with a preset data collection method; when any burying point method to be used is called, generating burying point record data using the data collection method associated with the burying point method to be used; the burying point record data includes identification information of the burying point method to be used and time information of the burying point method to be used being called.

[0006] Optionally, the data collection method is executed by a subprocess created by a main process of the application.

[0007] Optionally, the tracing configuration file also includes the event identifier corresponding to the tracing method and the name of the parameter to be collected; the tracing record data also includes the event identifier and parameter data corresponding to the called tracing method.

[0008] Optionally, associating the determined method of burying points with a preset data collection method includes: injecting the data collection method into the determined method of burying points.

[0009] Optionally, the data collection method associated with the method to be buried is used to generate the burial point record data, including: when any burial point method to be buried is called, the data collection method associated with the method to be buried is triggered and executed, thereby generating the burial point record data.

[0010] Optionally, the method further includes: storing the generated burial point record data in a database; and performing statistics on the burial point record data in the database according to a preset strategy to obtain burial point statistical data.

[0011] Optionally, the method further includes: uploading the burial point record data and / or burial point statistical data in the database using a preset upload cycle and upload data packet size.

[0012] To achieve the above objective, according to another aspect of the present invention, a data collection device is provided.

[0013] The data collection device of an embodiment of the present invention may include: a configuration acquisition unit, used to: acquire a burying point configuration file when an application is started; the burying point configuration file includes at least one burying point method to be used and path information of the burying point method to be used; an association unit, used to determine the corresponding burying point method to be used based on the path information, and associate the determined burying point method to be used with a preset data collection method; a burying point record generation unit, used to: when any burying point method to be used is called, generate burying point record data using the data collection method associated with the burying point method to be used; the burying point record data includes the identification information of the burying point method to be used and the time information when the burying point method to be used is called.

[0014] To achieve the above objective, according to another aspect of the present invention, an electronic device is provided.

[0015] An electronic device of the present invention includes: one or more processors; a storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the data collection method provided by the present invention.

[0016] To achieve the above objective, according to yet another aspect of the present invention, a computer-readable storage medium is provided.

[0017] A computer-readable storage medium of the present invention stores a computer program, which implements the data collection method provided by the present invention when executed by a processor.

[0018] According to the technical solution of the present invention, one embodiment of the above invention has the following advantages or beneficial effects: a burying configuration file is written for the application in advance to characterize the method and path information of the burying that need to be executed, and after the application is started, the reflection mechanism and the above path information are used to locate the method to be buried and associate the method to be buried with the data collection method, so that when the method to be associated is called, the corresponding data collection method is triggered and executed to generate burying record data, and the burying record data can be stored and uploaded, thereby realizing the collection of burying data without invading the business code, so that the project code and the burying code (i.e., the corresponding code for generating, storing and uploading burying record data) are completely decoupled, so that developers can more easily access or strip the burying code in the project, thereby improving the overall flexibility of the project. In addition, the burying code of the present invention is executed by a subprocess created by the main process of the application, and the subprocess still exists when the main process crashes or stops, so that it will not affect the storage and upload of the burying record data, and ensure the security and stability of data collection.

[0019] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0021] Figure 1 Schematic diagram of the main steps of the data collection method in an embodiment of the present invention;

[0022] Figure 2 is a schematic diagram of an implementation architecture of a data collection method in an embodiment of the present invention;

[0023] Figure 3 is a schematic diagram of specific execution steps of the data collection method in an embodiment of the present invention;

[0024] Figure 4 is a schematic diagram of components of a data collection device in an embodiment of the present invention;

[0025] Figure 5 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;

[0026] Figure 6 It is a schematic diagram of the structure of an electronic device used to implement the data collection method in the embodiment of the present invention. DETAILED DESCRIPTION

[0027] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0028] In the prior art, it is necessary to embed the tracking code in the application code for data collection, which seriously affects the flexibility of the project. The present invention provides a tracking data collection method that does not need to invade the project code, which can be applied to Android and IOS systems (both are mobile operating systems), and can also be applied to web pages (including HTML pages and H5 pages, HTML represents hypertext markup language, and H5 is the fifth generation of HTML). The following will mainly use the application of the method of the present invention in the Android system as an example for explanation. It should be pointed out that, in the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.

[0029] Figure 1 Schematic diagram of main steps of the data collection method according to an embodiment of the present invention.

[0030] like Figure 1 As shown, the data collection method of the embodiment of the present invention can be specifically performed according to the following steps:

[0031] Step S101: when the application is started, a burying point configuration file is obtained; the burying point configuration file includes at least one burying point method and path information of the burying point method.

[0032] In an embodiment of the present invention, a tracking configuration file is created in advance for an application that needs to collect data, and the name and path information of the tracking method to be tracked are stored in the tracking configuration file according to actual needs. For example, if the actual need is to collect the number of times a user clicks on a "login" button on a certain page of the application, the login method corresponding to the button can be determined as the tracking method to be tracked. If the actual need is to collect the length of time a user stays on a certain page of the application, the entry method and exit method of the page can be determined as the tracking method to be tracked.

[0033] The path information in the point-burying configuration file is used to realize the positioning of the method to be buried. The path information of the method to be buried combined with the name of the method to be buried can uniquely identify the method to be buried. The combination of the two is referred to as the identification information of the method to be buried. In the Android system, the path information can be formed using data packet names and class names of different levels, or the path information can be formed using data packet names and page names of different levels. For example, the following data is stored in the point-burying configuration file: method to be buried: a, path: B1 / B2 / B3 / A, then a is the name of the method to be buried, B1 is the name of the first-level data packet, B2 is the name of the second-level data packet, B3 is the name of the third-level data packet, and A is the page name under the third-level data packet. The B1 / B2 / B3 / A / a formed by combining the path information and the name of the method to be buried is the identification information of the method to be buried. It can be understood that the name of the method to be buried and the path information can be stored in the point-burying configuration file in the corresponding format on the IOS side and the web page side. In this step, the corresponding embedding configuration file can be obtained, and the embedding configuration file can be parsed using the corresponding parsing method to obtain the name and path information of the embedding method to be stored therein.

[0034] In some embodiments, the event identifier and parameter name corresponding to the method to be buried can be further stored in the burying configuration file. The event identifier is used to uniquely identify a specific event. For example, the identifier of the login event is configured as 0001, and the identifier of the registration event is configured as 0002. In this way, when the method to be buried is related to the login, 0001 corresponding to the method to be buried is stored in the burying configuration file. The above parameters are data dimensions at the business level. For example, when it is necessary to collect user names while monitoring the method to be buried, the user name is the above parameter name.

[0035] It should be noted that, in actual applications, the data collection method of the embodiment of the present invention can be implemented by executing an SDK containing a tracking code. Before the application is started, the SDK needs to be introduced into the project, but there is no need to invade the code in the project code. In order to avoid the loss of tracking record data (i.e., data generated by the tracking code) caused by the crash or stop of the main process of the application, in an embodiment of the present invention, a child process can be created by the main process of the application after the application is started, and the tracking code of the SDK is executed by the child process, thereby maintaining the independence of uploading the tracking record data. In the field of computer technology, a child process is created by a currently existing process, and can communicate with the parent process and share the context and other resources of the parent process (i.e., the process that creates the child process). Preferably, step S101 and the following steps S102 and S103 can all be executed by the child process.

[0036] Step S102: Determine a corresponding method for burying points based on the path information, and associate the determined method for burying points with a preset data collection method.

[0037] After obtaining the name and path information of the method to be buried in the burying configuration file by using step S101, the method to be buried can be determined by using reflection technology (such as Java reflection mechanism, Java is a programming language). The reflection mechanism is one of the characteristics of Java. It is a mechanism for indirectly operating the target object. Its core is to dynamically load classes when the JVM (Java Virtual Machine) is running. For any class, all properties and methods of the class can be obtained to perform operations. Specifically, in this step, the method to be buried can be located based on reflection technology and through the path information of the method to be buried, and the preset data collection method can be associated with the method to be buried. The above-mentioned data collection method is a public method for generating burying record data. In an optional manner, the data collection method is injected into the method body of the method to be buried to realize the above-mentioned association. In this way, when the method to be buried is called, the associated data collection method will be executed first, thereby generating burying record data. It can be understood that the injection of the data collection method into the method to be buried occurs during the compilation process, so it will not cause intrusion into the project code.

[0038] Step S103: When any pending embedding method is called, the embedding record data is generated using the data collection method associated with the pending embedding method.

[0039] In this step, when the user behavior triggers the method to be buried to be called, the data collection method associated with the method to be buried is triggered and executed, thereby generating a buried record data. Generally, the buried record data may include the identification information of the method to be buried and the time information when the method to be buried was called (such as the specific time when it was called). As a preferred solution, when the event identifier and parameter name are stored in the buried configuration file, the buried record data may further include the event identifier and the corresponding parameter data. Among them, the event identifier in the buried record data is obtained by parsing the buried configuration file, and the parameter data in the buried record data is obtained by collecting user information. For example, the buried record data formed when the user calls the login method is as follows:

[0040] Method Identification Call time Event ID Parameter data (user name) B1 / B2 / B3 / A / a 2019 / 11 / 03 / 12:08 0001 userid1

[0041] In subsequent data analysis, the tracking record data can be queried and counted through method identifier, call time, event identifier and parameter data.

[0042] Preferably, after the buried point record data is generated, it can be first stored in the memory. After a certain amount of data is accumulated in the memory, the buried point record data in the memory is stored in the database to ensure data security. The database can be any applicable database such as MYSQL, SQLITE, etc. Afterwards, the buried point record data in the database can be counted according to business needs to obtain buried point statistical data. For example, when it is necessary to count the total number of executions of a certain method in a certain time period, all buried point record data of the method in the time period can be queried first, and the total number of buried point record data can be used as the total number of executions that need to be counted. When it is necessary to count the total length of time a user stays on a certain page on a certain day, the buried point record data of the user entering the method and exiting the method on the page on that day can be queried first, and the call time information corresponding to a page access process can be subtracted to obtain the length of stay of the page access process. Finally, the length of stay of each access process can be accumulated to obtain the total length of stay that needs to be counted. In practical applications, the strategy for counting buried point record data can be determined according to actual needs.

[0043] Finally, the point-of-sale record data or point-of-sale statistical data in the database can be uploaded to the server using a preset upload cycle (e.g., once per hour) and an upload data packet size (e.g., in units of 1MB). In specific applications, the upload strategy for determining the upload cycle and the upload data packet size can be determined according to actual needs.

[0044] Figure 2 Schematic diagram of the implementation architecture of the data collection method in the embodiment of the present invention. Figure 2 As shown, the application is executed by the main process, and the tracking configuration file is pre-set. In addition to executing the business code of the application, the main process also needs to create a child process after the application is started and perform initialization operations on the child process. In the Android system, a new child process can be created by configuring the action in the child process through Intent in the main process. After the child process is created, it can communicate with the main process through the known AIDL (Android Interface Definition Language) technology and execute the following functional modules: initialization module, tracking statistics module, statistical data upload module, inter-process communication module, network module, and tool module, which are explained below.

[0045] The initialization module is used to perform initialization operations on the tracking point statistics module and the statistical data upload module. The tracking point statistics module includes a configuration file parsing submodule and a data storage submodule. The former is used to parse the tracking point configuration file and generate tracking point record data, and the latter is used to store the tracking point record data and provide methods for adding, deleting, modifying and querying the tracking point record data. The statistical data upload module includes a data upload submodule and an upload configuration submodule. The former is used to upload data according to the upload strategy and call the corresponding interface of the client (the interface can be based on the OKHTTP mode, OKHTTP is an HTTP client mode), and the latter is used to configure the upload strategy. The inter-process communication module is responsible for the communication between the sub-process and the main process, the network module is responsible for the communication between the sub-process and the server, and the tool module can provide various tools for data statistics.

[0046] Figure 3 Schematic diagram of specific execution steps of the data collection method in an embodiment of the present invention. Figure 3 As shown, when the application starts, first determine whether the child process has been created and initialized: if so, read the corresponding tracking configuration file; otherwise, create the child process and perform the initialization operation before reading the tracking configuration file. Next, obtain the tracking method and path information in the tracking configuration file, and generate tracking record data when the tracking method is called. Thereafter, store the tracking record data and determine whether the upload strategy is configured: if so, upload the tracking record data according to the configured upload strategy, otherwise, upload the tracking record data according to the default upload strategy.

[0047] In the technical solution of the embodiment of the present invention, a tracking configuration file is written in advance for the application to characterize the method that needs to execute the tracking and its path information. After the application is started, the reflection mechanism and the above path information are used to locate the method to be tracked and associate the method to be tracked with the data collection method. In this way, when the method to be associated is called, the corresponding data collection method is triggered and executed to generate tracking record data. The tracking record data can be stored and uploaded, thereby realizing the collection of tracking data without intruding the business code, completely decoupling the project code from the tracking code, and making it easier for developers to access or remove the tracking code in the project, thereby improving the overall flexibility of the project. In addition, the tracking code of the present invention is executed by a subprocess created by the main process of the application. When the main process crashes or stops, the subprocess still exists, which will not affect the storage and uploading of the tracking record data, ensuring the security and stability of data collection.

[0048] It should be noted that, for the convenience of description, the aforementioned method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the present invention is not limited by the described action sequence, and some steps can actually be performed in other sequences or simultaneously. In addition, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily necessary to implement the present invention.

[0049] In order to better implement the above-mentioned solution of the embodiment of the present invention, relevant devices for implementing the above-mentioned solution are also provided below.

[0050] See also Figure 4 As shown, the data collection device 400 provided in the embodiment of the present invention may include: a configuration acquisition unit 401, an association unit 402 and a burrowing record generation unit 403.

[0051] Among them, the configuration acquisition unit 401 can be used to: obtain a burying point configuration file when the application is started; the burying point configuration file includes at least one burying point method to be used and the path information of the burying point method to be used; the association unit 402 can be used to determine the corresponding burying point method to be used based on the path information, and associate the determined burying point method to be used with the preset data collection method; the burying point record generation unit 403 can be used to: when any burying point method to be used is called, generate burying point record data using the data collection method associated with the burying point method to be used; the burying point record data includes the identification information of the burying point method to be used and the time information when the burying point method to be used is called.

[0052] In the embodiment of the present invention, the data collection device is executed by a sub-process created by the main process of the application.

[0053] In a specific application, the burying point configuration file also includes the event identifier corresponding to the burying point method and the name of the parameter to be collected; the burying point record data also includes the event identifier and parameter data corresponding to the called burying point method.

[0054] In practical applications, the association unit 402 can also be used to inject the data collection method into the determined method of embedding points.

[0055] In some embodiments, the burial point record generation unit 403 can also be used for: when any burial point method is called, the data collection method associated with the burial point method is triggered and executed, thereby generating burial point record data.

[0056] In an optional manner, the device 400 may further include a storage unit, which is used to store the generated burial point record data in a database; and to perform statistics on the burial point record data in the database according to a preset strategy to obtain burial point statistical data.

[0057] In addition, in an embodiment of the present invention, the device 400 may further include an uploading unit, which is used to upload the burial point record data and / or burial point statistical data in the database using a preset upload period and upload data packet size.

[0058] In the technical solution of the embodiment of the present invention, a tracking configuration file is written in advance for the application to characterize the method that needs to execute the tracking and its path information. After the application is started, the reflection mechanism and the above path information are used to locate the method to be tracked and associate the method to be tracked with the data collection method. In this way, when the method to be associated is called, the corresponding data collection method is triggered and executed to generate tracking record data. The tracking record data can be stored and uploaded, thereby realizing the collection of tracking data without intruding the business code, completely decoupling the project code from the tracking code, and making it easier for developers to access or remove the tracking code in the project, thereby improving the overall flexibility of the project. In addition, the tracking code of the present invention is executed by a subprocess created by the main process of the application. When the main process crashes or stops, the subprocess still exists, which will not affect the storage and uploading of the tracking record data, ensuring the security and stability of data collection.

[0059] Figure 5 An exemplary system architecture 500 is shown to which the data collection method or data collection device according to the embodiment of the present invention can be applied.

[0060] like Figure 5 As shown, the system architecture 500 may include terminal devices 501, 502, 503, a network 504 and a server 505 (this architecture is only an example, and the components included in the specific architecture may be adjusted according to the specific application). The network 504 is used to provide a medium for a communication link between the terminal devices 501, 502, 503 and the server 505. The network 504 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0061] The user can use the terminal devices 501, 502, 503 to interact with the server 505 through the network 504 to receive or send messages, etc. Various client applications can be installed on the terminal devices 501, 502, 503, such as the application to be buried, etc. (only as an example).

[0062] The terminal devices 501 , 502 , and 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0063] The server 505 may be a server that provides various services, such as a server that requires a user to upload the point-burying record data using the application program to be buried operated by the terminal devices 501, 502, and 503 (for example only). The server may process the received data upload request and feed back the processing result (for example, the response information returned after receiving the data upload request - for example only) to the terminal devices 501, 502, and 503.

[0064] It should be noted that the data collection method provided in the embodiment of the present invention is generally executed by the terminal devices 501 , 502 , 503 , and accordingly, the data collection device is generally disposed in the terminal devices 501 , 502 , 503 .

[0065] It should be understood that Figure 5 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0066] The present invention also provides an electronic device. The electronic device of an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the data collection method provided by the present invention.

[0067] Reference below Figure 6 , which shows a schematic diagram of the structure of a computer system 600 of an electronic device suitable for implementing an embodiment of the present invention. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0068] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the computer system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0069] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed so that a computer program read therefrom is installed into the storage section 608 as needed.

[0070] In particular, according to the embodiments disclosed in the present invention, the process described in the main step diagram above can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the main step diagram. In the above embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit 601, the above functions defined in the system of the present invention are executed.

[0071] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0072] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0073] The units involved in the embodiments of the present invention may be implemented by software or hardware. The units described may also be provided in a processor. For example, they may be described as follows: a processor includes a configuration acquisition unit, an association unit, and a burial point record generation unit. Among them, the names of these units do not constitute a limitation on the unit itself in certain cases. For example, the configuration acquisition unit may also be described as a "unit that provides a burial point configuration file to an association unit."

[0074] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by the device, the steps executed by the device include: when the application is started, obtaining a burying point configuration file; the burying point configuration file includes at least one burying point method to be used and the path information of the burying point method to be used; determining the corresponding burying point method to be used based on the path information, and associating the determined burying point method to be used with a preset data collection method; when any burying point method to be used is called, generating burying point record data using the data collection method associated with the burying point method to be used; the burying point record data includes the identification information of the burying point method to be used and the time information when the burying point method to be used is called.

[0075] In the technical solution of the embodiment of the present invention, a tracking configuration file is written in advance for the application to characterize the method that needs to execute the tracking and its path information. After the application is started, the reflection mechanism and the above path information are used to locate the method to be tracked and associate the method to be tracked with the data collection method. In this way, when the method to be associated is called, the corresponding data collection method is triggered and executed to generate tracking record data. The tracking record data can be stored and uploaded, thereby realizing the collection of tracking data without intruding the business code, completely decoupling the project code from the tracking code, and making it easier for developers to access or remove the tracking code in the project, thereby improving the overall flexibility of the project. In addition, the tracking code of the present invention is executed by a subprocess created by the main process of the application. When the main process crashes or stops, the subprocess still exists, which will not affect the storage and uploading of the tracking record data, ensuring the security and stability of data collection.

[0076] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A data collection method, characterized in that: include: When the application starts, obtain the tracking configuration file; The embedding configuration file includes at least one embedding method and path information of the embedding method; Determine a corresponding method for burying points according to the path information, and associate the determined method for burying points with a preset data collection method; When any pending embedding method is called, the embedding record data is generated using the data collection method associated with the pending embedding method; The embedding record data includes the identification information of the embedding method to be used and the time information when the embedding method to be used is called.

2. The data collection method according to claim 1, characterized in that: The data collection method is executed by a subprocess created by the main process of the application.

3. The data collection method according to claim 1, characterized in that: The tracking configuration file also includes the event identifier corresponding to the tracking method and the name of the parameter to be collected; The burying point record data also includes the event identifier and parameter data corresponding to the called burying point method.

4. The data collection method according to claim 1, characterized in that: Associate the determined method of embedding points with the preset data collection method, including: Inject the data collection method into the determined method of the buried point.

5. The data collection method according to claim 1, characterized in that: The data collection method associated with the pending embedding method is used to generate embedding record data, including: When any pending embedding method is called, the data collection method associated with the pending embedding method is triggered and executed, thereby generating embedding record data.

6. The data collection method according to claim 3, characterized in that: Also includes: Store the generated tracking data in the database; The buried point record data in the database is counted according to the preset strategy to obtain the buried point statistical data.

7. The data collection method according to claim 6, characterized in that: Also includes: Upload the tracking point record data and / or tracking point statistical data in the database using the preset upload cycle and upload data packet size.

8. A data collection device, characterized in that: include: The configuration acquisition unit is used to: acquire a tracking configuration file when the application is started; the tracking configuration file includes at least one tracking method to be tracked and path information of the tracking method to be tracked; An associating unit, used to determine a corresponding method for burying points according to the path information, and associate the determined method for burying points with a preset data collection method; The burying point record generating unit is used to: when any burying point method is called, generate burying point record data by using the data collection method associated with the burying point method; the burying point record data includes the identification information of the burying point method and the time information when the burying point method is called.

9. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.