A system data collection method, device, computer equipment and storage medium
Obtain custom data acquisition configuration information through Java agent program, and realize the collection of system data without intruding into system code, solving the problems of low data acquisition efficiency and poor flexibility in the existing technology, and improving the flexibility of system data acquisition and efficient.
Patent Information
- Application Number
- CN202110430985.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-21
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2041-04-21
AI Technical Summary
Existing system data acquisition methods require intrusion of business code when collecting custom data, resulting in low data acquisition efficiency and poor flexibility, which cannot meet users' flexible configuration needs.
The Java agent program obtains custom data acquisition configuration information, including method data acquisition configuration information and request data acquisition configuration information, and automatically collects target data of the target system to achieve data acquisition without intruding into the system code.
It improves the flexibility and efficiency of system data acquisition, reduces the labor and time cost of users during the data acquisition process, and allows users to focus on the development of business functions.
Smart Images

Figure CN113094236B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of data processing technology, and in particular to a system data acquisition method, device, computer equipment and storage medium. Background Art
[0002] A system (including hardware system and / or software system) is usually an organic whole with specific functions, which is composed of several components that interact and depend on each other.
[0003] During the operation of the system, a variety of data will be generated. In the daily maintenance of the system, it is often necessary to collect data in the system in order to analyze the system based on the collected data. For example, the APM (Application Performance Monitor) system is a tool that can help understand system behavior and analyze performance problems so that problems can be quickly located and solved when a system failure occurs. The APM system can collect system data through various probes, collect key indicators of the system, and present data to achieve application performance management and fault management.
[0004] In the process of realizing the present invention, the inventor found that the prior art has the following defects: for systems that have been opened or put into operation, the collection of system data can usually only be completed according to the established functions of the system. For example, the traditional APM system can only collect system data of types such as the time of system execution, the operating status of the system, and abnormal data generated by the system. If the user needs to collect other types of system data of interest through the APM system, it is necessary to use the API (Application Program Interface) of the open source APM specification by invading the business code of the APM system to collect the customized data that meets the collection requirements in the system. It can be seen that the system data types collected according to the established functions of the system are too single, and the user cannot configure and manage the collected data according to their own needs, and the flexibility of data collection is poor. At the same time, if the user needs to collect customized data types, it is necessary to invade the business code of the data collection system, and it is impossible to focus on the development of the business functions of the data collection system, resulting in low data collection efficiency. Summary of the invention
[0005] The embodiments of the present invention provide a system data collection method, apparatus, computer equipment and storage medium, which can realize on-demand collection of system data without intruding system code, thereby improving the flexibility and efficiency of system data collection.
[0006] In a first aspect, an embodiment of the present invention provides a system data collection method, which is applied to a Java agent program, comprising:
[0007] Obtaining custom data collection configuration information; wherein the custom data collection configuration information includes method data collection configuration information and / or request data collection configuration information, the method data collection configuration information is used to collect associated system data of the target class method, and the request data collection configuration information is used to collect associated system data of the target request;
[0008] The target system data of the target system is collected according to the custom data collection configuration information.
[0009] In a second aspect, an embodiment of the present invention further provides a system data acquisition device, configured in a Java agent program, comprising:
[0010] An information acquisition module, used to acquire custom data collection configuration information; wherein the custom data collection configuration information includes method data collection configuration information and / or request data collection configuration information, the method data collection configuration information is used to collect the associated system data of the target class method, and the request data collection configuration information is used to collect the associated system data of the target request;
[0011] The data collection module is used to collect target system data of the target system according to the custom data collection configuration information.
[0012] In a third aspect, an embodiment of the present invention further provides a computer device, the computer device comprising:
[0013] one or more processors;
[0014] A storage device for storing one or more programs;
[0015] When the one or more programs are executed by the one or more processors, the one or more processors implement the system data acquisition method provided by any embodiment of the present invention.
[0016] In a fourth aspect, an embodiment of the present invention further provides a computer storage medium on which a computer program is stored, and when the program is executed by a processor, the system data acquisition method provided by any embodiment of the present invention is implemented.
[0017] The embodiment of the present invention obtains custom data collection configuration information including method data collection configuration information and / or request data collection configuration information through a Java agent program, so as to collect target system data of the target system according to the custom data collection configuration information. Since the method data collection configuration information can be used to collect the associated system data of the target class method, and the request data collection configuration information can be used to collect the associated system data of the target request, the custom target system data in the target system can be collected according to the custom data collection configuration information, so as to solve the problems of low data collection efficiency and poor flexibility in the existing system data collection method that collects custom data by invading the system's business code, and can realize on-demand collection of system data without invading the system code, thereby improving the flexibility and efficiency of system data collection. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 is a flow chart of a system data collection method provided by Embodiment 1 of the present invention;
[0019] Figure 2 is a flow chart of a system data collection method provided by Embodiment 2 of the present invention;
[0020] Figure 3 It is a flow chart of a Java agent program provided in the second embodiment of the present invention collecting target system data of a target system according to method data collection configuration information;
[0021] Figure 4 is a schematic diagram of a system data acquisition device provided by Embodiment 3 of the present invention;
[0022] Figure 5 A schematic diagram of the structure of a computer device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0023] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention.
[0024] It should also be noted that, for ease of description, only the part relevant to the present invention but not all content is shown in the accompanying drawings. It should be mentioned before discussing exemplary embodiments in more detail that some exemplary embodiments are described as processing or methods depicted as flow charts. Although the flow chart describes each operation (or step) as sequential processing, many operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. When its operation is completed, the processing can be terminated, but it can also have additional steps not included in the accompanying drawings. The processing can correspond to methods, functions, procedures, subroutines, subprograms, etc.
[0025] Embodiment 1
[0026] Figure 1 This is a flow chart of a system data collection method provided by the first embodiment of the present invention. This embodiment is applicable to the case where system data is collected on demand without intruding the system code. The method can be applied to a Javaagent program and executed by a system data collection device. The device can be implemented by software and / or hardware and can generally be integrated in a computer device and used in conjunction with the target system for collecting data. Figure 1 As shown, the method includes the following operations:
[0027] S110. Obtain custom data collection configuration information; wherein the custom data collection configuration information includes method data collection configuration information and / or request data collection configuration information, the method data collection configuration information is used to collect associated system data of the target class method, and the request data collection configuration information is used to collect associated system data of the target request.
[0028] Among them, the custom data collection configuration information may be user-defined configuration information for collecting user-defined system data types. The method data collection configuration information may be user-defined configuration information for collecting system data types of specified class methods, and the target class method may be a class and / or method specified by the user. The associated system data of the target class method may be data associated with the specified class and / or method, such as system data of the parameters, return values, and return values of the specified operations of the specified class and / or method, and the embodiment of the present invention does not limit the specific type of the associated system data of the target class method. The request data collection configuration information may be user-defined configuration information for collecting request data types in the target system. The target request may be a user-specified request type, such as an HTTP (HyperText Transfer Protocol) request, and the embodiment of the present invention does not limit the specific request type of the target request. The associated system data of the target request may be data associated with the target request, such as request parameters or cookies of the target request, and the embodiment of the present invention also does not limit the specific data type of the associated system data of the target request.
[0029] In an embodiment of the present invention, for a system that has been developed or has been put into operation, when collecting other types of data of the system, there is no need for the user to invade the business code of the system. The user can use the Java agent program to obtain custom data collection configuration information including method data collection configuration information and / or request data collection configuration information. It is understandable that before performing system data collection, the user can pre-configure the custom data collection configuration information. After the user configures the custom data collection configuration information, the Java agent program can automatically obtain the custom data collection configuration information.
[0030] S120: Collect target system data of the target system according to the custom data collection configuration information.
[0031] The target system may be a system that needs to collect data on demand. The target system data is one or more types of system data in the target system that meet the user's data collection requirements.
[0032] Correspondingly, after the Java agent program automatically obtains the custom data collection configuration information, the target system data of the target system can be automatically collected according to the obtained custom data collection configuration information.
[0033] In an optional embodiment of the present invention, the target system may include a system managed by an APM system; the obtaining of the custom data collection rule includes: obtaining the custom data collection configuration information configured by the user in the console of the APM system.
[0034] In an embodiment of the present invention, optionally, the target system can be a system managed by an APM system. The APM system can collect data from the target system through various probes, collect key indicators of the target system, and use the collected data to implement application performance management and fault management for the target system. Correspondingly, the user can configure custom data collection configuration information in the console of the APM system. After the user completes the configuration of the custom data collection configuration information, the Java agent program can automatically obtain the user-configured custom data collection configuration information from the console of the APM system, thereby collecting the target system data of the target system according to the obtained custom data collection configuration information. Optionally, the Java agent program can be integrated in the target system or in the APM system, and the embodiment of the present invention does not limit this.
[0035] It can be seen that in the system data collection method provided by the embodiment of the present invention, during the entire data collection process, the user only needs to pre-configure the relevant configuration information for collecting the target system data without invading the business code of the target system. In other words, the user does not need to waste a lot of time and cost to develop additional data collection code programs, so that the user can focus on the development of the business functions of the target system, which can not only improve the flexibility of system data collection, but also improve the efficiency of system data collection.
[0036] The embodiment of the present invention obtains custom data collection configuration information including method data collection configuration information and / or request data collection configuration information through a Java agent program, so as to collect target system data of the target system according to the custom data collection configuration information. Since the method data collection configuration information can be used to collect the associated system data of the target class method, and the request data collection configuration information can be used to collect the associated system data of the target request, the custom target system data in the target system can be collected according to the custom data collection configuration information, so as to solve the problems of low data collection efficiency and poor flexibility in the existing system data collection method that collects custom data by invading the system's business code, and can realize on-demand collection of system data without invading the system code, thereby improving the flexibility and efficiency of system data collection.
[0037] Embodiment 2
[0038] Figure 2is a flow chart of a system data collection method provided by the second embodiment of the present invention. This embodiment is specific based on the above embodiment. In this embodiment, specific information content included in the custom data collection configuration information is provided, and multiple specific optional implementation methods for collecting target system data of the target system according to the custom data collection configuration information are provided. Figure 2 As shown, the method of this embodiment may include:
[0039] S210: Obtain custom data collection configuration information.
[0040] In an optional embodiment of the present invention, the method data collection configuration information may include a target class method association identifier, a target class method matching rule and a target data source object: the target class method association identifier may include a target class association identifier and / or a target method association identifier; the target class method matching rule may include a parameter matching rule and / or a return value matching rule; the target data source object may include at least one of a target parameter object, a target return value object or a target attribute object; the request data collection configuration information may include a target collection object; the target collection object may include at least one of a URL (Uniform Resource Locator), request parameters, Cookies, Session (session control), a request object and request object attributes.
[0041] Among them, the target class method association identifier can be an identifier of a class and / or method specified by the user, such as a name or annotation, etc., and the embodiment of the present invention does not limit the specific identifier type of the target class method association identifier. The target class association identifier can be a related identifier of a class specified by the user, and the target method association identifier can be a related identifier of a method specified by the user. The target class method matching rule can be a matching rule of the target class method, which is used to determine whether the class and / or method in the target system is a target class method specified by the user. The parameter matching rule can be a matching rule set by the user for the specified target parameter, and the return value matching rule can be a matching rule set by the user for the specified target return value. Optionally, the target class method matching rule can adopt a regular expression or a fuzzy matching rule, etc., and the embodiment of the present invention does not limit the specific rule type of the target class method matching rule. The target data source object can be a data source object that generates target system data in the target class method, such as a specified parameter or return value type in the target class method. The embodiment of the present invention also does not limit the specific data source object type of the target data source object. The target parameter object is also the target parameter type specified by the user, the target return value object is also the target return value type specified by the user, and the target attribute object can be a certain attribute value in the target parameter object and / or the target return value object. The request object may be an object for data request processing, and the request object attribute may be certain attributes of the request object.
[0042] Optionally, the user can configure data collection for a method of a class in the user-defined data collection configuration module provided by the system console (the console can be the console of the target system or a console associated with the target system, such as the console of the APM system, etc.), which can include class and method settings, matching rules and collection data configuration items, as well as data collection configuration for separate request data, and can configure the request scope to which the collection rules apply.
[0043] Optionally, when configuring the method data collection configuration information, the user can specifically set the target class method association identifier, the target class method matching rules, and the target data source object. Among them, the target class method association identifier can support the matching of the target class and / or the target method. Exemplarily, the target class association identifier can be matched in multiple ways such as the full class name of the target class, the relevant interface, the parent class to which it belongs, and the relevant annotations. As long as the target class association identifier exists in the full class name, the relevant interface, the parent class to which it belongs, and the relevant annotations of a certain class, it means that the target class matches successfully. The target method association identifier can be matched in the form of a complete method. As long as the complete method name of a certain method is the same as the target class method association identifier, it means that the target method matches successfully. If there is a method overloading situation, a certain overloaded method can be matched by additionally specifying the method parameter signature. At the same time, when the user configures the target class method matching rules, the matching rules of the target parameters and / or the target return value can be set, and the collection parameter object, the return value object, or a certain attribute value of the object can be set as the target data source object.
[0044] Optionally, when configuring the request data collection configuration information, the user can specifically set one or more target collection objects for the request data. The target collection objects for the request data may include but are not limited to at least one of the URL, request parameters, Cookies, Session, request object and request object attributes.
[0045] S220 , determining whether the user-defined data collection configuration information only includes method data collection configuration information, if so, executing S230 , otherwise executing S270 .
[0046] Accordingly, after obtaining the custom data collection configuration information, the Java agent program can analyze the information type of the custom data collection configuration information. If the Java agent program determines that the custom data collection configuration information only includes method data collection configuration information, the target system data of the target system can be collected only according to the method data collection configuration information.
[0047] S230: Obtain a target class association identifier in the method data collection configuration information.
[0048] It is understandable that a class contains attributes and methods. Therefore, a target method association identifier also corresponds to a target class association identifier.
[0049] S240: Reload the target class method corresponding to the target class association identifier in the target virtual machine.
[0050] The target virtual machine may be used to reload the target class association identifier, and the type of the target virtual machine may be, for example, JVM (Java Virtual Machine), etc. The embodiment of the present invention does not limit the type of the target virtual machine.
[0051] Figure 3 1 is a flow chart of a Java agent program provided in the second embodiment of the present invention collecting target system data of a target system according to method data collection configuration information. In a specific example, Figure 3 As shown, when the Java agent program collects target system data of the target system only according to the method data collection configuration information, it can obtain the target class association identifier in the method data collection configuration information, and reload the target class method corresponding to the target class association identifier in the target virtual machine, so that the target class and / or target method corresponding to the target class association identifier are reloaded and run.
[0052] S250. When it is determined that the reloaded target class method matches the target class method matching rule, perform a data acquisition logic insertion operation on the target data source object of the target class method according to a data acquisition program.
[0053] The to-be-matched class method association identifier may include a to-be-matched class association identifier and / or a to-be-matched method association identifier. The to-be-matched class association identifier may be a related identifier of a class that needs to be matched with a target class method matching rule, and may include but is not limited to the full class name of the class, related interfaces, parent classes, related annotations, and the full method name of the method. The data collection program may be a subroutine set in a Java agent program for collecting target system data.
[0054] like Figure 3 As shown, after the Java agent program reloads the target class and / or target method in the target virtual machine, it can continue to determine whether the reloaded target class and / or target method matches the target class method matching rule preset by the user. When it is determined that the reloaded target class method matches the target class method matching rule, the Java agent program can trigger the data acquisition program, and use the data acquisition program to perform a data acquisition logic insertion operation on the target data source object of the target class method. The so-called data acquisition logic insertion operation is to insert a section of function code into the matching target class method, and the function code can implement the data acquisition logic function. Correspondingly, if it is determined that the reloaded target class method does not match the target class method matching rule, the Java agent program can refuse to perform the data acquisition logic insertion operation.
[0055] It can be seen that by automatically inserting code through the Java agent program to call the data collection logic, the automatic collection of target system data can be achieved without the user having to manually modify the business code.
[0056] In an optional embodiment of the present invention, determining whether the reloaded target class method matches the target class method matching rule may include: obtaining the to-be-matched parameters corresponding to the target class method; when it is determined that the to-be-matched parameters satisfy the parameter matching rule, determining that the target class method matches the target class method matching rule; and / or obtaining the to-be-matched return value corresponding to the target class method; when it is determined that the to-be-matched return value satisfies the return value matching rule, determining that the target class method matches the target class method matching rule.
[0057] The parameters to be matched may be all the parameters involved in the target class method, and the return values to be matched may be all the return values involved in the target class method.
[0058] Optionally, since the target class method matching rule can be configured to include parameter matching rules and / or return value matching rules. Therefore, when the Java agent program determines whether the reloaded target class method matches the target class method matching rule, it can obtain the parameters to be matched corresponding to the target class method, and match each parameter to be matched with the parameter matching rule one by one. If one or more parameter types in the parameters to be matched satisfy the parameter matching rule, it indicates that the target class method matches the target class method matching rule. And / or, the Java agent program can also obtain the return value to be matched corresponding to the target class method, and match each return value to be matched with the return value matching rule one by one. If one or more return value types in the return value to be matched satisfy the return value matching rule, it indicates that the target class method matches the target class method matching rule. Exemplarily, when at least one parameter and / or return value in the target method is the target data source object specified by the target class method matching rule, it is determined that the target method matches the target class method matching rule. When all parameters and all return values in the target method are not the target data source objects specified by the target class method matching rule, it is determined that the target method does not match the target class method matching rule.
[0059] S260: Automatically collect the target system data of the target system according to the data collection program.
[0060] Accordingly, after the Java agent program determines that the reloaded target class method matches the target class method matching rule and performs the data collection logic plug-in operation, the target system data of the target system can be automatically collected according to the data collection program.
[0061] S270, determine whether the custom data collection configuration information only includes the requested data collection configuration information, if so, execute S280, otherwise execute S2A0.
[0062] In the embodiment of the present invention, if the Java agent program determines that the custom data collection configuration information only includes the request data collection configuration information, the target system data of the target system may be collected only according to the request data collection configuration information.
[0063] S280: Acquire the target collection object in the request data collection configuration information and the global request data of the target system.
[0064] The global request data may be request data corresponding to all data requests in the target system.
[0065] In the embodiment of the present invention, when the Java agent program collects target system data of the target system only according to the request data collection configuration information, it can first obtain the target collection object configured in the request data collection configuration information and the global request data of the target system.
[0066] S290: When it is determined that the target acquisition data of the target acquisition object exists in the global request data, the target acquisition data is acquired and used as the target system data.
[0067] Correspondingly, the Java agent program can perform one-to-one matching judgment on the global request data of the target system. If it is determined that the type of target collection data of the target collection object exists in the global request data, the target collection data in the global request data can be collected and the collected target collection data can be used as the target system data.
[0068] Optionally, the user can also set the request range for the target collection data to take effect in the request data collection configuration information. For example, if the configuration takes effect under the / myload / collection request, the Java agent program only collects data under the / myload / collection request.
[0069] S2A0. Collect target system data of the target system simultaneously according to the method data collection configuration information and the request data collection configuration information.
[0070] In an embodiment of the present invention, if the Java agent program determines that the custom data collection configuration information includes both method data collection configuration information and request data collection configuration information, the target system data of the target system can be collected according to the request method data collection configuration information and the request data collection configuration information at the same time. Wherein, when the target system data of the target system is collected according to the request method data collection configuration information and the request data collection configuration information at the same time, the above-mentioned methods of collecting the target system data according to the method data collection configuration information and collecting the target system data according to the request data collection configuration information can be respectively executed in parallel.
[0071] It should be noted that Figure 2 This is only a schematic diagram of an implementation method, and there is no order of execution between steps S220-S260 and steps S270-S290. Steps S220-S260 may be executed first, and then steps S270-S290, or steps S270-S290 may be executed first, and then steps S220-S260, or both may be executed in parallel.
[0072] In an optional embodiment of the present invention, after the target system data of the target system is collected according to the custom data collection configuration information, it can also include: sending the target system data to the data server of the target system, so as to establish an association relationship between the target system data and the data calling thread of the target system through the data server, and manage the target system data according to the association relationship; wherein the data calling thread includes a call link and / or a thread snapshot.
[0073] The data server may be a background server of the target system, used to process the relevant data of the target system. The data call thread may be a thread of the data server calling the relevant data of the target system. The call link may be a link of the target system calling data, such as the call chain in the APM system. The thread snapshot may be a snapshot of the execution of the thread in the target system, and may also call the data of the target system.
[0074] After the Java agent program collects the target system data, it can also send the target system data to the data server of the target system. After the data server receives the target system data, it can establish an association relationship between the target system data and the data call thread of the target system to manage the target system data according to the established association relationship.
[0075] Taking the system managed by the APM system as the target system as an example, the Java agent program can send the target system data to the data server for analysis and processing. Specifically, after the data server receives the target system data, it associates the business name of the target system data with the traceID (full-link tracing) or thread snapshot generated by the APM system. For example, a new field is configured in the traceID or thread snapshot, which can be the data identifier of the target system data, used to identify the business name of the target system data. After the data server associates the business name of the target system data with the traceID or thread snapshot generated by the APM system, the data server can call the target system data through the data call thread for analysis and processing. For example, the data server calls the target system data to the console for display through the data call thread. The user can then view, edit, or perform other processing on the displayed target system data on the console side.
[0076] In summary, the system data collection method provided by the embodiment of the present invention can support users to dynamically configure custom data collection configuration information. When method data collection configuration information exists in the custom data collection configuration information, the target class and / or target method that conforms to the configuration rules can be re-inserted according to the information dynamically configured by the user through the Java agent program to generate a corresponding data collection method. When request data collection configuration information exists in the custom data collection configuration information, the request data type within the set range can be collected, thereby realizing automatic collection of target system data of the target system. The entire data collection process only requires the user to pre-configure the custom data collection configuration information, without the need for the user to manually modify the business code of the target system, which can effectively reduce the manpower and time costs, and realize on-demand collection of system data without invading the system code, thereby improving the flexibility and efficiency of system data collection, and helping users to dynamically and timely understand the system operation status and system operation data of the target system.
[0077] It should be noted that any arrangement and combination of the technical features in the above embodiments also falls within the protection scope of the present invention.
[0078] Embodiment 3
[0079] Figure 4 is a schematic diagram of a system data acquisition device provided by Embodiment 3 of the present invention, such as Figure 4 As shown, the device includes: an information acquisition module 310 and a data acquisition module 320, wherein:
[0080] The information acquisition module 310 is used to acquire custom data collection configuration information; wherein the custom data collection configuration information includes method data collection configuration information and / or request data collection configuration information, the method data collection configuration information is used to collect the associated system data of the target class method, and the request data collection configuration information is used to collect the associated system data of the target request;
[0081] The data collection module 320 is used to collect target system data of the target system according to the custom data collection configuration information.
[0082] The embodiment of the present invention obtains custom data collection configuration information including method data collection configuration information and / or request data collection configuration information through a Java agent program, so as to collect target system data of the target system according to the custom data collection configuration information. Since the method data collection configuration information can be used to collect the associated system data of the target class method, and the request data collection configuration information can be used to collect the associated system data of the target request, the custom target system data in the target system can be collected according to the custom data collection configuration information, so as to solve the problems of low data collection efficiency and poor flexibility in the existing system data collection method that collects custom data by invading the system's business code, and can realize on-demand collection of system data without invading the system code, thereby improving the flexibility and efficiency of system data collection.
[0083] Optionally, the method data collection configuration information includes a target class method association identifier, a target class method matching rule and a target data source object: the target class method association identifier includes a target class association identifier and / or a target method association identifier; the target class method matching rule includes a parameter matching rule and / or a return value matching rule; the target data source object includes at least one of a target parameter object, a target return value object or a target attribute object; the request data collection configuration information includes a target collection object; the target collection object includes at least one of a uniform resource locator URL, request parameters, Cookies, session control Session, a request object and request object attributes.
[0084] Optionally, if the custom data collection configuration information includes method data collection configuration information, the data collection module 320 is specifically used to: obtain the target class association identifier in the method data collection configuration information; reload the target class method corresponding to the target class association identifier in the target virtual machine; when it is determined that the reloaded target class method matches the target class method matching rule, perform a data collection logic insertion operation on the target data source object of the target class method according to the data collection program; and automatically collect the target system data of the target system according to the data collection program.
[0085] Optionally, the data acquisition module 320 is specifically used to: obtain the parameters to be matched corresponding to the target class method; when it is determined that the parameters to be matched satisfy the parameter matching rule, determine that the target class method matches the target class method matching rule; and / or, obtain the return value to be matched corresponding to the target class method; when it is determined that the return value to be matched satisfies the return value matching rule, determine that the target class method matches the target class method matching rule.
[0086] Optionally, if the custom data collection configuration information includes request data collection configuration information, the data collection module 320 is specifically used to: obtain the target collection object in the request data collection configuration information and the global request data of the target system; when it is determined that the target collection data of the target collection object exists in the global request data, collect the target collection data and use the target collection data as the target system data.
[0087] Optionally, the system data acquisition device may also include a target system data sending module, which is used to send the target system data to the data server of the target system, so as to establish an association relationship between the target system data and the data calling thread of the target system through the data server, and manage the target system data according to the association relationship; wherein the data calling thread includes a call link and / or a thread snapshot.
[0088] Optionally, the target system includes a system managed by an APM system; the information acquisition module 310 is specifically used to: acquire the custom data collection configuration information configured by the user in the console of the APM system.
[0089] The above system data acquisition device can execute the system data acquisition method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not described in detail in this embodiment, please refer to the system data acquisition method provided by any embodiment of the present invention.
[0090] Since the system data acquisition device introduced above is a device that can execute the system data acquisition method in the embodiment of the present invention, based on the system data acquisition method introduced in the embodiment of the present invention, the technical personnel in this field can understand the specific implementation of the system data acquisition device of this embodiment and its various variations, so how the system data acquisition device implements the system data acquisition method in the embodiment of the present invention is not introduced in detail here. As long as the technical personnel in this field implement the device adopted by the system data acquisition method in the embodiment of the present invention, it belongs to the scope of protection of this application.
[0091] Embodiment 4
[0092] Figure 5 A schematic diagram of the structure of a computer device provided in Embodiment 4 of the present invention. Figure 5 A block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 5 The computer device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0093] like Figure 5 As shown, the computer device 12 is in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors 16, a memory 28, and a bus 18 that connects various system components (including the memory 28 and the processor 16).
[0094] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. For example, these architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
[0095] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0096] The memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 5 not shown, usually called a "hard drive"). Although Figure 5Not shown in the figure, a disk drive for reading and writing a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing a removable non-volatile optical disk (e.g., a read-only optical disk (Compact Disc-Read Only Memory, CD-ROM), a digital video disk (Digital Video Disc-Read Only Memory, DVD-ROM) or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0097] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0098] The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the computer device 12, and / or any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed through an input / output (I / O) interface 22. In addition, the computer device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN) and / or a public network, such as the Internet) through a network adapter 20. As shown, the network adapter 20 communicates with other modules of the computer device 12 through the bus 18. It should be understood that although Figure 5 Not shown, other hardware and / or software modules may be used in conjunction with the computer device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, (Redundant Arrays of Independent Disks, RAID) systems, tape drives, and data backup storage systems.
[0099] The processor 16 executes various functional applications and data processing by running the program stored in the memory 28, thereby realizing the system data collection method provided by the embodiment of the present invention: obtaining custom data collection configuration information; wherein the custom data collection configuration information includes method data collection configuration information and / or request data collection configuration information, the method data collection configuration information is used to collect the associated system data of the target class method, and the request data collection configuration information is used to collect the associated system data of the target request; the target system data of the target system is collected according to the custom data collection configuration information.
[0100] Embodiment 5
[0101] Embodiment 5 of the present invention further provides a computer storage medium storing a computer program, wherein the computer program, when executed by a computer processor, is used to execute the system data acquisition method described in any one of the above embodiments of the present invention: obtaining custom data acquisition configuration information; wherein the custom data acquisition configuration information includes method data acquisition configuration information and / or request data acquisition configuration information, the method data acquisition configuration information is used to acquire associated system data of a target class method, and the request data acquisition configuration information is used to acquire associated system data of a target request; and the target system data of the target system is acquired according to the custom data acquisition configuration information.
[0102] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, a device or a device or used in combination with it.
[0103] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0104] The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wire, optical cable, radio frequency (RF), etc., or any suitable combination of the foregoing.
[0105] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0106] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A system data acquisition method, characterized in that: Applicable to Java agent program, including: Obtaining custom data collection configuration information; wherein the custom data collection configuration information includes method data collection configuration information and request data collection configuration information, the method data collection configuration information is used to collect the associated system data of the target class method, and the request data collection configuration information is used to collect the associated system data of the target request; Collect target system data of the target system according to the custom data collection configuration information; Wherein, the method data acquisition configuration information includes a target class method association identifier, a target class method matching rule and a target data source object: the target class method association identifier includes a target class association identifier and / or a target method association identifier; the target class method matching rule includes a parameter matching rule and / or a return value matching rule; the target data source object includes at least one of a target parameter object, a target return value object or a target attribute object; The request data collection configuration information includes a target collection object; the target collection object includes at least one of a uniform resource locator URL, request parameters, Cookies, session control Session, request object and request object attributes; The collecting target system data of the target system according to the custom data collection configuration information includes: Obtaining the target class association identifier in the method data collection configuration information; Reloading the target class method corresponding to the target class association identifier in the target virtual machine; When it is determined that the reloaded target class method matches the target class method matching rule, a data acquisition logic insertion operation is performed on the target data source object of the target class method according to a data acquisition program; automatically collecting the target system data of the target system according to the data collection program; The step of collecting target system data of the target system according to the custom data collection configuration information further includes: Acquire the target collection object in the request data collection configuration information and the global request data of the target system; In the case where it is determined that the target acquisition data of the target acquisition object exists in the global request data, the target acquisition data is acquired and used as the target system data; Wherein, the determining that the target class method to be reloaded matches the target class method matching rule includes: Obtain the parameters to be matched corresponding to the target class method, and match the parameters to be matched with the parameter matching rules one by one; In the case where it is determined that one or more parameter types in the parameters to be matched satisfy the parameter matching rule, determining that the target class method matches the target class method matching rule; and / or, Obtain the return value to be matched corresponding to the target class method, and match the return value to be matched with the return value matching rule one by one; When it is determined that one or more return value types in the return values to be matched satisfy the return value matching rule, it is determined that the target class method matches the target class method matching rule.
2. The method according to claim 1, characterized in that After collecting the target system data of the target system according to the custom data collection configuration information, the method further includes: Sending the target system data to a data server of the target system, so as to establish an association relationship between the target system data and a data calling thread of the target system through the data server, and managing the target system data according to the association relationship; The data calling thread includes a calling link and / or a thread snapshot.
3. The method according to any one of claims 1-2, characterized in that: The target system includes a system managed by an application performance management APM system; The obtaining of the custom data collection rules includes: The custom data collection configuration information configured by the user in the console of the APM system is obtained.
4. A system data acquisition device, characterized in that: Configured in the Java agent program, including: An information acquisition module, used to acquire custom data collection configuration information; wherein the custom data collection configuration information includes method data collection configuration information and request data collection configuration information, the method data collection configuration information is used to collect the associated system data of the target class method, and the request data collection configuration information is used to collect the associated system data of the target request; A data collection module, used for collecting target system data of the target system according to the custom data collection configuration information; Wherein, the method data acquisition configuration information includes a target class method association identifier, a target class method matching rule and a target data source object: the target class method association identifier includes a target class association identifier and / or a target method association identifier; the target class method matching rule includes a parameter matching rule and / or a return value matching rule; the target data source object includes at least one of a target parameter object, a target return value object or a target attribute object; The request data collection configuration information includes a target collection object; the target collection object includes at least one of a uniform resource locator URL, request parameters, Cookies, session control Session, request object and request object attributes; The data acquisition module is specifically used to: obtain the target class association identifier in the method data acquisition configuration information; reload the target class method corresponding to the target class association identifier in the target virtual machine; when it is determined that the reloaded target class method matches the target class method matching rule, perform a data acquisition logic insertion operation on the target data source object of the target class method according to the data acquisition program; automatically collect the target system data of the target system according to the data acquisition program; The data acquisition module is further specifically used to: obtain the target acquisition object in the request data acquisition configuration information and the global request data of the target system; if it is determined that the target acquisition data of the target acquisition object exists in the global request data, acquire the target acquisition data and use the target acquisition data as the target system data; Wherein, the data acquisition module is specifically used for: Obtain the parameters to be matched corresponding to the target class method, and match the parameters to be matched with the parameter matching rules one by one; In the case where it is determined that one or more parameter types in the parameters to be matched satisfy the parameter matching rule, determining that the target class method matches the target class method matching rule; and / or, Obtain the return value to be matched corresponding to the target class method, and match the return value to be matched with the return value matching rule one by one; When it is determined that one or more return value types in the return values to be matched satisfy the return value matching rule, it is determined that the target class method matches the target class method matching rule.
5. A computer device, characterized in that: The computer device comprises: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the system data acquisition method as described in any one of claims 1-3.
6. A computer storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the system data acquisition method as described in any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Non-intrusive client operation data acquisition method and non-intrusive client operation data acquisition system
CN105119899A
Log collection method and device and log service system
CN105278996A
Three-dimensional monitoring system oriented to cloud native application
CN108471366A
A method and device for injecting Java classes at run time
CN109445878A
Power enterprise information service monitoring method based on APM technology
CN110232007A
