Data acquisition method, device, equipment and storage medium
By dynamically distributing event tracking configuration data on the client side and intercepting target methods, the problem of inflexible data collection strategies in existing technologies is solved, enabling efficient and real-time data collection and monitoring, and improving development efficiency and the accuracy of data collection.
Patent Information
- Application Number
- CN202310201705.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-01
- Publication Date
- 2026-01-09
- Estimated Expiration
- 2043-03-01
AI Technical Summary
Existing data acquisition solutions cannot flexibly adjust data acquisition strategies according to data acquisition needs, resulting in problems such as poor real-time performance, limited coverage, and data redundancy.
By dynamically distributing event tracking configuration data to the client, the system can dynamically intercept target methods and insert event tracking code, thereby enabling data collection on the method chain of the target application. This avoids manually adding event tracking code and supports flexible adjustment of data collection strategies.
It enables data collection covering the entire method chain without increasing the application package size, improving development efficiency and real-time performance, reducing data redundancy and storage pressure, and supporting dynamic and customized business data monitoring.
Smart Images

Figure CN116149967B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of data collection, in particular to the technical field of burying point configuration, application monitoring, and the like, and can be applied to scenarios such as client data analysis and client data monitoring, and particularly relates to a data collection method and device, equipment and storage medium. BACKGROUND
[0002] Data collection is a key element for product analysis, user growth, and the like. A service provider can collect user behavior data, business data, and the like of a client to perform data analysis, and adjust service strategies or optimize services according to the data analysis results.
[0003] Current data collection schemes include a manual increase burying point scheme and a no burying point scheme. In the manual increase burying point scheme, a developer can manually increase a burying point at a target method position in an application to collect data of the target method position through the burying point. The burying point refers to a code for collecting data. In the no burying point scheme, a developer does not need to manually increase a burying point, and the client automatically reports data.
[0004] However, the current data collection scheme cannot flexibly adjust a data collection strategy (such as a data type to be collected, a data collection position, and the like) according to a data collection requirement. SUMMARY
[0005] The present disclosure provides a data collection method, device, equipment and storage medium, which can flexibly adjust a data collection strategy of a client according to a data collection requirement.
[0006] According to a first aspect of the present disclosure, a data collection method is provided, the method is applied to a client, the client is deployed with a target application, and the method comprises:
[0007] In response to detecting that a target method in the target application is called, target burying point configuration data corresponding to the target method is determined from burying point configuration data, the burying point configuration data is issued by a server to the client; before the target method is executed, the target method is dynamically intercepted, and the target method is executed after the target burying point configuration data is inserted; wherein the target burying point configuration data comprises target burying point code corresponding to the target method, the target burying point code comprises a target data collection method and a target parameter acquisition method, the target data collection method is used to acquire application data corresponding to the target method, and the target parameter acquisition method is used to acquire parameter information of the target method; in the process of executing the target method, the application data corresponding to the target method is collected according to the target burying point configuration data.
[0008] According to a second aspect of the present disclosure, a data collection method is provided, the method is applied to a server, and the method comprises:
[0009] receiving a configuration request from a client, the client deploying a target application, the configuration request being sent by the client in response to detecting start of the target application, the configuration request being used to request to obtain the target application's instrumentation configuration data; in response to the configuration request, sending the target application's instrumentation configuration data to the client.
[0010] The instrumentation configuration data is used by the client to determine target instrumentation configuration data corresponding to the target method from the instrumentation configuration data, and to dynamically intercept the target method before execution of the target method, to insert the target instrumentation configuration data and then start execution of the target method, and to collect application data corresponding to the target method according to the target instrumentation configuration data during execution of the target method; the target instrumentation configuration data includes target instrumentation code corresponding to the target method, the target instrumentation code including a target data collection method and a target parameter acquisition method, the target data collection method being used to acquire application data corresponding to the target method, and the target parameter acquisition method being used to acquire parameter information of the target method.
[0011] According to a third aspect of the present disclosure, a data collection device is provided, the device being applied to a client, the client deploying a target application, the device comprising:
[0012] a configuration unit, configured to determine target instrumentation configuration data corresponding to a target method from instrumentation configuration data in response to detecting that the target method in the target application is called, the instrumentation configuration data being sent to the client by a server; the configuration unit is further configured to dynamically intercept the target method before execution of the target method, to insert the target instrumentation configuration data and then start execution of the target method; the target instrumentation configuration data includes target instrumentation code corresponding to the target method, the target instrumentation code including a target data collection method and a target parameter acquisition method, the target data collection method being used to acquire application data corresponding to the target method, and the target parameter acquisition method being used to acquire parameter information of the target method; a collection unit, configured to collect application data corresponding to the target method according to the target instrumentation configuration data during execution of the target method.
[0013] According to a fourth aspect of the present disclosure, a data collection device is provided, the device being applied to a server, the device comprising:
[0014] a receiving unit, configured to receive a configuration request from a client, the client deploying a target application, the configuration request being sent by the client in response to detecting start of the target application, the configuration request being used to request to obtain the target application's instrumentation configuration data; a sending unit, configured to send the target application's instrumentation configuration data to the client in response to the configuration request.
[0015] The target method is dynamically intercepted before being executed, the target method is executed after the target method configuration data is inserted, and application data corresponding to the target method is collected according to the target method configuration data in the process of executing the target method.
[0016] According to a fifth aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to the first aspect or the second aspect.
[0017] According to a sixth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, the computer instructions being used to enable a computer to perform the method according to the first aspect or the second aspect.
[0018] According to a seventh aspect of the present disclosure, a computer program product is provided, comprising a computer program, the computer program being used to implement the method according to the first aspect or the second aspect when being executed by a processor.
[0019] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present disclosure, nor to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0020] The accompanying drawings are used to better understand the present scheme, and do not limit the present disclosure. Among them:
[0021] Figure 1 A flowchart of a data collection method provided by an embodiment of the present disclosure is provided;
[0022] Figure 2 Another flowchart of a data collection method provided by an embodiment of the present disclosure is provided;
[0023] Figure 3 Another flowchart of a data collection method provided by an embodiment of the present disclosure is provided;
[0024] Figure 4 Another flowchart of a data collection method provided by an embodiment of the present disclosure is provided;
[0025] Figure 5 Another schematic flowchart illustrating the data acquisition method provided in this embodiment of the disclosure;
[0026] Figure 6 Another schematic flowchart illustrating the data acquisition method provided in this embodiment of the disclosure;
[0027] Figure 7 Another schematic flowchart illustrating the data acquisition method provided in this embodiment of the disclosure;
[0028] Figure 8 This is a schematic diagram of the composition of the data acquisition device provided in the embodiments of this disclosure;
[0029] Figure 9 This is another schematic diagram of a data acquisition device provided in an embodiment of the present disclosure;
[0030] Figure 10 A schematic block diagram of an example electronic device 1000 that can be used to implement embodiments of the present disclosure is shown. Detailed Implementation
[0031] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0032] It should be understood that in the embodiments of this disclosure, the character " / " generally indicates that the preceding and following objects are in an "or" relationship. The terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated.
[0033] Data collection is a key element for product analysis and user growth. For example, users can use applications provided by service providers on their clients' devices. Different applications offer various functions, such as cloud storage, short video apps, e-commerce apps, or other system or non-system applications. Service providers can collect user behavior data and business data from clients for data analysis and adjust service strategies or optimize services based on the analysis results.
[0034] Current data collection solutions include: manual data entry point addition and no-code data entry point addition.
[0035] In a manual increase of a buried point scheme, a developer can manually increase a buried point at a target method position in an application to collect data of the target method position through the buried point. The buried point refers to a code for collecting data. The manual increase of the buried point scheme can collect data at any method position, and the buried point is accurate. However, the increase, decrease, and modification of the buried point need to be manually adjusted by a developer, and a new version of the application needs to be released to update the client, which is poor in real-time performance.
[0036] In a no-buried point scheme, a developer does not need to manually increase a buried point, and data is automatically reported by a client. For example, the client can collect and report data related to all click and display events in the application. However, the no-buried point scheme is not widely covered, such as being unable to collect data related to method events that are not click and display. Moreover, there is a lot of data redundancy in the data collected by the no-buried point scheme, such as click and display event related data that is not needed or not important, which increases storage and bandwidth costs. For example, in a certain scenario, clicking some buttons has no effect on the business, and the data is not useful, but the no-buried point scheme will also collect it.
[0037] In summary, the current data collection scheme cannot flexibly adjust the data collection strategy (such as the type of data to be collected, the data collection position, and the like) according to the data collection needs.
[0038] In this background technology, the present disclosure provides a data collection method, device, equipment, and storage medium, which can flexibly adjust the data collection strategy of a client according to the data collection needs.
[0039] The execution subject of the method can be a client, which can be a mobile phone, a computer, a wearable device, or other terminal equipment. The present disclosure does not limit the specific product form of the client.
[0040] The data collection method is exemplarily described below.
[0041] Figure 1 A flowchart of the data collection method provided by the embodiments of the present disclosure is shown. Figure 1 The data collection method shown can be applied to a client, and the client is deployed with a target application. The client can be connected with a server.
[0042] The server can be a computer or a server, or can also be other equipment with data processing capability. The execution subject of the method is not limited herein.
[0043] In some embodiments, the server can be a separate server, or can also be a server cluster composed of multiple servers. In some embodiments, the server cluster can also be a distributed cluster. The specific implementation of the server is not limited by the present disclosure.
[0044] like Figure 1 As shown, the data acquisition method may include:
[0045] S101. In response to detecting that a target method in the target application is called, determine the target tracking configuration data corresponding to the target method from the tracking configuration data. The tracking configuration data is sent from the server to the client.
[0046] The event tracking configuration data for the target application can be generated by the developers. This configuration data may include the event tracking code corresponding to the methods executed by the target application, and the event tracking code may include data collection methods and parameter retrieval methods.
[0047] For example, if it's necessary to collect user behavior data at a specific location within a target application, and this data is generated during the execution of method A within the application, then method A could include business logic methods, click methods, page loading methods, etc. (the specific methods are not limited here). Developers can then generate event tracking configuration data based on the target location to collect this data. This configuration data can include the event tracking code corresponding to method A, which in turn can include data collection methods and parameter retrieval methods for obtaining information about method A's parameters.
[0048] For example, when the target application is in a running state, it may call one or more target methods. The target application being in a running state means that the target application's program is running. That is, the target application is in a running state when its program instructions are loaded into the client's memory and executed by the processor.
[0049] When the target application is in a runtime state, it may execute a large number of methods. In response to the detection that a target method in the target application has been called, the target event configuration data corresponding to that target method can be determined from the event configuration data.
[0050] The target tracking configuration data may include the target tracking code corresponding to the target method. The target tracking code includes the target data collection method and the target parameter acquisition method. The target data collection method is used to obtain the application data corresponding to the target method, and the target parameter acquisition method is used to obtain the parameter information of the target method.
[0051] After obtaining the target embedding configuration data corresponding to the target method, you can execute S102-S103.
[0052] S102. Before executing the target method, dynamically intercept the target method, insert the target tracking configuration data, and then start executing the target method.
[0053] Dynamic interception of a target method refers to the interception (hooking) operation of the target method. By hooking the target method, it is possible to insert event tracking points into the target method, that is, to insert target event tracking configuration data. The inserted target event tracking configuration data can collect application data corresponding to the target method when the target method is executed, such as S103.
[0054] S103. During the execution of the target method, the application data corresponding to the target method is collected based on the target tracking point configuration data.
[0055] For example, by executing the target data collection method in the target tracking configuration data, data during the execution of the target method can be obtained, such as application data. By collecting the application data obtained during the execution of the target data collection method, data collection on the link where the target method is located can be achieved.
[0056] For example, S102 actually performs a dynamic interception (hook) operation on the target method, realizes method exchange, and inserts data collection code into the new method after the exchange, such as inserting the target data collection method. The process of calling the target data collection method corresponding to the target method in the target method can be implemented through a method call function (such as the msgSend function), which is not restricted here.
[0057] It should be understood that a client application (i.e., the target application) contains numerous methods. When monitoring a large number of method chains, manually adding tracking code to these chains would result in a massive amount of code and significantly increase the application's package size. However, S102-S103 described above can automatically insert tracking code into the method chains based on the configured tracking data to collect data. This eliminates the need for manual code addition and allows for arbitrary coverage of all method chains, achieving full method chain coverage without increasing the application's package size.
[0058] For some operating systems, when the above-mentioned hook operation is performed on the target method of the target application, the parameter information of the target method may not be obtainable. To address this, this disclosure adds a method for obtaining target parameters to the target event tracking configuration data, which ensures that the parameter information of the target method during method calls can be collected.
[0059] The present disclosure can realize monitoring of each method link of the target application when the target application is in a runtime state, and collecting data of the method link to be collected according to the data collection requirement, so that the developer does not need to manually add a data collection code in the target application, and the data collection of the target application can be realized, thereby improving the development efficiency, and the data collection strategy of the target application can be flexibly adjusted according to the data collection requirement, for example, increasing or reducing the data collection, so that the real-time performance is better.
[0060] In addition, the present disclosure can realize data collection of any number of method links without increasing the application package size, thereby avoiding data redundancy and reducing bandwidth and storage pressure.
[0061] The data collection method provided by the present disclosure can realize dynamic and real-time business data monitoring, and can realize more rapid, efficient and comprehensive data collection, thereby better helping to analyze and solve online problems in time, optimizing the user experience and improving the performance of the client.
[0062] In some embodiments, the method of dynamically intercepting the target method before executing the target method and inserting the target method into the target method to start executing the target method comprises: according to the target method, calling the target data collection method to start executing the target method, calling the message forwarding method in the target data collection method to start executing the target data collection method, and calling the target parameter acquisition method in the message forwarding method to start executing the message forwarding method.
[0063] The message forwarding method is used to forward the parameter information of the target method when the target method is dynamically intercepted.
[0064] For example, when the target method has no specific implementation, the message forwarding process can be executed to avoid crash. The message forwarding process can include the above-mentioned message forwarding method, and the message forwarding method can carry a forwarding object, and the forwarding object can carry all the parameter information of the target method.
[0065] For example, the message forwarding method can be a method customized by the developer, or a method provided by the operating system. For example, the operating system can be IOS RIn this system, the message forwarding method can be the `forwardInvocation` method, and the forwarding object can be an `NSInvocation` object. In other operating systems, the message forwarding method can also be other methods; this disclosure does not limit the specific type of operating system or message forwarding method.
[0066] For example, the execution of the target data collection method begins after the message forwarding method is called in the target data collection method, and the execution of the message forwarding method begins after the target parameter acquisition method corresponding to the target method is called in the message forwarding method. This enables the target parameter acquisition method to collect the parameter information of the target method in the method call.
[0067] Taking method A as an example, when calling method A, the msgSend function can first go to the target data collection method (i.e. the method used for data collection) corresponding to method A defined in the data collection configuration data. From the target data collection method corresponding to method A, it can go to the message forwarding method. From the message forwarding method, it can go to the parameter retrieval method corresponding to method A defined in the data collection configuration data. From the parameter retrieval method corresponding to method A, it can go back to the target data collection method corresponding to method A. Then, it can go back to the normal execution of method A from the target data collection method corresponding to method A.
[0068] In this embodiment of the disclosure, the target data acquisition method is used to acquire application data during execution, the message forwarding method is used to forward the parameter information of the target method, and the target parameter acquisition method is used to acquire the parameter information of the target method in the message forwarding method.
[0069] For example, for each target method (the target method is a certain method) executed by the target application, in response to the detection that the target method has been called, the client can start executing the target method after calling the target data collection method corresponding to the target method in the target method according to the data points configuration, start executing the target data collection method after calling the message forwarding method in the target data collection method, and start executing the message forwarding method after calling the target parameter acquisition method corresponding to the target method in the message forwarding method.
[0070] For example, suppose the target application includes method 1, method 2, and method 3. The event tracking configuration data specifies data collection method 1 and parameter retrieval method 1 for method 1, data collection method 2 and parameter retrieval method 2 for method 2, but not for method 3. Then, for method 1, in response to detecting that method 1 has been called, the client can call data collection method 1 (which is the target data collection method for method 1) within method 1 to begin execution; call the message forwarding method within data collection method 1 to begin execution; and call parameter retrieval method 1 (which is the target parameter retrieval method for method 1) within the message forwarding method to begin execution.
[0071] Similarly, the invocation flow for Method 2 can refer to that of Method 1. For Method 3, since the data collection method and parameter acquisition method corresponding to Method 3 are not configured in the event tracking configuration data, Method 3 can be directly called for execution. In this case, data related to Method 1 and Method 2 can be collected, but data related to Method 3 cannot. If data related to Method 3 needs to be collected, the server needs to update the event tracking configuration data and synchronize it to the client.
[0072] In other embodiments, the above-described parameter acquisition method can also obtain parameter information by interacting with other methods or plugins, and this is not limited here.
[0073] Figure 2 This is another schematic flowchart illustrating the data acquisition method provided in an embodiment of this disclosure. For example... Figure 2 As shown, in some embodiments, the method may further include:
[0074] S201. In response to the detection that the target application has started, a configuration request is sent to the server. The configuration request is used to request the instrumentation configuration data of the target application.
[0075] For example, a user can launch the target application by clicking its icon on the client side. In response to detecting the target application's launch, the client can send a configuration request to the server. This configuration request asks the server to send the target application's event tracking configuration data to the client.
[0076] S202. Receive the event tracking configuration data of the target application returned by the server according to the configuration request. The event tracking configuration data includes the event tracking code corresponding to the method executed by the target application. The event tracking code includes the data collection method and the parameter acquisition method.
[0077] For example, the client can receive the event tracking configuration data of the target application returned by the server.
[0078] By the above S201-S202, the target application-based starting can be realized, the target application's burying point configuration data is dynamically issued to the client by the server, and thus the target application's starting is taken as a condition to regularly update the burying point configuration data.
[0079] Optionally, the local burying point configuration data is stored in the local cache of the client, and the local burying point configuration data is burying point configuration data used for data collection of the target application when the target application is last run. The configuration request includes version information of the local burying point configuration data.
[0080] The target application's burying point configuration data returned by the receiving server according to the configuration request includes: a burying point configuration message returned by the receiving server according to the configuration request. When the version information of the local burying point configuration data is consistent with the version information of the latest version of the target application's burying point configuration data stored by the server, the burying point configuration message includes first indication information, and the first indication information is used to indicate that the local burying point configuration data is the latest version. When the version information of the local burying point configuration data is inconsistent with the version information of the latest version of the target application's burying point configuration data stored by the server, the burying point configuration message includes the latest version of the burying point configuration data.
[0081] When the burying point configuration message includes the latest version of the burying point configuration data, the method further includes: updating the local burying point configuration data according to the burying point configuration message.
[0082] It can be understood that when the server does not issue the burying point configuration data to the client, or the client does not cache (or deletes) the previous burying point configuration data, the local cache of the client does not actually store the local burying point configuration data. At this time, the version information of the local burying point configuration data included in the configuration request can be empty.
[0083] Exemplarily, in the embodiment, when the server can send the target application's burying point configuration data to the client, the burying point configuration message can be sent. The server can determine the content of the burying point configuration message according to the version information of the local burying point configuration data included in the configuration request.
[0084] For example, after the server receives the configuration request, there are two cases for the version information of the local burying point configuration data included in the configuration request. Case 1 is that the version information of the local burying point configuration data is consistent with the version information of the latest version of the target application's burying point configuration data stored by the server. Case 2 is that the version information of the local burying point configuration data is inconsistent with the version information of the latest version of the target application's burying point configuration data stored by the server. When the version information of the local burying point configuration data is empty, it can belong to case 2.
[0085] In both scenarios described above, when the version information of the local event tracking configuration data matches the version information of the latest version of the event tracking configuration data of the target application stored on the server, the server can send a first indication in the event tracking configuration message to indicate that the local event tracking configuration data is the latest version. That is, the server does not need to send the latest version of the event tracking configuration data in the event tracking configuration message.
[0086] When the version information of the local event tracking configuration data is inconsistent with the version information of the latest version of the target application's event tracking configuration data stored on the server, it indicates that the target application's event tracking configuration data has been updated on the server, and it needs to be synchronized to the client. The event tracking configuration message can include the latest version of the event tracking configuration data, but does not include the first indication information. When the event tracking configuration message includes the latest version of the event tracking configuration data, the client can update its local event tracking configuration data based on the event tracking configuration message. For example, it can replace the local event tracking configuration data in the local cache with the latest version of the event tracking configuration data.
[0087] For example, the version information mentioned above may be a version number or other identifying information that can indicate an updated version, and there are no restrictions on this.
[0088] In this embodiment, when the version information of the local event tracking configuration data is consistent with the version information of the latest version of the event tracking configuration data of the target application stored on the server, the event tracking configuration message includes first indication information to indicate that the local event tracking configuration data is the latest version. This can avoid the server repeatedly transmitting the event tracking configuration data of the target application to the client when the event tracking configuration data of the target application has not been updated on the server, thereby improving data transmission efficiency.
[0089] Figure 3 This is yet another flowchart illustrating the data acquisition method provided in this embodiment of the disclosure. Figure 3 As shown, in some embodiments, before the step of sending a configuration request to the server, the method further includes:
[0090] S301. Read the local event tracking configuration data stored in the local cache.
[0091] S302. Verify the local data entry configuration data. The verification result includes whether the verification was successful or failed.
[0092] For example, validating local event tracking configuration data can include anomaly detection and handling. This includes detecting whether the local event tracking configuration data has been tampered with or whether fields are missing. When anomalies are detected, anomaly handling, such as data recovery, can be performed. If, after anomaly detection and handling, the local event tracking configuration data is still inconsistent with the original data sent from the server, the validation has failed. Conversely, if the local event tracking configuration data is normal, the validation has succeeded.
[0093] S303. When the verification result is a verification failure, add a second indication information to the configuration request. The second indication information is used to indicate that when the version information of the local tracking configuration data is consistent with the version information of the latest version of the tracking configuration data stored on the server, the tracking configuration message still needs to include the latest version of the tracking configuration data.
[0094] For example, when the configuration request also includes the second indication information, the server can know that there is an anomaly in the local event tracking configuration data cached by the client, and in response to the detection of the second indication information, add the latest version of the event tracking configuration data to the event tracking configuration message.
[0095] Optionally, when the verification result is successful, the configuration request does not include the second indication information.
[0096] This embodiment, by sending the latest version of the event tracking configuration data to the client after the client fails to verify the local event tracking configuration data, ensures that even if the server detects that the version information of the client's local event tracking configuration data is consistent with the version information of the latest version of the event tracking configuration data of the target application stored on the server, the client's local event tracking configuration data will still be updated due to the abnormality of the local event tracking configuration data. This better guarantees the implementation of data collection, avoids the impact of data collection due to abnormal local event tracking configuration data, and improves the accuracy and security of data collection.
[0097] Corresponding to the client-side data collection method provided in the foregoing embodiments, this disclosure also provides a data collection method applied to the server side.
[0098] Figure 4 This is yet another flowchart illustrating the data acquisition method provided in this embodiment of the disclosure. Figure 4 As shown, the method includes:
[0099] S401. Receive a configuration request from a client. The client has deployed a target application. The configuration request is sent by the client in response to detecting that the target application has started. The configuration request is used to request the instrumentation configuration data of the target application.
[0100] S402. In response to the configuration request, send the target application's event tracking configuration data to the client.
[0101] The event tracking configuration data includes the event tracking code corresponding to the method executed by the target application, and the event tracking code includes the data collection method and the parameter acquisition method.
[0102] Among them, the event tracking configuration data is used by the client to determine the target event tracking configuration data corresponding to the target method from the event tracking configuration data, and to dynamically intercept the target method before executing the target method, insert the target event tracking configuration data and start executing the target method, and to collect the application data corresponding to the target method according to the target event tracking configuration data during the execution of the target method.
[0103] The target tracking configuration data includes the target tracking code corresponding to the target method. The target tracking code includes the target data collection method and the target parameter acquisition method. The target data collection method is used to obtain the application data corresponding to the target method, and the target parameter acquisition method is used to obtain the parameter information of the target method.
[0104] The above Figure 4 The specific implementation of the method shown and its beneficial effects can be referred to the foregoing embodiments, and will not be repeated here.
[0105] Optionally, the client's local cache stores local event tracking configuration data. This local event tracking configuration data is the event tracking configuration data used to collect data from the target application during its last runtime. The configuration request includes version information of the local event tracking configuration data.
[0106] In response to a configuration request, send the target application's event tracking configuration data to the client, including: in response to a configuration request, send an event tracking configuration message to the client.
[0107] Specifically, when the version information of the local event tracking configuration data is consistent with the version information of the latest version of the event tracking configuration data of the target application stored on the server, the event tracking configuration message includes first indication information, which indicates that the local event tracking configuration data is the latest version. When the version information of the local event tracking configuration data is inconsistent with the version information of the latest version of the event tracking configuration data of the target application stored on the server, the event tracking configuration message includes the latest version of the event tracking configuration data.
[0108] The specific implementation and beneficial effects of this embodiment can be referred to in the foregoing embodiments, and will not be repeated here.
[0109] In some embodiments, the client is further configured to read local event tracking configuration data stored in a local cache and validate the local event tracking configuration data before sending a configuration request to the server. The validation result includes whether the validation was successful or failed. When the validation result is a failure, the configuration request also includes second indication information.
[0110] When the configuration request includes the second indication information, and the version information of the local event tracking configuration data is consistent with the version information of the latest version of the event tracking configuration data stored on the server, the event tracking configuration message includes the latest version of the event tracking configuration data.
[0111] The specific implementation and beneficial effects of this embodiment can also be found in the foregoing embodiments, and will not be repeated here.
[0112] Figure 5 This is yet another flowchart illustrating the data acquisition method provided in this embodiment of the disclosure. Figure 5 As shown, in some embodiments, the method includes:
[0113] S501. Obtain the data points location information of the target application.
[0114] The tracking point information can include: information about the target location where tracking needs to be performed. For example, the target location can be set according to the business that needs to collect data, the type of user operation, etc. For example, the tracking point information can indicate which product or page the user clicks on when tracking should be performed.
[0115] S502: Receive the event tracking configuration operation of the developer for the target application based on the event tracking location information. The event tracking configuration operation includes selecting the corresponding method for the event tracking location information and writing the corresponding event tracking code.
[0116] For example, the tracking point information can be configured by data analysts or product developers. Developers can view the tracking point information on the server side and, based on this information, select the corresponding method for tracking and write the necessary tracking code. The aforementioned operations of selecting the corresponding method for tracking point information and writing the corresponding tracking code can be called the tracking configuration operation.
[0117] S503. In response to the event tracking configuration operation, generate event tracking configuration data for the target application based on the method and event tracking code corresponding to the event tracking location information.
[0118] The server can generate the target application's event tracking configuration data based on the methods and event tracking codes corresponding to the event tracking information, according to the above event tracking configuration operations. For details on the target application's event tracking configuration data, please refer to the foregoing embodiments.
[0119] In this embodiment, the buried point position information can be set according to data collection requirements. The developer can perform a buried point configuration operation to generate the buried point configuration data of the target application on the server, thereby greatly improving the generation efficiency of the buried point configuration data and the buried point configuration efficiency of the target application.
[0120] Figure 6 Another flowchart of the data collection method provided by the embodiments of the present disclosure is shown in FIG. 6. As shown in FIG. 6, in some other embodiments, the method includes the following steps. Figure 6
[0121] S601, obtaining buried point position information of a target application.
[0122] S601 can refer to S501, and details are not repeated here.
[0123] S602, determining a method and a buried point code corresponding to the buried point position information from existing methods and buried point codes according to the buried point position information and a mapping relationship between the buried point position information and the method and the buried point code.
[0124] For example, the buried point position information can be configured by a data analyst or a product developer. The developer can preset the mapping relationship between the buried point position information and the method and the buried point code on the server. For example, the mapping relationship can indicate that for a certain buried point position information, the buried point needs to be performed in which method, and the buried point needs to be implemented through which code. The server can store the identification of the method of the target application and a large amount of buried point code.
[0125] After obtaining the buried point position information of the target application, the server can automatically determine in which method the buried point needs to be performed according to the buried point position information and the mapping relationship between the buried point position information and the method and the buried point code, and determine the buried point code corresponding to the buried point position information from the existing buried point code.
[0126] S603, generating buried point configuration data of the target application according to the method and the buried point code corresponding to the buried point position information.
[0127] After obtaining the method and the buried point code corresponding to the buried point position information, the server can automatically generate the buried point configuration data of the target application.
[0128] In this embodiment, the buried point position information can be set according to data collection requirements. The server can automatically generate the buried point configuration data of the target application, thereby reducing the buried point configuration operation of the developer, greatly improving the generation efficiency of the buried point configuration data and the buried point configuration efficiency of the target application.
[0129] In some other embodiments, the above Figure 5 and Figure 6 The embodiments shown can also be implemented together, for example, in Figure 6 Based on the embodiments shown, for some point information, the server can not have existing point code, at this time, the point code can be configured by Figure 5 The embodiments shown allow developers to configure point code for these point information.
[0130] In some embodiments, the server can include a point platform and a configuration platform. The point platform can be a log reporting protocol (UBC) platform. The point platform and the configuration platform can be deployed on the same server or on different servers, which is not limited here.
[0131] For example, Figure 7 Another flowchart of the data collection method provided by the embodiments of the present disclosure is shown.
[0132] As Figure 7 In some embodiments, the data collection method can include:
[0133] S701, the configuration platform sends a log reporting request message to the point platform.
[0134] For example, the configuration platform can periodically send a log reporting request message to the point platform. The log reporting request message can be represented as "request UBC".
[0135] After receiving the log reporting request, the point platform can execute S702 to return the point information to the configuration platform.
[0136] S702, the point platform sends a point information message to the configuration platform.
[0137] The point information message includes the point information described in the foregoing embodiments. The point information in the point platform can be configured by data analysts or product developers. For example, the point information message can be represented as "reply UBC data".
[0138] Exemplarily, the point information message contains the latest point information.
[0139] S703, the configuration platform generates point configuration data of the target application according to the point information.
[0140] S703 can refer to the embodiments described above Figure 5 and Figure 6 will not be described here.
[0141] Exemplarily, the configuration data of the embedded point can be stored in a list of configuration data of the embedded point, and the present disclosure does not limit the format of the list of configuration data of the embedded point.
[0142] S704, in response to detecting that the target application is started, the client reads the local embedded point configuration data stored in the local cache and performs verification.
[0143] S705, according to the verification result, the client sends a configuration request to the configuration platform.
[0144] The configuration request can be represented as "requestconfig".
[0145] S704-S705 can refer to the foregoing embodiments, and will not be repeated here.
[0146] After the server receives the configuration request, S706 can be performed.
[0147] S706, the configuration platform sends the embedded point configuration data of the target application to the client according to the configuration request.
[0148] After the client receives the embedded point configuration data of the target application, S707 can be performed.
[0149] S707, the client collects data according to the embedded point configuration data when the target application is in a runtime state.
[0150] S707 can refer to the foregoing embodiments, and will not be repeated here.
[0151] S708, the client reports the collected data to the data platform.
[0152] The data platform can also be deployed on the server or on other servers, which is not limited here.
[0153] The specific implementation and beneficial effects of the present embodiment can also refer to the foregoing embodiments, and will not be repeated here.
[0154] In some embodiments, the client is further configured to read the local embedded point configuration data stored in the local cache before sending the configuration request to the server, and verify the local embedded point configuration data, wherein the verification result includes verification success or verification failure. When the verification result is verification failure, the configuration request further includes second indication information.
[0155] When the configuration request includes the second indication information, and the version information of the local embedded point configuration data is consistent with the version information of the latest version of the embedded point configuration data stored in the server, the embedded point configuration message includes the latest version of the embedded point configuration data.
[0156] The specific implementation and beneficial effects of this embodiment can also be found in the foregoing embodiments, and will not be repeated here.
[0157] In an exemplary embodiment, this disclosure also provides a data acquisition device applied to a client, which can be used to implement the data acquisition method executed by the client as described in the foregoing embodiments, wherein the client has a target application deployed. Figure 8 This is a schematic diagram illustrating the composition of a data acquisition device provided in an embodiment of this disclosure. Figure 8 As shown, the device may include: a configuration unit 801 and a data acquisition unit 802.
[0158] Configuration unit 801 is used to determine the target tracking configuration data corresponding to the target method from the tracking configuration data in response to the detection that the target method in the target application is called. The tracking configuration data is sent from the server to the client.
[0159] Configuration unit 801 is also used to dynamically intercept the target method before it is executed, insert the target embedding configuration data, and then start executing the target method.
[0160] The target tracking configuration data includes the target tracking code corresponding to the target method. The target tracking code includes the target data collection method and the target parameter acquisition method. The target data collection method is used to obtain the application data corresponding to the target method, and the target parameter acquisition method is used to obtain the parameter information of the target method.
[0161] The acquisition unit 802 is used to acquire application data corresponding to the target method according to the target embedding point configuration data during the execution of the target method.
[0162] Optionally, the configuration unit 801 is specifically used to: start executing the target method after calling the target data collection method in the target method according to the target data collection point configuration data; start executing the target data collection method after calling the message forwarding method in the target data collection method; and start executing the message forwarding method after calling the target parameter acquisition method in the message forwarding method.
[0163] Among them, the message forwarding method is used to forward the parameter information of the target method when the target method is dynamically intercepted.
[0164] For example, the configuration unit 801 is specifically used to, when the target application is in a running state, for each target method executed by the target application, in response to detecting that the target method is called, to start executing the target method after calling the target data collection method corresponding to the target method in the target method according to the instrumentation configuration data, to start executing the target data collection method after calling the message forwarding method in the target data collection method, and to start executing the message forwarding method after calling the target parameter acquisition method corresponding to the target method in the message forwarding method.
[0165] Among them, the data acquisition method is used to acquire application data during execution, the message forwarding method is used to forward the parameter information of the target method, and the parameter acquisition method is used to acquire the parameter information of the target method in the message forwarding method.
[0166] Please continue to refer to this. Figure 8 As shown, the device also includes a transmitting unit 803 and a receiving unit 804.
[0167] The sending unit 803 is used to send a configuration request to the server in response to the detection that the target application has started. The configuration request is used to request the acquisition of the target application's data entry configuration data.
[0168] The receiving unit 804 is used to receive the event tracking configuration data of the target application returned by the server according to the configuration request. The event tracking configuration data includes the event tracking code corresponding to the method executed by the target application. The event tracking code includes the data collection method and the parameter acquisition method.
[0169] Optionally, the client's local cache stores local event tracking configuration data. This local event tracking configuration data is the event tracking configuration data used to collect data from the target application during its last runtime. The configuration request includes version information of the local event tracking configuration data.
[0170] The receiving unit 804 is specifically used to receive the instrumentation configuration message returned by the server according to the configuration request.
[0171] When the version information of the local event tracking configuration data is consistent with the version information of the latest version of the event tracking configuration data of the target application stored on the server, the event tracking configuration message includes a first indication information, which is used to indicate that the local event tracking configuration data is the latest version.
[0172] When the version information of the local event tracking configuration data is inconsistent with the version information of the latest version of the event tracking configuration data of the target application stored on the server, the event tracking configuration message includes the latest version of the event tracking configuration data.
[0173] When the event tracking configuration message includes the latest version of the event tracking configuration data, the configuration unit 801 is also used to update the local event tracking configuration data according to the event tracking configuration message.
[0174] Optionally, the configuration unit 801 is further configured to read the local event tracking configuration data stored in the local cache and verify the local event tracking configuration data before the sending unit 803 sends the configuration request to the server. The verification result includes verification success or verification failure. When the verification result is verification failure, a second indication information is added to the configuration request. The second indication information is used to indicate that if the version information of the local event tracking configuration data is consistent with the version information of the latest version of the event tracking configuration data stored on the server, the event tracking configuration message still needs to include the latest version of the event tracking configuration data.
[0175] In an exemplary embodiment, this disclosure also provides a data acquisition device applied to a server, which can be used to implement the data acquisition method executed by the server as described in the foregoing embodiments. Figure 9 This is another schematic diagram of a data acquisition device provided in an embodiment of this disclosure. (See diagram below.) Figure 9 As shown, the device may include a receiving unit 901 and a transmitting unit 902.
[0176] The receiving unit 901 is used to receive a configuration request from a client. The client has deployed a target application. The configuration request is sent by the client in response to the detection that the target application has started. The configuration request is used to request the acquisition of the target application's event tracking configuration data.
[0177] The sending unit 902 is used to respond to a configuration request and send the target application's event tracking configuration data to the client. The event tracking configuration data includes the event tracking code corresponding to the method executed by the target application. The event tracking code includes the data collection method and the parameter acquisition method.
[0178] Among them, the event tracking configuration data is used by the client to determine the target event tracking configuration data corresponding to the target method from the event tracking configuration data, and to dynamically intercept the target method before executing the target method, insert the target event tracking configuration data and start executing the target method, and to collect the application data corresponding to the target method according to the target event tracking configuration data during the execution of the target method.
[0179] The target tracking configuration data includes the target tracking code corresponding to the target method. The target tracking code includes the target data collection method and the target parameter acquisition method. The target data collection method is used to obtain the application data corresponding to the target method, and the target parameter acquisition method is used to obtain the parameter information of the target method.
[0180] Optionally, the client's local cache stores local event tracking configuration data. This local event tracking configuration data is the event tracking configuration data used to collect data from the target application during its last runtime. The configuration request includes version information of the local event tracking configuration data.
[0181] The sending unit 902 is specifically used to send a data entry configuration message to the client in response to a configuration request.
[0182] When the version information of the local event tracking configuration data is consistent with the version information of the latest version of the event tracking configuration data of the target application stored on the server, the event tracking configuration message includes a first indication information, which is used to indicate that the local event tracking configuration data is the latest version.
[0183] When the version information of the local event tracking configuration data is inconsistent with the version information of the latest version of the event tracking configuration data of the target application stored on the server, the event tracking configuration message includes the latest version of the event tracking configuration data.
[0184] Optionally, the client is also used to read the local event tracking configuration data stored in the local cache before sending the configuration request to the server, and to verify the local event tracking configuration data. The verification result includes verification success or verification failure.
[0185] When the verification result is a verification failure, the configuration request also includes a second indication message.
[0186] When the configuration request includes the second indication information, and the version information of the local event tracking configuration data is consistent with the version information of the latest version of the event tracking configuration data stored on the server, the event tracking configuration message includes the latest version of the event tracking configuration data.
[0187] Please continue to refer to this. Figure 9 As shown, the device may further include: an acquisition unit 903 and a configuration unit 904.
[0188] In some embodiments, the acquisition unit 903 is used to acquire the tracking point information of the target application. The configuration unit 904 is used to receive the tracking point configuration operation of the target application by the developer based on the tracking point information. The tracking point configuration operation includes selecting the corresponding method for the tracking point information and writing the corresponding tracking point code. The configuration unit 904 is also used to generate tracking point configuration data of the target application in response to the tracking point configuration operation, based on the method and tracking point code corresponding to the tracking point information.
[0189] In other embodiments, the acquisition unit 903 is used to acquire the tracking point information of the target application. The configuration unit 904 is used to determine the method and tracking code corresponding to the tracking point information from existing methods and tracking codes based on the tracking point information and the mapping relationship between the tracking point information and methods and tracking codes. The configuration unit 904 is also used to generate tracking configuration data for the target application based on the method and tracking code corresponding to the tracking point information.
[0190] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0191] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product. The electronic device may be the aforementioned client or server.
[0192] In an exemplary embodiment, an electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method described in the above embodiments. The electronic device may be the computer or server described above.
[0193] In an exemplary embodiment, the readable storage medium may be a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method described in the above embodiments.
[0194] In an exemplary embodiment, the computer program product includes a computer program that, when executed by a processor, implements the method described in the above embodiments.
[0195] Figure 10 A schematic block diagram of an example electronic device 1000 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0196] like Figure 10 As shown, the electronic device 1000 includes a computing unit 1001, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1002 or a computer program loaded from a storage unit 1008 into a random access memory (RAM) 1003. The RAM 1003 may also store various programs and data required for the operation of the device 1000. The computing unit 1001, ROM 1002, and RAM 1003 are interconnected via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0197] The various components in the electronic device 1000 are connected to the I / O interface 1005, including: an input unit 1006, such as a keyboard, a mouse, etc.; an output unit 1007, such as various types of displays, speakers, etc.; a storage unit 1008, such as a magnetic disk, an optical disk, etc.; and a communication unit 1009, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1009 allows the electronic device 1000 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.
[0198] The computing unit 1001 can be various general and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 1001 performs various methods and processes described above, such as the data acquisition method. For example, in some embodiments, the data acquisition method can be implemented as a computer software program, which is tangibly embodied in a machine-readable medium, such as the storage unit 1008. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 1000 via the ROM 1002 and / or the communication unit 1009. When the computer program is loaded onto the RAM 1003 and executed by the computing unit 1001, one or more steps of the data acquisition method described above can be performed. Alternatively, in other embodiments, the computing unit 1001 can be configured to perform the data acquisition method by any other appropriate means, such as by means of firmware.
[0199] The various implementations of the systems and techniques described above herein can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0200] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces the functions / operations specified in the flowcharts and / or block diagrams. The program code can be executed entirely on a machine, partially on a machine, partially on a machine as a standalone software package, or entirely on a remote machine or server.
[0201] In the context of the present disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0202] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0203] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0204] The computer system can include clients and servers. This relationship can be. The servers are typically remote from the clients with the interactions between them occurring over a communication network. The relationship between client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The servers can be cloud servers, servers of a distributed system, or servers incorporating blockchain.
[0205] It should be understood that the various forms of flow shown above can be re-ordered, added to, or deleted from without departing from the scope of the present disclosure. For example, the steps recited in the present disclosure can be performed in parallel, in series, or in a different order, without departing from the desired results of the technology disclosed in the present disclosure, and are not limited herein.
[0206] The specific embodiments described above are not intended to be limiting. One of skill in the art will understand that various modifications, combinations, sub-combinations, and alternatives can be made to the specific embodiments described above without departing from the spirit and principles of this disclosure. Any further modifications, changes, or improvements that come within the spirit and principles of the disclosure are intended to fall within the scope of the disclosure.
Claims
1. A data acquisition method, the method being applied to a client, the client having a target application deployed thereon, the method comprising: In response to detecting that a target method in the target application is invoked, the target tracking configuration data corresponding to the target method is determined from the tracking configuration data, which is sent from the server to the client. Before executing the target method, the target method is dynamically intercepted, and the target tracking configuration data is inserted before the target method is executed. The target tracking configuration data includes the target tracking code corresponding to the target method. The target tracking code includes a target data collection method and a target parameter acquisition method. The target data collection method is used to acquire the application data corresponding to the target method, and the target parameter acquisition method is used to acquire the parameter information of the target method. During the execution of the target method, application data corresponding to the target method is collected based on the target data point configuration.
2. The method according to claim 1, wherein before executing the target method, dynamically intercepting the target method, inserting the target tracking configuration data, and then starting to execute the target method, comprises: Based on the target data point configuration, the target method is executed after the target data collection method is called in the target method; the target data collection method is executed after the message forwarding method is called in the target data collection method; and the message forwarding method is executed after the target parameter acquisition method is called in the message forwarding method. The message forwarding method is used to forward the parameter information of the target method when the target method is dynamically intercepted.
3. The method according to claim 1 or 2, further comprising: In response to the detection that the target application has started, a configuration request is sent to the server. The configuration request is used to request the acquisition of the event tracking configuration data of the target application. The system receives the event tracking configuration data of the target application returned by the server according to the configuration request. The event tracking configuration data includes the event tracking code corresponding to the method executed by the target application. The event tracking code includes the data collection method and the parameter acquisition method.
4. The method according to claim 3, wherein the local cache of the client stores local event tracking configuration data, and the local event tracking configuration data is the event tracking configuration data used to collect data from the target application during the last runtime of the target application; The configuration request includes version information of the local event tracking configuration data; The step of receiving the event tracking configuration data of the target application returned by the server according to the configuration request includes: Receive the event tracking configuration message returned by the server based on the configuration request; When the version information of the local event tracking configuration data is consistent with the version information of the latest version of the event tracking configuration data of the target application stored on the server, the event tracking configuration message includes first indication information, which is used to indicate that the local event tracking configuration data is the latest version. When the version information of the local event tracking configuration data is inconsistent with the version information of the latest version of the event tracking configuration data of the target application stored on the server, the event tracking configuration message includes the latest version of the event tracking configuration data. When the event tracking configuration message includes the latest version of the event tracking configuration data, the method further includes: Update the local event tracking configuration data according to the event tracking configuration message.
5. The method according to claim 4, wherein before sending the configuration request to the server, the method further comprises: Read the local event tracking configuration data stored in the local cache; The local embedding configuration data is verified, and the verification result includes verification success or verification failure. When the verification result is a verification failure, a second indication information is added to the configuration request. The second indication information is used to indicate that the version information of the local tracking configuration data is consistent with the version information of the latest version of the tracking configuration data stored on the server. In this case, the tracking configuration message still needs to include the latest version of the tracking configuration data.
6. A data acquisition method, the method being applied to a server, the method comprising: A configuration request is received from a client, which has a target application deployed on it. The configuration request is sent by the client in response to detecting that the target application has started. The configuration request is used to request the acquisition of the event tracking configuration data of the target application. In response to the configuration request, the event tracking configuration data of the target application is sent to the client; The event tracking configuration data is used by the client to determine the target event tracking configuration data corresponding to the target method from the event tracking configuration data, and to dynamically intercept the target method before executing the target method, insert the target event tracking configuration data and start executing the target method, and to collect the application data corresponding to the target method according to the target event tracking configuration data during the execution of the target method. The target tracking configuration data includes the target tracking code corresponding to the target method. The target tracking code includes a target data collection method and a target parameter acquisition method. The target data collection method is used to acquire the application data corresponding to the target method, and the target parameter acquisition method is used to acquire the parameter information of the target method.
7. The method according to claim 6, wherein the local cache of the client stores local event tracking configuration data, and the local event tracking configuration data is the event tracking configuration data used to collect data from the target application during the last runtime of the target application; The configuration request includes version information of the local event tracking configuration data; The step of sending the target application's event tracking configuration data to the client in response to the configuration request includes: In response to the configuration request, a data entry configuration message is sent to the client; Wherein, when the version information of the local event tracking configuration data is consistent with the version information of the latest version of the event tracking configuration data of the target application stored on the server, the event tracking configuration message includes first indication information, which is used to indicate that the local event tracking configuration data is the latest version; When the version information of the local event tracking configuration data is inconsistent with the version information of the latest version of the event tracking configuration data of the target application stored on the server, the event tracking configuration message includes the latest version of the event tracking configuration data.
8. The method according to claim 7, wherein the client is further configured to read the local instrumentation configuration data stored in the local cache before sending a configuration request to the server, and to verify the local instrumentation configuration data, wherein the verification result includes verification success or verification failure. When the verification result is a verification failure, the configuration request also includes second indication information; When the configuration request includes the second indication information, and the version information of the local event tracking configuration data is consistent with the version information of the latest version of the event tracking configuration data stored on the server, the event tracking configuration message includes the latest version of the event tracking configuration data.
9. The method according to any one of claims 6-8, further comprising: Obtain the location information of the embedded points of the target application; The system receives data from developers regarding the data tracking configuration of the target application based on the data tracking information. The data tracking configuration includes selecting a corresponding method for the data tracking information and writing corresponding data tracking code. In response to the event tracking configuration operation, event tracking configuration data for the target application is generated based on the method and event tracking code corresponding to the event tracking location information.
10. The method according to any one of claims 6-8, wherein the method further comprises: Obtain the location information of the embedded points of the target application; Based on the embedded point information and the mapping relationship between the embedded point information and the method and embedded point code, the method and embedded point code corresponding to the embedded point information are determined from the existing methods and embedded point codes; Based on the method and tracking code corresponding to the tracking point information, the tracking point configuration data of the target application is generated.
11. A data acquisition device, the device being applied to a client, the client having a target application deployed thereon, the device comprising: A configuration unit is used to determine the target tracking configuration data corresponding to the target method from the tracking configuration data in response to detecting that a target method in the target application is called. The tracking configuration data is sent from the server to the client. The configuration unit is further configured to dynamically intercept the target method before executing the target method, insert the target embedding configuration data, and then start executing the target method. The target tracking configuration data includes the target tracking code corresponding to the target method. The target tracking code includes a target data collection method and a target parameter acquisition method. The target data collection method is used to acquire the application data corresponding to the target method, and the target parameter acquisition method is used to acquire the parameter information of the target method. The collection unit is configured to collect application data corresponding to the target method according to the target burying point configuration data during execution of the target method.
12. The apparatus of claim 11, wherein the configuration unit is specifically configured to: start execution of the target method after the target data collection method is invoked in the target method according to the target burying point configuration data, start execution of the target data collection method after a message forwarding method is invoked in the target data collection method, and start execution of the message forwarding method after the target parameter acquisition method is invoked in the message forwarding method; wherein, the message forwarding method is configured to forward parameter information of the target method when the target method is dynamically intercepted.
13. The apparatus of claim 11 or 12, further comprising: a sending unit configured to send a configuration request to a server in response to detecting that the target application is started, the configuration request being used to request to acquire burying point configuration data of the target application; a receiving unit configured to receive the burying point configuration data of the target application returned by the server according to the configuration request, the burying point configuration data including burying point code corresponding to a method executed by the target application, the burying point code including a data collection method and a parameter acquisition method.
14. The apparatus of claim 13, wherein the local cache of the client stores local burying point configuration data, the local burying point configuration data being burying point configuration data used to collect data of the target application when the target application is last run; the configuration request includes version information of the local burying point configuration data; the receiving unit is specifically configured to receive a burying point configuration message returned by the server according to the configuration request; when the version information of the local burying point configuration data is consistent with version information of burying point configuration data of a latest version of the target application stored by the server, the burying point configuration message includes first indication information, the first indication information being used to indicate that the local burying point configuration data is the latest version; when the version information of the local burying point configuration data is inconsistent with the version information of the burying point configuration data of the latest version of the target application stored by the server, the burying point configuration message includes the burying point configuration data of the latest version; when the burying point configuration message includes the burying point configuration data of the latest version, the configuration unit is further configured to update the local burying point configuration data according to the burying point configuration message.
15. The apparatus of claim 14, wherein the configuration unit is further configured to read the local burying point configuration data stored in the local cache before the sending unit sends the configuration request to the server, and to perform verification on the local burying point configuration data, a verification result including verification success or verification failure. When the verification result is a verification failure, a second indication information is added to the configuration request. The second indication information is used to indicate that when the version information of the local tracking configuration data is consistent with the version information of the latest version of the tracking configuration data stored on the server, the tracking configuration message still needs to include the latest version of the tracking configuration data.
16. A data acquisition device, the device being used on a server, the device comprising: A receiving unit is used to receive a configuration request from a client, wherein the client has deployed a target application, and the configuration request is sent by the client in response to detecting that the target application has started. The configuration request is used to request the acquisition of the target application's data entry configuration data. The sending unit is used to send the target application's data entry configuration to the client in response to the configuration request. The event tracking configuration data is used by the client to determine the target event tracking configuration data corresponding to the target method from the event tracking configuration data, and to dynamically intercept the target method before executing the target method, insert the target event tracking configuration data and start executing the target method, and to collect the application data corresponding to the target method according to the target event tracking configuration data during the execution of the target method. The target tracking configuration data includes the target tracking code corresponding to the target method. The target tracking code includes a target data collection method and a target parameter acquisition method. The target data collection method is used to acquire the application data corresponding to the target method, and the target parameter acquisition method is used to acquire the parameter information of the target method.
17. An electronic device, comprising: At least one processor; and a memory communicatively connected to the at least one processor; The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to perform the method according to any one of claims 1-5, or the method according to any one of claims 6-10.
18. A non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method according to any one of claims 1-5, or the method according to any one of claims 6-10.
19. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-5, or the method according to any one of claims 6-10.
Citation Information
Patent Citations
Information obtaining method and device, medium and computation equipment
CN107943651A
Method for supporting dynamic acquisition of burying point data, device and system and electronic equipment
CN113505302A