Business data collection method, device, electronic device and storage medium
By obtaining the target class method of the target application, generating plug-in configuration parameters, starting the external data acquisition plug-in, collecting and pushing business process data, it solves the problem that targeted data acquisition cannot be supported in the existing technology, and reduces the performance of software services The impact of
Patent Information
- Application Number
- CN202210452221.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-27
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2042-04-27
AI Technical Summary
The prior art cannot support targeted software service business data collection, and has a great impact on software service performance.
By obtaining the target class method in the target application, generating plug-in configuration parameters, starting the external data acquisition plug-in, collecting business process data, and pushing the data to the data collection platform, realizing non-invasive targeted data collection.
Targeted business data collection is realized, reducing the impact on software service performance.
Smart Images

Figure CN114924930B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of software development technology, and in particular to a business data collection method, device, electronic device and storage medium. Background Art
[0002] Pinpoint is a full-link analysis tool that provides non-intrusive call chain monitoring, method execution details viewing, application status information monitoring, etc. Pinpoint supports a wide range of functions, including: service topology diagram, real-time active thread diagram, request response scatter diagram, request call stack viewing, application status and machine status inspection, etc.
[0003] However, Pinpoint is designed to track service links and locate and monitor problems, and cannot support targeted data collection for business data in software services. In addition, due to the wide range of Pinpoint functions, when software services are concurrent and interact frequently, its performance has a certain burden on the software services themselves, accounting for about 3.5%-6% of the overall performance loss of the software services, which has a great impact on the overall performance of the software services. Summary of the invention
[0004] The technical problem to be solved by the embodiments of the present application is to provide a business data collection method, device, electronic device and storage medium to solve the technical problem that the prior art cannot support targeted data collection and has a significant impact on the overall performance of software services.
[0005] In order to solve the above technical problems, the embodiment of the present application provides a business data collection method, which is characterized by comprising:
[0006] The target class method for obtaining the data to be collected in the target application;
[0007] Generate plug-in configuration parameters according to the application information of the target application and the method attribute information of the target class method;
[0008] Add the plug-in configuration parameters in the external data acquisition plug-in;
[0009] In response to the target application being started, starting the external data acquisition plug-in;
[0010] The external data collection plug-in is called to collect the business process data corresponding to the target class method.
[0011] Optionally, generating the plug-in configuration parameters according to the application information of the target application and the method attribute information of the target class method includes:
[0012] Get the application name of the target application;
[0013] Get the class name, method name, request parameter name, request parameter position order and json path expression of the target class method;
[0014] The plug-in configuration parameters are generated according to the application name, the class name, the method name, the request parameter name, the request parameter position order and the json path expression.
[0015] Optionally, calling the external data collection plug-in to collect the business process data corresponding to the target class method includes:
[0016] After the external data acquisition plug-in is started, a tracking object corresponding to the target class method is created;
[0017] Monitoring a loading event of the target class method based on the tracking object;
[0018] According to the loading event, the business process data corresponding to the target class method is collected.
[0019] Optionally, before adding the plug-in configuration parameters in the external data acquisition plug-in, the method further includes:
[0020] Get the Kafka push address;
[0021] Add the kafka push address to the external data collection plug-in.
[0022] Optionally, after calling the external data collection plug-in to collect the business process data corresponding to the target class method, the method further includes:
[0023] Convert the business process data into a json string;
[0024] Based on the kafka push address, the json string is pushed to the data collection platform.
[0025] Optionally, the pushing the json string to the data collection platform based on the kafka push address includes:
[0026] In the case where the target class method is at least two class methods, the json string is pushed to the data collection platform through the kafka push address based on an asynchronous push method.
[0027] In a second aspect, an embodiment of the present application provides a business data collection device, including:
[0028] A target class method acquisition module is used to obtain the target class method of the data to be collected in the target application;
[0029] A plug-in configuration parameter generation module, used to generate plug-in configuration parameters according to the application information of the target application and the method attribute information of the target class method;
[0030] A plug-in configuration parameter adding module, used to add the plug-in configuration parameters in the external data acquisition plug-in;
[0031] A data acquisition plug-in startup module, used for starting the external data acquisition plug-in in response to starting the target application;
[0032] The business process data collection module is used to call the external data collection plug-in to collect the business process data corresponding to the target class method.
[0033] Optionally, the plug-in configuration parameter generation module includes:
[0034] An application name obtaining unit, used to obtain the application name of the target application;
[0035] A method attribute acquisition unit, used to acquire the class name, method name, request parameter name, request parameter position order and json path expression of the target class method;
[0036] A plug-in configuration parameter generating unit is used to generate the plug-in configuration parameters according to the application name, the class name, the method name, the request parameter name, the request parameter position order and the json path expression.
[0037] Optionally, the business process data collection module includes:
[0038] A tracking object creation unit, used to create a tracking object corresponding to the target class method after the external data acquisition plug-in is started;
[0039] A loading event monitoring unit, configured to monitor the loading event of the target class method based on the tracking object;
[0040] The business data collection unit is used to collect the business process data corresponding to the target class method according to the loading event.
[0041] Optionally, the device further comprises:
[0042] Push address acquisition module, used to obtain the Kafka push address;
[0043] The push address adding module is used to add the Kafka push address to the external data collection plug-in.
[0044] Optionally, the device further comprises:
[0045] A string conversion module, used to convert the business process data into a json string;
[0046] The string push module is used to push the json string to the data collection platform based on the kafka push address.
[0047] Optionally, the string push module includes:
[0048] The string push unit is used to push the JSON string to the data collection platform through the Kafka push address based on an asynchronous push mode when the target class method is at least two class methods.
[0049] In a third aspect, an embodiment of the present application provides an electronic device, including:
[0050] A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the above-mentioned business data collection methods is implemented.
[0051] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute any of the business data collection methods described above.
[0052] Compared with the prior art, the embodiments of the present application have the following advantages:
[0053] In the embodiment of the present application, by obtaining the target class method of the data to be collected in the target application, generating plug-in configuration parameters according to the application information of the target application and the method attribute information of the target class method, adding the plug-in configuration parameters in the external data collection plug-in, in response to the start of the target application, starting the external data collection plug-in, calling the external data collection plug-in, and collecting the business process data corresponding to the target class method. The non-intrusive data collection plug-in provided in the embodiment of the present application performs parameter configuration of the specified class method when collecting business data, and can realize targeted business data collection. Moreover, the plug-in provided in the embodiment only collects business data, and has a low impact on the performance of the service software.
[0054] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 A flowchart of a method for collecting business data provided by an embodiment of the present application;
[0056] Figure 2A schematic diagram of a plug-in application scenario provided in an embodiment of the present application;
[0057] Figure 3 A schematic diagram of a technical framework for implementing a plug-in provided in an embodiment of the present application;
[0058] Figure 4 A schematic diagram of a plug-in collecting business data flow provided in an embodiment of the present application;
[0059] Figure 5 A schematic diagram of the structure of a business data collection device provided in an embodiment of the present application;
[0060] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0061] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0062] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0063] Embodiment 1
[0064] Reference Figure 1 , shows a flow chart of the steps of a business data collection method provided by an embodiment of the present application, such as Figure 1 As shown, the business data collection method may specifically include the following steps:
[0065] Step 101: Obtain the target class method of the data to be collected in the target application.
[0066] The embodiments of the present application can be applied to configure parameters of a data collection plug-in according to a target class method of the data to be collected, so as to achieve a scenario of targeted data collection.
[0067] The external data collection plug-in provided in this embodiment is a plug-in external to the application. The external data collection plug-in can be a plug-in pre-configured in the system. When collecting business data of a specified class method for a Java application, corresponding parameter configuration can be performed in the external data collection plug-in.
[0068] The target application refers to an application that needs to collect business data. In this example, the target application can be a microservice or other types of applications, such as a video application or a social application. Specifically, the specific type of the target application can be determined according to actual needs, and this embodiment does not limit this.
[0069] In this example, the number of target applications may be one or more. Specifically, the number of target applications may be determined according to business requirements, and this embodiment does not impose any limitation on this.
[0070] The target class method refers to the method loaded during the operation of the target application that needs to be collected. The method refers to the JavaScript function called by the object.
[0071] In this example, the target class method may be one method or multiple methods. Specifically, the number of target class methods may be determined according to business requirements, and this embodiment does not impose any limitation on this.
[0072] When it is necessary to collect business data of a target class method in a target application during loading, the target class method of the target application for data to be collected can be obtained.
[0073] After obtaining the target class method of the target application program for collecting data, step 102 is executed.
[0074] Step 102: Generate plug-in configuration parameters according to the application information of the target application and the method attribute information of the target class method.
[0075] Plug-in configuration parameters refer to parameters used to configure in an external data collection plug-in. Through the plug-in configuration parameters, business process data corresponding to a specified class method in the target application can be collected.
[0076] After obtaining the target class method of the target application to collect data, the plug-in configuration parameters can be generated according to the application information of the target application and the method attribute information of the target class method. Specifically, the generation process of the plug-in configuration parameters can be described in detail in conjunction with the following specific implementation method.
[0077] In a specific implementation of the present application, the above step 102 may include:
[0078] Sub-step A1: Obtain the application name of the target application.
[0079] In this embodiment, when configuring parameters in the external data collection plug-in, the application name of the target application can be obtained. For example, the target application takes microservices as an example. There are many microservices. If one or more microservices are required to collect business data of a specified class method, it is necessary to obtain the microservice name of one or more microservices as a configuration parameter.
[0080] It can be understood that the above examples are merely examples listed for a better understanding of the technical solutions of the embodiments of the present application, and are not intended to be the sole limitation to the embodiments.
[0081] Sub-step A2: Obtain the class name, method name, request parameter name, request parameter position order and json path expression of the target class method.
[0082] When it is determined that the business data corresponding to the target class method of the target application needs to be collected, the class name, method name, request parameter name, request parameter position order and json path expression of the target class method can be obtained.
[0083] Sub-step A3: Generate the plug-in configuration parameters according to the application name, the class name, the method name, the request parameter name, the request parameter position order and the json path expression.
[0084] After obtaining the application name, class name of the target class method, method name, request parameter name, request parameter position order and json path expression, the plug-in configuration parameters can be generated according to the application name, class name of the target class method, method name, request parameter name, request parameter position order and json path expression, that is, the application name, class name of the target class method, method name, request parameter name, request parameter position order and json path expression are used as configuration parameters of the external data collection plug-in to configure the parameters of the external data collection plug-in. The parameter configuration process will be described in detail in the following steps and will not be repeated in this embodiment.
[0085] After the plug-in configuration parameters are generated according to the application information of the target application and the method attribute information of the target class method, step 103 is executed.
[0086] Step 103: Add the plug-in configuration parameters in the external data acquisition plug-in.
[0087] After generating the plug-in configuration parameters based on the application information of the target application and the method attribute information of the target class method, you can add the obtained plug-in configuration parameters in the external data collection plug-in to complete the plug-in parameter configuration process. Specifically, before using ETE-AGENT (i.e., the external data collection plug-in), you need to configure the tracking points and kafka push configurations that need to be collected, add the application name, the class name of the tracking point method, the method name, the parameters (the request parameter name must be consistent with the request parameter name in the method, and the request parameter position order must be consistent with the request parameter position in the method), jsonpath expression, and kafka push address. The configuration must be accurate, otherwise an exception will occur and the target application cannot be started.
[0088] In this example, the external data collection plug-in may be a plug-in generated by Byte-Buddy bytecode, and the generated external data collection plug-in code may be as follows:
[0089]
[0090]
[0091] After adding the plug-in configuration parameters in the external data acquisition plug-in, step 104 is executed.
[0092] Step 104: In response to the target application being started, starting the external data acquisition plug-in.
[0093] After adding the plug-in configuration parameters in the external data collection plug-in, when the user starts the target application, the external data collection plug-in can be started simultaneously in response to the start of the target application. Specifically, when starting the Java application, a startup command is added at the same time, such as -javaagent:agent.jar="config.yml", so that the external data collection plug-in and the Java application can be started at the same time.
[0094] After starting the external data acquisition plug-in, execute step 105.
[0095] Step 105: Call the external data collection plug-in to collect the business process data corresponding to the target class method.
[0096] After starting the external data collection plug-in, the external data collection plug-in can be called to collect the business process data corresponding to the target class method in the target application. Specifically, it can be described in detail in combination with the following specific implementation method.
[0097] In a specific implementation of the present application, the above step 105 may include:
[0098] Sub-step B1: after the external data acquisition plug-in is started, a tracking object corresponding to the target class method is created.
[0099] In this embodiment, after the external data collection plug-in is started, a tracking object corresponding to the target class method can be created.
[0100] After creating the tracking object corresponding to the target class method, execute sub-step B2.
[0101] Sub-step B2: monitoring the loading event of the target class method based on the tracking object.
[0102] After creating the tracking event corresponding to the target class method, the loading event of the target class method can be monitored based on the tracking object.
[0103] Sub-step B3: According to the loading event, the business process data corresponding to the target class method is collected.
[0104] After monitoring the loading event of the target class method, the business process data corresponding to the target class method can be collected according to the loading event.
[0105] The above process can be combined with Figure 4 This is described in detail as follows.
[0106] like Figure 4 As shown in the figure, the ByteBuddy bytecode manipulation library will modify the instrumentation method in the configuration when the Java application is running, request the target JVM to load the corresponding agent through the jvm's attach mechanism, and create an InstrumentationImpl object to track a running JVM and monitor the status information at the class and method levels. After creating the InstrumentationImpl object, you can read the loaded bytecode file through the InstrumentationImpl object, listen to the ClassFileLoadHook event, and call the agentmain method of the Agentmain-Class class in the javaagent. ETE-AGENT will collect the class name, method name, request parameters, response parameters in the instrumentation, and calculate the method execution time. At the same time, it uses the MDC function provided by log4j and logback to obtain the parameters required for the log link such as traceid in this interface call thread.
[0107] In this embodiment, the external data collection plug-in can intercept the specified JAVA class method, obtain the request parameters and response parameters of the method, and also obtain the parameters passed when the interface involving the method is called. When collecting business process data, asynchronous threads can be used to collect business process data.
[0108] In this embodiment, when configuring parameters for the external data collection plug-in, the Kafka push address can also be obtained and the Kafka push address can be added to the external data collection plug-in.
[0109] The configuration code for the kafka push address can be as follows:
[0110]
[0111] It can be understood that the above code example is only an example of a plug-in listed for better understanding the plug-in of the embodiment of the present application, and is not the only limitation to the embodiment.
[0112] The Kafka push address is configured in the external data collection plug-in. After the business process data is collected, the collected business process data can also be pushed to the data collection platform through the Kafka push address. Specifically, it can be described in detail in combination with the following specific implementation method.
[0113] In another specific implementation of the present application, after the above step 105, the following may also be included:
[0114] Step C1: Convert the business process data into a json string.
[0115] In this embodiment, after the business process data is collected, the business process data can be converted into a json string.
[0116] After converting the business process data into a json string, execute step C2.
[0117] Step C2: Based on the kafka push address, push the json string to the data collection platform.
[0118] After the business process data is converted into a JSON string, the JSON string can be pushed to the data collection platform based on the Kafka push address.
[0119] Of course, when the target class method is at least two class methods, the json string can be pushed to the data collection platform through the kafka push address based on the asynchronous push method to improve the efficiency of data push. Figure 2 As shown, ETE-AGENT (i.e., external data collection plug-in) can collect targeted data for software services. After collecting business process data, the collected business process data can be pushed to the data collection platform. In the specific implementation, some configuration parameters of the software service can also be saved in the database in advance. After the software service is changed later, only the content in the database needs to be changed, and then the configuration parameters in the plug-in can be adjusted.
[0120] The configuration of the external data collection plug-in and the collection process of business process data in this embodiment can be combined with Figure 3 This is described in detail as follows.
[0121] like Figure 3 As shown, the overall process can include the following steps:
[0122] 1. The target class method that can obtain the data to be collected in the JAVA program;
[0123] 2. After obtaining the target class method, configure the agent (plugin), that is, configure the plug-in parameters according to the tracking point class name method, jsonpath expression, tracking point input parameters and kafka configuration;
[0124] 3. Data collection, which can obtain business process data such as tracking logs, log link parameters, tracking input parameters, tracking response parameters, etc.
[0125] 4. Data collation: After obtaining the business process data, the business process data can be converted into a JSON string, that is, the parameters are intercepted through jsonpath, and json formatted, and then the formatted xml file is converted into a json string;
[0126] 5. Data push: push the converted JSON string to the data collection platform based on the Kafka push address configured in the plug-in.
[0127] The embodiment of the present application is compatible with various modes of business data collection for software services. It can technically support jsonpath expressions to obtain data in request parameters and response parameters, and support JSON formatting of request parameters and response parameters in XML format. It also supports the integration of MDC functions provided by log frameworks such as log4j and logback, and can obtain parameters passed in the interface call thread.
[0128] At the same time, by taking advantage of its own business tracking points and combining with products such as Pinpoint or SkyWalking that focus on "processes", it can not only meet the full process tracking of software services, but also meet the capture of business data, and fully take into account the full process tracking and business link collection. Through the combination, by associating the unique identifier of the call chain with the unique identifiers of the upstream and downstream businesses, it can eventually form end-to-end monitoring based on business and processes.
[0129] The business data collection method provided in the embodiment of the present application obtains the target class method of the data to be collected in the target application, generates plug-in configuration parameters according to the application information of the target application and the method attribute information of the target class method, adds the plug-in configuration parameters in the external data collection plug-in, and starts the external data collection plug-in in response to the start of the target application, calls the external data collection plug-in, and collects the business process data corresponding to the target class method. The non-intrusive data collection plug-in provided in the embodiment of the present application performs parameter configuration of the specified class method when performing business data collection, which can realize targeted business data collection, and the plug-in provided in this embodiment only collects business data, which has a low impact on the performance of the service software.
[0130] Embodiment 2
[0131] Reference Figure 5 , shows a schematic diagram of the structure of a business data collection device provided in an embodiment of the present application, such as Figure 5 As shown, the business data collection device 500 may include the following modules:
[0132] The target class method acquisition module 510 is used to acquire the target class method of the data to be collected in the target application;
[0133] A plug-in configuration parameter generating module 520, configured to generate plug-in configuration parameters according to the application information of the target application and the method attribute information of the target class method;
[0134] A plug-in configuration parameter adding module 530, used to add the plug-in configuration parameters in the external data acquisition plug-in;
[0135] A data acquisition plug-in starting module 540 is used to start the external data acquisition plug-in in response to the target application starting;
[0136] The business process data collection module 550 is used to call the external data collection plug-in to collect the business process data corresponding to the target class method.
[0137] Optionally, the plug-in configuration parameter generating module 520 includes:
[0138] An application name obtaining unit, used to obtain the application name of the target application;
[0139] A method attribute acquisition unit, used to acquire the class name, method name, request parameter name, request parameter position order and json path expression of the target class method;
[0140] A plug-in configuration parameter generating unit is used to generate the plug-in configuration parameters according to the application name, the class name, the method name, the request parameter name, the request parameter position order and the json path expression.
[0141] Optionally, the business process data collection module 550 includes:
[0142] A tracking object creation unit, used to create a tracking object corresponding to the target class method after the external data acquisition plug-in is started;
[0143] A loading event monitoring unit, configured to monitor the loading event of the target class method based on the tracking object;
[0144] The business data collection unit is used to collect the business process data corresponding to the target class method according to the loading event.
[0145] Optionally, the device further comprises:
[0146] Push address acquisition module, used to obtain the Kafka push address;
[0147] The push address adding module is used to add the Kafka push address to the external data collection plug-in.
[0148] Optionally, the device further comprises:
[0149] A string conversion module, used to convert the business process data into a json string;
[0150] The string push module is used to push the json string to the data collection platform based on the kafka push address.
[0151] Optionally, the string push module includes:
[0152] The string push unit is used to push the JSON string to the data collection platform through the Kafka push address based on an asynchronous push mode when the target class method is at least two class methods.
[0153] The business data collection device provided by the embodiment of the present application obtains the target class method of the data to be collected in the target application, generates plug-in configuration parameters according to the application information of the target application and the method attribute information of the target class method, adds the plug-in configuration parameters in the external data collection plug-in, starts the external data collection plug-in in response to the start of the target application, calls the external data collection plug-in, and collects the business process data corresponding to the target class method. The non-intrusive data collection plug-in provided by the embodiment of the present application performs parameter configuration of the specified class method when performing business data collection, and can realize targeted business data collection. Moreover, the plug-in provided by the embodiment only collects business data, and has a low impact on the performance of the service software.
[0154] Embodiment 3
[0155] Reference Figure 6 , shows a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Figure 6 As shown, the electronic device 600 may be provided as a server. Figure 6 , the electronic device 600 includes a processing component 622, which further includes one or more processors, and a memory resource represented by a memory 632 for storing instructions executable by the processing component 622, such as an application. The application stored in the memory 632 may include one or more modules each corresponding to a set of instructions. In addition, the processing component 622 is configured to execute instructions to perform the following method:
[0156] The target class method for obtaining the data to be collected in the target application;
[0157] Generate plug-in configuration parameters according to the application information of the target application and the method attribute information of the target class method;
[0158] Add the plug-in configuration parameters in the external data acquisition plug-in;
[0159] In response to the target application being started, starting the external data acquisition plug-in;
[0160] The external data collection plug-in is called to collect the business process data corresponding to the target class method.
[0161] Optionally, generating the plug-in configuration parameters according to the application information of the target application and the method attribute information of the target class method includes:
[0162] Get the application name of the target application;
[0163] Get the class name, method name, request parameter name, request parameter position order and json path expression of the target class method;
[0164] The plug-in configuration parameters are generated according to the application name, the class name, the method name, the request parameter name, the request parameter position order and the json path expression.
[0165] Optionally, calling the external data collection plug-in to collect the business process data corresponding to the target class method includes:
[0166] After the external data acquisition plug-in is started, a tracking object corresponding to the target class method is created;
[0167] Monitoring a loading event of the target class method based on the tracking object;
[0168] According to the loading event, the business process data corresponding to the target class method is collected.
[0169] Optionally, before adding the plug-in configuration parameters in the external data acquisition plug-in, the method further includes:
[0170] Get the kafka push address;
[0171] Add the kafka push address to the external data collection plug-in.
[0172] Optionally, after calling the external data collection plug-in to collect the business process data corresponding to the target class method, the method further includes:
[0173] Convert the business process data into a json string;
[0174] Based on the kafka push address, the json string is pushed to the data collection platform.
[0175] Optionally, the pushing the json string to the data collection platform based on the kafka push address includes:
[0176] In the case where the target class method is at least two class methods, the json string is pushed to the data collection platform through the kafka push address based on an asynchronous push method.
[0177] In addition, an embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the above-mentioned business data collection method is implemented.
[0178] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0179] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0180] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0181] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminals (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0182] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0183] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal so that a series of operating steps are executed on the computer or other programmable terminal to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable terminal. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0184] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.
[0185] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or terminal including the elements.
[0186] The above is a detailed introduction to a business data collection method, a business data collection device, an electronic device and a computer-readable storage medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A business data collection method, characterized in that: include: The target class method for obtaining the data to be collected in the target application; Generate plug-in configuration parameters according to the application information of the target application and the method attribute information of the target class method; Add the plug-in configuration parameters in the external data acquisition plug-in; In response to the target application being started, starting the external data acquisition plug-in; Calling the external data collection plug-in to collect the business process data corresponding to the target class method; The generating of plug-in configuration parameters according to the application information of the target application and the method attribute information of the target class method includes: Get the application name of the target application; Get the class name, method name, request parameter name, request parameter position order and json path expression of the target class method; Generate the plug-in configuration parameters according to the application name, the class name, the method name, the request parameter name, the request parameter position order and the json path expression; The calling of the external data collection plug-in to collect the business process data corresponding to the target class method includes: After the external data acquisition plug-in is started, a tracking object corresponding to the target class method is created; Monitoring a loading event of the target class method based on the tracking object; According to the loading event, the business process data corresponding to the target class method is collected.
2. The method according to claim 1, characterized in that Before adding the plug-in configuration parameters in the external data acquisition plug-in, the method further includes: Get the Kafka push address; Add the kafka push address to the external data collection plug-in.
3. The method according to claim 2, characterized in that After calling the external data collection plug-in to collect the business process data corresponding to the target class method, the method further includes: Convert the business process data into a json string; Based on the kafka push address, the json string is pushed to the data collection platform.
4. The method according to claim 3, characterized in that The method of pushing the json string to the data collection platform based on the kafka push address includes: In the case where the target class method is at least two class methods, the json string is pushed to the data collection platform through the kafka push address based on an asynchronous push method.
5. A business data collection device, characterized in that: include: A target class method acquisition module is used to obtain the target class method of the data to be collected in the target application; A plug-in configuration parameter generation module, used to generate plug-in configuration parameters according to the application information of the target application and the method attribute information of the target class method; A plug-in configuration parameter adding module, used to add the plug-in configuration parameters in the external data acquisition plug-in; A data acquisition plug-in startup module, used for starting the external data acquisition plug-in in response to starting the target application; A business process data collection module, used to call the external data collection plug-in to collect the business process data corresponding to the target class method; The plug-in configuration parameter generation module includes: An application name obtaining unit, used to obtain the application name of the target application; A method attribute acquisition unit, used to acquire the class name, method name, request parameter name, request parameter position order and json path expression of the target class method; A plug-in configuration parameter generating unit, used to generate the plug-in configuration parameters according to the application name, the class name, the method name, the request parameter name, the request parameter position order and the json path expression; The business process data collection module includes: A tracking object creation unit, used to create a tracking object corresponding to the target class method after the external data acquisition plug-in is started; A loading event monitoring unit, configured to monitor the loading event of the target class method based on the tracking object; The business data collection unit is used to collect the business process data corresponding to the target class method according to the loading event.
6. The device according to claim 5, characterized in that The device also includes: Push address acquisition module, used to obtain the Kafka push address; The push address adding module is used to add the Kafka push address to the external data collection plug-in.
7. The device according to claim 6, characterized in that The device also includes: A string conversion module, used to convert the business process data into a json string; The string push module is used to push the JSON string to the data collection platform based on the Kafka push address.
8. The device according to claim 7, characterized in that The string push module includes: The string push unit is used to push the json string to the data collection platform through the kafka push address based on an asynchronous push mode when the target class method is at least two class methods.
9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the business data collection method according to any one of claims 1 to 4 when executing the program.
10. A computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the business data collection method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Monitoring data processing method, equipment, server and storage medium
CN107704360A
Business platform test method, device and system
CN111258897A
Method and device for collecting data and electronic equipment
CN114328088A
Hot update method and device of log collection plug-in, electronic equipment and readable medium
CN114371888A
System and method for monitoring user interaction with web pages
WO2000075814A1