Data collection method, device and equipment based on Java virtual machine and storage medium
By building and verifying the data acquisition thread set in Java virtual machine, the persistence and segmentation problems of data acquisition in Java application performance detection are solved, the reliability and sustainability of acquisition are improved, and the monitoring of performance problems is enhanced ability.
Patent Information
- Application Number
- CN202411330244.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2025-01-10
AI Technical Summary
Existing Java application performance detection tools lack persistence in data collection, it is difficult to reproduce slow call chains, and it is impossible to clearly subdivide the time-consuming process of a complete call chain, especially in core programs with high performance requirements.
By building a data acquisition thread set in a Java virtual machine, performing configuration and environment feasibility verification, determining the target data acquisition thread set, and realizing data acquisition of Java virtual machine running programs.
Improves the reliability and sustainability of data acquisition, ensures accurate segmentation and display of call chains, and enhances the ability to monitor performance issues.
Smart Images

Figure CN119292734A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, in particular to the field of Java virtual machine technology, and specifically to a data collection method, device, equipment and storage medium based on a Java virtual machine. Background Art
[0002] In Java application performance detection, the call chain duration obtained through data collection is a very important indicator, especially in the core programs with high performance requirements. There are already some tools and technologies to obtain the trace call chain duration, such as some Java diagnostic tools and bytecode enhancement technology;
[0003] However, existing tools and methods have some technical defects when collecting data. For example, data collection lacks continuity. Some slow call chains are difficult to reproduce. Without continuous collection and processing, it is easy to miss the opportunity to discover them. Data collection is unclear. Only the total time of the complete call chain is available. There is no clear breakdown of the time taken for a complete call chain, especially the separate calculation and display of common methods or types of focus. Summary of the invention
[0004] The present application provides a data collection method, apparatus, device and storage medium based on a Java virtual machine to improve the reliability and sustainability of data collection.
[0005] According to one aspect of the present application, a data collection method based on a Java virtual machine is provided, the method comprising:
[0006] Building a first data collection thread set for a currently running program of the target Java virtual machine based on a native library called by the target Java virtual machine;
[0007] Performing a configuration feasibility check on the current data collection configuration of the target Java virtual machine, and if the configuration feasibility check passes, performing an environment feasibility check on the current operating environment of the target Java virtual machine;
[0008] If the environmental feasibility check passes, determining a second data acquisition thread set of the currently running program according to the current running environment of the target Java virtual machine;
[0009] Based on the current running environment, a target data collection thread set is determined from the first data collection thread set and the second data collection thread set, and the target data collection thread set is used to perform data collection on the current running program of the target Java virtual machine.
[0010] According to another aspect of the present application, a data acquisition device based on a Java virtual machine is provided, the device comprising:
[0011] A thread construction module, used to construct a first data collection thread set for a currently running program of the target Java virtual machine based on a native library called by the target Java virtual machine;
[0012] A virtual machine verification module, used to perform a configuration feasibility check on the current data collection configuration of the target Java virtual machine, and if the configuration feasibility check passes, perform an environment feasibility check on the current operating environment of the target Java virtual machine;
[0013] A thread determination module, configured to determine a second data collection thread set of a currently running program according to a current running environment of the target Java virtual machine when the environment feasibility check passes;
[0014] The data collection module is used to determine a target data collection thread set from the first data collection thread set and the second data collection thread set based on the current running environment, and use the target data collection thread set to collect data from the current running program of the target Java virtual machine.
[0015] According to another aspect of the present application, an electronic device is provided, the electronic device comprising:
[0016] one or more processors;
[0017] A memory for storing one or more programs;
[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement any one of the Java virtual machine-based data collection methods provided in the embodiments of the present application.
[0019] According to another aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, any one of the data collection methods based on a Java virtual machine provided in the embodiments of the present application is implemented.
[0020] This application builds a first data collection thread set for the current running program of the target Java virtual machine based on the local library called by the target Java virtual machine; performs a configuration feasibility check on the current data collection configuration of the target Java virtual machine, and if the configuration feasibility check passes, performs an environmental feasibility check on the current running environment of the target Java virtual machine; if the environmental feasibility check passes, determines the second data collection thread set of the current running program according to the current running environment of the target Java virtual machine; based on the current running environment, determines the target data collection thread set from the first data collection thread set and the second data collection thread set, and uses the target data collection thread set to collect data for the current running program of the target Java virtual machine. The above technical solution can improve the reliability and sustainability of data collection. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 is a flow chart of a data collection method based on a Java virtual machine provided according to Embodiment 1 of the present application;
[0022] Figure 2 is a flow chart of a data collection method based on a Java virtual machine provided according to Embodiment 2 of the present application;
[0023] Figure 3 It is a structural diagram of a data acquisition device based on a Java virtual machine provided according to the third embodiment of the present application;
[0024] Figure 4 It is a structural schematic diagram of an electronic device that implements the data collection method based on a Java virtual machine according to an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] In addition, it should be noted that in the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of relevant data such as gear data and available stiffness are in compliance with the relevant laws and regulations and do not violate public order and good morals.
[0028] Embodiment 1
[0029] Figure 1 This is a flow chart of a data collection method based on a Java virtual machine according to the first embodiment of the present application. This embodiment is applicable to the case of collecting the time consumption of the call chain, and can be executed by a data collection device based on a Java virtual machine. The data collection device based on a Java virtual machine can be implemented in the form of hardware and / or software. The data collection device based on a Java virtual machine can be configured in a computer device, such as a server. Figure 1 As shown, the method includes:
[0030] S110. Building a first data collection thread set for a currently running program of the target Java virtual machine based on a native library called by the target Java virtual machine.
[0031] Among them, the target Java virtual machine refers to the virtual machine where the current running program is located; the Java virtual machine is a virtual machine that can execute Java bytecodes on various platforms. The native library refers to a library containing native methods, which are written in C, C++ or other native programming languages, and can interact with Java applications through the Java native interface. The native library can be a native (Java Native Interface, Java native interface) library. The currently running program refers to a Java program that is currently running and requires data collection. The first data collection thread refers to a thread that calls a local method through a local interface to obtain data from an operating system, hardware sensor, external device, etc., and may refer to native collection; optionally, the first data collection thread refers to a thread that collects the time-consuming call chain of the currently running program. The first data collection thread set refers to a thread set consisting of the first data collection thread.
[0032] In the embodiment of the present application, the call chain refers to the call relationship chain between functions or methods in the execution process of the currently running program. The call chain time refers to the time consumed by calling each function or method on the entire call chain during the execution of the currently running program. It can also refer to the execution time of certain key functions or methods in a specific call chain; optionally, the call chain time may include the total time of the entire call chain, the call chain method time, the CPU (Central Processing Unit) time, the network input / output time, the file input / output time, the thread is suspended or suspended time, the thread blocking time, the pause phase time in the garbage collection process, the old generation garbage collection time, the time to enter the safe point, the time to exit the safe point, the safe point state synchronization time, etc.
[0033] In an optional implementation, when the target Java virtual machine is started, the local library file is loaded by calling the local library loading method of the Java agent; based on the local library file, a first data collection thread set is constructed for the currently running program of the target Java virtual machine to facilitate subsequent local-level data collection.
[0034] Among them, Java agent refers to a tool that can monitor, debug or enhance Java programs by modifying bytecodes or through the functions provided by JVMTI (Java Virtual Machine Tool Interface) before the Java application is started or during operation. The native library loading method refers to a specific method of the Java agent, which is one of the entry points of the Java agent. It is used for the code that runs when the Java virtual machine is started. It can perform some initialization work, such as loading native libraries and setting agent interfaces. The native library file is a dynamic link library file under Unix (UNiplexed Information and Computing System) type operating systems, usually used to store compiled native code and provide it to application programs for calling.
[0035] S120: Perform a configuration feasibility check on the current data collection configuration of the target Java virtual machine. If the configuration feasibility check passes, perform an environment feasibility check on the current operating environment of the target Java virtual machine.
[0036] In the embodiment of the present application, the current data acquisition configuration refers to the various configurations used for data acquisition during the operation of the current running program of the Java virtual machine; optionally, it may include web (World Wide Web) configuration and local configuration; it should be noted that the current data acquisition configuration is acquired periodically. Among them, the web-delivered configuration refers to the configuration information obtained from a remote service (usually a configuration server or management platform) through the network when the current running program is running. The local configuration refers to the static configuration information stored in the local file or database of the current running program, which is usually loaded when the current running program starts or accessed through local files at runtime. Environmental feasibility verification refers to the verification of whether the current running environment supports the required collection function.
[0037] Optionally, performing a configuration feasibility check on the current data acquisition configuration of the target Java virtual machine may be to perform a configuration feasibility check on the current remote configuration and the current local configuration of the target Java virtual machine respectively; when the configuration feasibility of both the current remote configuration and the current local configuration pass, it is determined that the configuration feasibility check of the current data acquisition configuration passes.
[0038] The current remote configuration refers to the web-delivered configuration. The current local configuration refers to the local configuration. The configuration feasibility check is used to check whether the current remote configuration and the current local configuration support the collection function.
[0039] S130. When the environmental feasibility check passes, determine a second data collection thread set of the currently running program according to the current running environment of the target Java virtual machine.
[0040] The second data collection thread refers to a thread that uses a lightweight event recording system provided by the Java platform to capture various events and performance data of the application program at runtime, which can be a JFR (Java Flight Recorder) collection thread; optionally, the second data collection thread refers to a thread that collects the time consumption of the call chain of the current running program. The second data collection thread set refers to a thread set composed of the second data collection thread.
[0041] Exemplarily, performing an environmental feasibility check on the current operating environment of the target Java virtual machine may be to determine whether the current operating environment supports JFR collection.
[0042] S140: Based on the current running environment, determine a target data collection thread set from the first data collection thread set and the second data collection thread set, and use the target data collection thread set to perform data collection on a currently running program of a target Java virtual machine.
[0043] The target data collection thread set refers to the collection threads that are finally determined to collect data from the currently running program.
[0044] Optionally, based on the current operating environment, determining the target data acquisition thread set from the first data acquisition thread set and the second data acquisition thread set can be: when the current operating environment meets the data acquisition conditions, the second data acquisition thread set is determined as the target data acquisition thread set; when the current operating environment meets the local library acquisition conditions, the first data acquisition thread set is determined as the target data acquisition thread set.
[0045] The data collection condition is manually set according to the actual situation or experience value. For example, the data collection condition can be used to determine whether the current operating environment supports JFR collection. The local library collection condition is manually set according to the actual situation or experience value. For example, the local library collection condition is used to determine whether the current operating environment supports native collection.
[0046] Furthermore, when the current operating environment meets the data collection conditions and the local library collection conditions, determine whether to adopt the general collection thread in the first data collection thread set; if so, eliminate the data collection thread set corresponding to the general collection thread in the second data collection thread set to obtain a candidate data collection thread set; combine the candidate data collection thread set with the first data collection thread set to obtain the target data collection thread set.
[0047] The general collection thread refers to a thread set that can collect the same data in the first data collection thread set and the second data collection thread set.
[0048] For example, take JFR collection and native collection as an example. Determine whether to enable CPU time collection in native collection. If enabled, disable the CPU time collection option in JFR collection. Determine whether to enable wall clock duration time collection in native collection. If enabled, disable the wall clock duration time collection option in JFR collection.
[0049] It can be understood that when a general collection thread is started in the first data collection thread, the general collection thread set in the second data collection thread set is correspondingly closed, so that repeated collection can be avoided.
[0050] The embodiment of the present application builds a first data collection thread set for the current running program of the target Java virtual machine based on the local library called by the target Java virtual machine; performs a configuration feasibility check on the current data collection configuration of the target Java virtual machine, and if the configuration feasibility check passes, performs an environmental feasibility check on the current running environment of the target Java virtual machine; if the environmental feasibility check passes, determines the second data collection thread set of the current running program according to the current running environment of the target Java virtual machine; based on the current running environment, determines the target data collection thread set from the first data collection thread set and the second data collection thread set, and uses the target data collection thread set to collect data for the current running program of the target Java virtual machine. The above technical solution can improve the reliability and sustainability of data collection.
[0051] Embodiment 2
[0052] Figure 2 This is a flow chart of a data collection method based on a Java virtual machine provided in accordance with the second embodiment of the present application. Based on the technical solutions of the above embodiments, this embodiment refines "using a target data collection thread set to collect data from the current running program of the target Java virtual machine" into "detecting the object state of each data object in the current running program; if a data object with an active object state is identified, the data object is processed based on the target data collection thread set to obtain a data storage file for the data object". It should be noted that for the parts not described in detail in the embodiments of the present application, please refer to the relevant statements of other embodiments. Figure 2 As shown, the method includes:
[0053] S210: Building a first data collection thread set for a currently running program of the target Java virtual machine based on a native library called by the target Java virtual machine.
[0054] S220: Perform a configuration feasibility check on the current data collection configuration of the target Java virtual machine. If the configuration feasibility check passes, perform an environment feasibility check on the current operating environment of the target Java virtual machine.
[0055] S230: When the environmental feasibility check passes, determine a second data collection thread set of the currently running program according to the current running environment of the target Java virtual machine.
[0056] In an optional implementation, if the configuration feasibility check and / or the environment feasibility check of the current cycle fails, data collection is not performed; if there is a data collection task currently in progress, the data collection task is stopped.
[0057] S240: Determine a target data collection thread set from the first data collection thread set and the second data collection thread set based on the current operating environment.
[0058] S250, detecting the object state of each data object in the currently running program; if a data object with an active object state is identified, processing the data object based on the target data acquisition thread set to obtain a data storage file of the data object.
[0059] The data object refers to the object used to store and manage the collected data records. The object state is used to characterize the running state of the current data object, which may include stopped, destroyed, active, etc. The data storage file refers to the final JFR format file stored locally.
[0060] Optionally, after obtaining the data storage file, the data storage file may be compressed to obtain a target storage file; the target storage file is reported to the controller so that the controller subdivides the target storage file and stores it in a database according to a preset format.
[0061] The controller is a component or service that is responsible for receiving, storing and managing JFR event data. The preset format is a format that can be used for display and is set artificially based on actual conditions or experience.
[0062] Furthermore, when a display instruction is received, the target storage file can be read from the database and displayed.
[0063] In an optional embodiment, when data collection is started, a timer task for periodically dumping the records within a preset period and reporting is initialized and started; if the timer task is successfully started, it will periodically check whether there is a record object. If the record object is stopped and destroyed, the check will end. If it is not stopped and destroyed, a snapshot of the sampled record will be taken, and the records of this period will be dumped as a complete record, which will be stored locally in a JFR format file. After that, it will be checked whether the JFR format file is successfully generated. If so, it will be read and compressed and reported to the controller for processing (after processing by the controller, it will be stored in the database for reading by the display module), otherwise no processing will be performed.
[0064] The embodiment of the present application builds a first data acquisition thread set for the current running program of the target Java virtual machine through a local library called by the target Java virtual machine; performs a configuration feasibility check on the current data acquisition configuration of the target Java virtual machine, and if the configuration feasibility check passes, performs an environment feasibility check on the current running environment of the target Java virtual machine; if the environment feasibility check passes, determines the second data acquisition thread set of the current running program according to the current running environment of the target Java virtual machine; based on the current running environment, determines the target data acquisition thread set from the first data acquisition thread set and the second data acquisition thread set, and detects the object state of each data object in the current running program; if a data object with an active object state is identified, the data object is processed based on the target data acquisition thread set to obtain a data storage file of the data object. The above technical scheme can improve the reliability and sustainability of data acquisition.
[0065] Embodiment 3
[0066] Figure 3 This is a structural diagram of a data collection device based on a Java virtual machine according to the third embodiment of the present application, which can be applied to the case of collecting the time consumption of the call chain. The data collection device based on the Java virtual machine can be implemented in the form of hardware and / or software. The data collection device based on the Java virtual machine can be configured in a computer device, such as a server. Figure 3 As shown, the device comprises:
[0067] The thread construction module 310 is used to construct a first data collection thread set for a currently running program of the target Java virtual machine based on a native library called by the target Java virtual machine;
[0068] A virtual machine verification module 320 is used to perform a configuration feasibility check on the current data collection configuration of the target Java virtual machine, and if the configuration feasibility check passes, perform an environment feasibility check on the current operating environment of the target Java virtual machine;
[0069] The thread determination module 330 is used to determine the second data collection thread set of the currently running program according to the current running environment of the target Java virtual machine when the environment feasibility check passes;
[0070] The data collection module 340 is used to determine a target data collection thread set from the first data collection thread set and the second data collection thread set based on the current running environment, and use the target data collection thread set to perform data collection on the current running program of the target Java virtual machine.
[0071] The embodiment of the present application builds a first data collection thread set for the current running program of the target Java virtual machine based on the local library called by the target Java virtual machine; performs a configuration feasibility check on the current data collection configuration of the target Java virtual machine, and if the configuration feasibility check passes, performs an environmental feasibility check on the current running environment of the target Java virtual machine; if the environmental feasibility check passes, determines the second data collection thread set of the current running program according to the current running environment of the target Java virtual machine; based on the current running environment, determines the target data collection thread set from the first data collection thread set and the second data collection thread set, and uses the target data collection thread set to collect data for the current running program of the target Java virtual machine. The above technical solution can improve the reliability and sustainability of data collection.
[0072] Optionally, the data acquisition module 340 is specifically used for:
[0073] In the case where the current operating environment meets the data collection condition, determining the second data collection thread set as the target data collection thread set;
[0074] When the current operating environment meets the local library acquisition condition, the first data acquisition thread set is determined as the target data acquisition thread set.
[0075] Optionally, the data acquisition module 340 is further specifically used for:
[0076] When the current operating environment meets the data collection conditions and the local library collection conditions, determining whether to use the general collection thread in the first data collection thread set;
[0077] If so, the data collection thread set corresponding to the general collection thread in the second data collection thread set is eliminated to obtain a candidate data collection thread set;
[0078] The candidate data collection thread set and the first data collection thread set are combined to obtain a target data collection thread set.
[0079] Optionally, the virtual machine verification module 320 is specifically used to:
[0080] Perform configuration feasibility check on the current remote configuration and the current local configuration of the target Java virtual machine respectively;
[0081] When the configuration feasibility of the current remote configuration and the current local configuration are both passed, it is determined that the configuration feasibility check of the current data collection configuration has passed.
[0082] Optionally, the data acquisition module 340 is further specifically used for:
[0083] Detect the object status of each data object in the currently running program;
[0084] If a data object whose object state is active is identified, the data object is processed based on the target data acquisition thread set to obtain a data storage file of the data object.
[0085] Optionally, the device further includes a data reporting module; the data reporting module is used to:
[0086] Compress the data storage file to obtain the target storage file;
[0087] The target storage file is reported to the controller so that the controller can segment the target storage file and store it in the database according to a preset format.
[0088] The Java virtual machine-based data acquisition device provided in the embodiments of the present application can execute the Java virtual machine-based data acquisition method provided in any embodiment of the present application, and has the corresponding functional modules and beneficial effects for executing each Java virtual machine-based data acquisition method.
[0089] Embodiment 4
[0090] Figure 4 It is a structural diagram of an electronic device 410 that implements a data acquisition method based on a Java virtual machine according to an embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.
[0091] like Figure 4As shown, the electronic device 410 includes at least one processor 411, and a memory connected to the at least one processor 411 in communication, such as a read-only memory (ROM) 412, a random access memory (RAM) 413, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 411 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 412 or the computer program loaded from the storage unit 418 to the random access memory (RAM) 413. In RAM413, various programs and data required for the operation of the electronic device 410 can also be stored. The processor 411, ROM412 and RAM413 are connected to each other via a bus 414. An input / output (I / O) interface 415 is also connected to the bus 414.
[0092] Multiple components in the electronic device 410 are connected to the I / O interface 415, including: an input unit 416, such as a keyboard, a mouse, etc.; an output unit 417, such as various types of displays, speakers, etc.; a storage unit 418, such as a disk, an optical disk, etc.; and a communication unit 419, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 419 allows the electronic device 410 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0093] The processor 411 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 411 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 411 executes the various methods and processes described above, such as a data acquisition method based on a Java virtual machine.
[0094] In some embodiments, the data collection method based on the Java virtual machine can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 418. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 410 via the ROM 412 and / or the communication unit 419. When the computer program is loaded into the RAM 413 and executed by the processor 411, one or more steps of the data collection method based on the Java virtual machine described above can be performed. Alternatively, in other embodiments, the processor 411 can be configured as a data collection method based on the Java virtual machine by any other appropriate means (for example, by means of firmware).
[0095] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0096] The computer programs for implementing the methods of the present application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable Java virtual machine-based data acquisition device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.
[0097] In the context of the present application, a computer readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device or equipment. A computer readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer readable storage medium may be a machine readable signal medium. A more specific example of a machine readable storage medium may include an electrical connection based on one or more lines, 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 foregoing.
[0098] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0099] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0100] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0101] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution of this application can be achieved, and this document is not limited here.
[0102] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.
Claims
1. A data collection method based on a Java virtual machine, characterized in that: include: Building a first data collection thread set for a currently running program of the target Java virtual machine based on a native library called by the target Java virtual machine; Performing a configuration feasibility check on the current data collection configuration of the target Java virtual machine, and if the configuration feasibility check passes, performing an environment feasibility check on the current operating environment of the target Java virtual machine; If the environmental feasibility check passes, determining a second data acquisition thread set of the currently running program according to the current running environment of the target Java virtual machine; Based on the current running environment, a target data collection thread set is determined from the first data collection thread set and the second data collection thread set, and the target data collection thread set is used to perform data collection on the current running program of the target Java virtual machine.
2. The method according to claim 1, characterized in that Determining a target data collection thread set from the first data collection thread set and the second data collection thread set based on the current operating environment includes: In a case where the current operating environment meets the data collection condition, determining the second data collection thread set as a target data collection thread set; When the current operating environment meets the local library acquisition condition, the first data acquisition thread set is determined as the target data acquisition thread set.
3. The method according to claim 2, characterized in that When the current operating environment satisfies the data collection conditions and the local library collection conditions, the method further includes: Determining whether to use a general acquisition thread in the first data acquisition thread set; If yes, then remove the data collection thread set corresponding to the general collection thread from the second data collection thread set to obtain a candidate data collection thread set; The candidate data collection thread set and the first data collection thread set are combined to obtain a target data collection thread set.
4. The method according to claim 1, characterized in that The current data acquisition configuration includes a current remote configuration and a current local configuration; Performing configuration feasibility verification on the current data collection configuration of the target Java virtual machine, including: Performing configuration feasibility verification on the current remote configuration and the current local configuration of the target Java virtual machine respectively; In the case that the configuration feasibility of the current remote configuration and the current local configuration are both passed, it is determined that the configuration feasibility check of the current data acquisition configuration is passed.
5. The method according to claim 1, characterized in that Using the target data collection thread set to collect data from the currently running program of the target Java virtual machine includes: Detect the object status of each data object in the currently running program; If a data object whose object state is active is identified, the data object is processed based on the target data acquisition thread set to obtain a data storage file of the data object.
6. The method according to claim 5, characterized in that After obtaining the data storage file, it also includes: Compressing the data storage file to obtain a target storage file; The target storage file is reported to the controller, so that the controller performs segmentation processing on the target storage file and stores it in a database according to a preset format.
7. A data acquisition device based on a Java virtual machine, characterized in that: include: A thread construction module, used to construct a first data collection thread set for a currently running program of the target Java virtual machine based on a native library called by the target Java virtual machine; A virtual machine verification module, used to perform a configuration feasibility check on the current data collection configuration of the target Java virtual machine, and if the configuration feasibility check passes, perform an environment feasibility check on the current operating environment of the target Java virtual machine; A thread determination module, configured to determine a second data collection thread set of a currently running program according to a current running environment of the target Java virtual machine when the environment feasibility check passes; The data collection module is used to determine a target data collection thread set from the first data collection thread set and the second data collection thread set based on the current running environment, and use the target data collection thread set to collect data from the current running program of the target Java virtual machine.
8. An electronic device, characterized in that: include: one or more processors; A memory 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 Java virtual machine-based data collection method as described in any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the Java virtual machine-based data collection method as described in any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the data collection method based on a Java virtual machine according to any one of claims 1 to 6.