CN113377614B - Call chain information generation method and device, electronic equipment and storage medium - Google Patents

Call chain information generation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113377614B
CN113377614B CN202110637629.7A CN202110637629A CN113377614B CN 113377614 B CN113377614 B CN 113377614B CN 202110637629 A CN202110637629 A CN 202110637629A CN 113377614 B CN113377614 B CN 113377614B
Authority
CN
China
Prior art keywords
target
monitored
starting
application program
function
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110637629.7A
Other languages
Chinese (zh)
Other versions
CN113377614A (en
Inventor
张�成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202110637629.7A priority Critical patent/CN113377614B/en
Publication of CN113377614A publication Critical patent/CN113377614A/en
Application granted granted Critical
Publication of CN113377614B publication Critical patent/CN113377614B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45591Monitoring or debugging support
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Mathematical Physics (AREA)
  • Stored Programmes (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The disclosure provides a method, a device, electronic equipment and a storage medium for generating call chain information, which relate to the technical field of computers, in particular to the technical field of artificial intelligence such as deep learning, big data processing and the like, and the method comprises the following steps: determining a starting instruction corresponding to the application program to be monitored, and analyzing from the starting instruction to obtain a target identifier; starting a target agent program corresponding to the target mark, wherein the target agent program calls a target callback event function of the virtual machine after starting; and generating call chain information among a plurality of functions of the application program to be monitored based on the target callback event function. Therefore, the call chain information is generated through interaction with the virtual machine, namely, auxiliary realization, so that the influence on business logic related to the source program code file is avoided, the integrity of the call chain information can be effectively improved, and the generation efficiency and the generation effect of the call chain information can be effectively improved.

Description

Call chain information generation method and device, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of computers, in particular to the technical field of artificial intelligence such as deep learning, big data processing and the like, and particularly relates to a method and a device for generating call chain information, electronic equipment and a storage medium.
Background
Artificial intelligence is the discipline of studying the process of making a computer mimic certain mental processes and intelligent behaviors (e.g., learning, reasoning, thinking, planning, etc.) of a person, both hardware-level and software-level techniques. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing, and the like; the artificial intelligence software technology mainly comprises a computer vision technology, a voice recognition technology, a natural language processing technology, a machine learning technology, a deep learning technology, a big data processing technology, a knowledge graph technology and the like.
In the related art, a source code file for an application program is embedded in advance or bytecode is injected to assist in generating call chain information related to the application program.
Disclosure of Invention
The disclosure provides a method, a device, electronic equipment and a storage medium for generating call chain information.
According to a first aspect of the present disclosure, there is provided a method for generating call chain information, including: determining an application program to be monitored; determining a starting instruction corresponding to the application program to be monitored, and analyzing from the starting instruction to obtain a target identifier; starting a target agent program corresponding to the target identifier, wherein the target agent program calls a target callback event function of the virtual machine after starting; and generating call chain information among a plurality of functions of the application program to be monitored based on the target callback event function.
According to a second aspect of the present disclosure, there is provided a generating apparatus of call chain information, including: the first determining module is used for determining an application program to be monitored; the second determining module is used for determining a starting instruction corresponding to the application program to be monitored and analyzing the starting instruction to obtain a target identifier; the starting module is used for starting a target agent program corresponding to the target identifier, wherein the target agent program calls a target callback event function of the virtual machine after starting; and the generation module is used for generating call chain information among a plurality of functions of the application program to be monitored based on the target callback event function.
According to a third aspect of the present disclosure, there is provided an electronic device comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of generating call chain information of embodiments of the present disclosure.
According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute a method of generating call chain information disclosed by an embodiment of the present disclosure is provided.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a schematic diagram according to a first embodiment of the present disclosure;
FIG. 2 is a schematic architecture diagram of a call chain information generation apparatus in an embodiment of the present disclosure;
FIG. 3 is a schematic diagram according to a second embodiment of the present disclosure;
FIG. 4 is a schematic diagram according to a third embodiment of the present disclosure;
FIG. 5 is a schematic diagram according to a fourth embodiment of the present disclosure;
FIG. 6 is a schematic diagram according to a fifth embodiment of the present disclosure;
FIG. 7 illustrates a schematic block diagram of an example electronic device that may be used to implement embodiments of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram according to a first embodiment of the present disclosure.
It should be noted that, the execution body of the call chain information generating method in this embodiment is a call chain information generating device, and the device may be implemented in a software and/or hardware manner, and the device may be configured in an electronic device, where the electronic device may include, but is not limited to, a terminal, a server, and the like.
The embodiment of the disclosure relates to the technical field of computers, in particular to the technical field of artificial intelligence such as deep learning, big data processing and the like, and particularly relates to a method and a device for generating call chain information, electronic equipment and a storage medium.
Wherein, artificial intelligence (Artificial Intelligence), english is abbreviated AI. It is a new technical science for researching, developing theory, method, technology and application system for simulating, extending and expanding human intelligence.
Deep learning is the inherent regularity and presentation hierarchy of learning sample data, and the information obtained during such learning is helpful in interpreting data such as text, images and sounds. The final goal of deep learning is to enable a machine to analyze learning capabilities like a person, and to recognize text, images, and sound data.
The big data processing refers to a process of analyzing and processing huge-scale data by adopting an artificial intelligence mode, and the big data can be summarized into 5V, and has large data Volume (Volume), high speed (Velocity), multiple types (Variety), value and authenticity (Veracity).
As shown in fig. 1, the method for generating call chain information includes:
s101: an application to be listened to is determined.
An application whose call chain information is to be analyzed may be referred to as an application to be monitored, and the call chain information may be information for describing a call situation between a plurality of functions implementing the application to be monitored.
The number of the applications to be monitored may be 1 or more, and the number of the applications to be monitored is not particularly limited in the embodiment of the present invention, and may be set by those skilled in the art according to actual situations.
The determining the application program to be monitored may be that the generating device of the call chain information receives an analysis request of the call chain information sent by the third party detecting device, then analyzes the analysis request, identifies an application program identifier from the analysis request, and determines the application program to which the application program identifier belongs as the application program to be monitored, or may also determine that a plurality of application programs running in the electronic device are all the application programs to be monitored, or may also select according to actual development test requirements of a developer, so that the method is not limited.
S102: and determining a starting instruction corresponding to the application program to be monitored, and analyzing from the starting instruction to obtain a target identification.
The starting instruction may be preconfigured in the electronic device, and when the starting instruction is called, the starting of the application program to be monitored based on the starting instruction may be supported.
In the embodiment of the disclosure, after the application program to be monitored is determined, a preset starting instruction corresponding to the application program to be monitored may be read, and then the starting instruction is analyzed to obtain the target identifier through analysis from the starting instruction.
Wherein the target identification may be used to uniquely identify the target agent, and the target agent may be one of a plurality of agents that are pre-generated.
The Agent, that is, agent, may be constructed using Agent technology, and may be used to assist in monitoring, running, or even replacing other programs, while the target Agent in the embodiments of the present disclosure may be pre-generated and registered, and configured to interact with a virtual machine in the background of the application to assist in implementing the function of generating call chain information.
As shown in fig. 2, fig. 2 is an architecture diagram of a generating device of call chain information in an embodiment of the disclosure, including: the system comprises an application program to be monitored, a target Agent program Agent, a JVMTI layer and a Java virtual machine JVM, wherein the Java virtual machine JVM is used for supporting the whole processing logic of a generating method of calling chain information.
That is, as shown in fig. 2 together, corresponding agents may be configured for different applications in advance, and registered at virtual machines (e.g., java virtual machines (Java Virtual Machine, JVM)), which correspondingly have a Java virtual machine interface (JVM Tool Interface, JVMTI) layer capable of providing a local programming interface to the Java virtual machine, so that in the embodiment of the present disclosure, various Agent agents may be registered in the JVMTI layer in advance, and a corresponding identifier may be configured for each Agent, and each Agent may be given a function of analyzing call chain information of a corresponding application.
In the embodiment of the disclosure, after the start instruction is parsed to obtain the target identifier from the start instruction, the corresponding target agent program can be determined directly based on the target identifier to call the function of call chain information analysis provided by the target agent program.
S103: and starting a target agent program corresponding to the target mark, wherein the target agent program calls a target callback event function of the virtual machine after starting.
After determining the start instruction corresponding to the application program to be monitored and analyzing the start instruction to obtain the target identifier, the target agent program corresponding to the target identifier can be directly started, wherein the target agent program calls the target callback event function of the virtual machine after starting.
Optionally, in some embodiments, the target agent corresponding to the target identifier may be started while the application program to be monitored is started, so that the target agent is started timely to call the analysis function of the call chain information of the target agent, so that the call chain information related to the initial stage of starting the application program is avoided, the integrity of call chain information generation is effectively ensured, and automatic analysis for the call chain information is also realized.
In the embodiment of the disclosure, a function capable of analyzing call chain information of a corresponding application program may be configured for a target agent program in advance, and specific configuration may refer to the following embodiment, so that when an application program to be monitored is started, a target callback event function of a virtual machine can be directly called based on the target agent program, so as to dynamically analyze call chain information of the application program to be monitored.
In some embodiments, when the application program to be monitored is started, a target agent program corresponding to the target identifier is started, and the target agent program can be directly called or indirectly called to call a target callback event function of the virtual machine.
For example, the target callback event function in the virtual machine may be directly called by the target agent program, or a preset instruction in the target agent program may be captured first, and then the target callback event function in the virtual machine may be indirectly called based on the preset instruction, which is not limited.
S104: and generating call chain information among a plurality of functions of the application program to be monitored based on the target callback event function.
In the embodiment of the disclosure, a local Native function realized based on a C language may be loaded in advance in a target Agent, and then a local Native interface provided by a JVMTI layer is called via the local Native function to implement interaction control on the JVMTI, so that interaction between the Agent and a virtual machine is completed, thereby assisting in implementing generation of call chain information, without embedding points or injecting byte codes in advance for a source code file of an application program to be monitored, so as to avoid affecting service logic related to the source code file.
In the embodiment of the disclosure, the target agent program interacts with the JVM layer to assist in generating call chain information, so that a monitoring range can be effectively ensured, any call condition can be sensed and recorded, and the type of the virtual machine can be any other possible type without limitation.
In this embodiment, by determining an application program to be monitored, determining a start instruction corresponding to the application program to be monitored, analyzing from the start instruction to obtain a target identifier, and starting a target agent program corresponding to the target identifier, the target agent program calls a target callback event function of a virtual machine after starting, and generates call chain information among a plurality of functions of the application program to be monitored based on the target callback event function, the integrity of the call chain information can be effectively improved, and the generation efficiency and the generation effect of the call chain information can be effectively improved.
Fig. 3 is a schematic diagram according to a second embodiment of the present disclosure.
As shown in fig. 3, before determining the application program to be listened to, the method further includes:
s301: and acquiring an initial starting instruction corresponding to the application program to be monitored.
That is, in this embodiment, a method for pre-configuring a start instruction for an application to be monitored is provided, so that when the application to be monitored is started, a target identifier of a target agent program can be quickly captured from the start instruction of the application to be monitored, and quick and accurate call for the target agent program is assisted.
Before configuration, a start instruction for starting an application program to be monitored may be referred to as an initial start instruction, and the embodiment supports that the initial start instruction is subjected to corresponding optimization processing.
S302: and acquiring an access path corresponding to the target identifier.
The method comprises the steps of pre-configuring a plurality of agent programs, correspondingly storing the agent programs in a storage space of the electronic equipment, or storing the agent programs in a cloud platform, configuring corresponding access paths for the storage positions, and associating the corresponding access paths with identifications of the agent programs.
Thus, when the initial starting instruction corresponding to the application program to be monitored is acquired, the target identifier of the target agent program corresponding to the application program to be monitored can be determined, then, the access path corresponding to the target identifier is acquired (the access path corresponding to the identifier can be preconfigured), and the subsequent steps are triggered afterwards.
S303: the call parameters are written into the initial startup instruction and the access path is associated with the initial startup instruction.
The call parameter may be used as a key field of the call target agent, and the call parameter is not limited to the-java agent parameter.
Therefore, the calling parameters are written into the initial starting instruction, and the access path is associated with the initial starting instruction, so that when the application program to be monitored is started, the calling of the target agent program can be realized directly based on the access path corresponding to the target program.
S304: and configuring the initial starting instruction obtained by association as a starting instruction corresponding to the application program to be monitored.
After the call parameters are written into the initial starting instruction and the access path is associated with the initial starting instruction, the initial starting instruction obtained by association can be directly configured as the starting instruction corresponding to the application program to be monitored, so that the target agent program corresponding to the target identifier is started while the application program to be monitored is started.
For example, the method may add a java agent parameter to an initial startup instruction corresponding to the application to be monitored, and direct an access path corresponding to the target agent, so as to complete loading the target agent into startup processing logic of the application to be monitored.
When the application program to be monitored runs, the target Agent program Agent is started at the same time, so that the calling conditions among a plurality of functions in each module corresponding to the application program to be monitored can be observed in real time through the target Agent program Agent, and complete calling chain information is generated based on the calling conditions.
In this embodiment, by acquiring an initial start instruction corresponding to an application program to be monitored, acquiring an access path corresponding to a target identifier, writing a call parameter into the initial start instruction, associating the access path with the initial start instruction, configuring the associated initial start instruction as the start instruction corresponding to the application program to be monitored, and because the call chain information is generated by interaction with a virtual machine, namely, auxiliary realization, the service logic related to a source program code file is prevented from being affected, the integrity of the call chain information can be effectively improved, and the generation efficiency and the generation effect of the call chain information can be effectively improved.
Fig. 4 is a schematic diagram according to a third embodiment of the present disclosure.
As shown in fig. 4, the method for generating call chain information includes:
s401: a target agent is created.
The Agent, i.e., agent, may be constructed using Agent technology and may be used to assist in monitoring, running, or even replacing other programs.
The target agent in the embodiment of the disclosure may be pre-generated and registered, where the target agent is configured to interact with a virtual machine in the background of the application program, so as to assist in implementing a function of generating call chain information.
In the embodiment of the disclosure, a local Native function realized based on a C language may be loaded in advance in a target Agent, and then a local Native interface provided by a JVMTI layer is called via the local Native function to implement interaction control on the JVMTI, so that interaction between the Agent and a virtual machine is completed, thereby assisting in implementing generation of call chain information, without embedding points or injecting byte codes in advance for a source code file of an application program to be monitored, so as to avoid affecting service logic related to the source code file.
S402: the target identifier is configured for the target agent and associated with the access path of the target agent.
The method comprises the steps of pre-configuring a plurality of agent programs, correspondingly storing the agent programs in a storage space of the electronic equipment, or storing the agent programs in a cloud platform, configuring corresponding access paths for the storage positions, and associating the corresponding access paths with identifications of the agent programs.
That is, the access path of the target agent indicates the storage location of the target agent, so that the corresponding target agent can be acquired based on the access path.
The target mark is configured for the target agent program and is associated with the access path of the target agent program, so that the storage position of the target agent program can be quickly and accurately determined directly based on the target mark, and the storage position can be obtained through the access path route, thereby assisting in acquiring the target agent program based on the target mark in real time when the application program to be monitored is started, and supporting the real-time starting of the target agent program.
S403: the target permissions are configured for the target agent, wherein the target agent may invoke a local programming interface of the virtual machine based on the target permissions.
In the embodiment of the disclosure, a Native function implemented based on a C language may be loaded in advance in the Agent, and then a Native interface provided by the JVMTI layer is called via the Native function to implement interactive control over the JVMTI, where the Native interface may be referred to as a Native programming interface.
That is, by loading a Native function implemented based on the C language in the Agent of the target Agent, it is possible to implement configuration of the target authority for the target Agent, so that the target Agent can call the Native interface of the virtual machine based on the target authority.
S404: the target agent is used to call a local programming interface to register a target callback event function with the virtual machine.
After the target authority is configured for the target Agent, the target Agent can be adopted to call the local programming interface so as to register the target callback event function to the virtual machine, thereby ensuring the interaction control effect of the interaction control of the target Agent and the JVMTI, realizing the function of generating the call chain information for the target Agent configuration based on the interaction of the target Agent and the JVMTI, effectively ensuring the monitoring range, and realizing the function that any calling condition can be perceived and recorded by the target Agent.
Alternatively, in some embodiments, the target agent may be used to call a local programming interface to register the target callback event function with the virtual machine, which may be the addition of a local function among the target agents; calling a local programming interface by adopting a local function, and associating the local function with a trigger event function in the virtual machine; and registering the trigger event function obtained by association by adopting a set event notification mode function in the virtual machine to obtain a target callback event function.
Wherein the Native function is for example a Native function implemented based on the C language.
A local programming interface, such as the local Native interface provided by the JVMTI layer.
For example, the callbackmethod entry and callbackmethod exit functions may be predefined in the local Native functions.
Then, event triggering logic (such as the function name of a print triggering event) can be respectively realized, logic when the target callback event is triggered is respectively realized, and a predefined callbackmethod entry function and a callbackmethod exit function are respectively pointed to the triggering event function in the virtual machine.
And then, the trigger event function obtained by association can be registered by setting an event notification mode function (SetEventNotification node function) so as to obtain a target callback event function.
For example, the 2 function sub-tables are pointed to the methodsentry and MethodExit of jvmtiEventCallbacks, and the setup at the JVM layer is done through SetEventCallbacks. Thus, when a function in an application program to be actually monitored is triggered, the execution of the function can be triggered.
Through the steps, the registration setting of the target agent program in the JVM layer can be realized.
Thus, in the present embodiment, by adding a native function in the target agent program; calling a local programming interface by adopting a local function, and associating the local function with a trigger event function in the virtual machine; the trigger event function obtained by association is registered by adopting the set event notification mode function in the virtual machine to obtain the target callback event function, so that the registration setting of the target agent program in the virtual machine can be realized, the convenience of the registration of the target agent program is effectively assisted, and the target agent program can be ensured to respond quickly after being started so as to generate call chain information.
S405: an application to be listened to is determined.
S406: and determining a starting instruction corresponding to the application program to be monitored, and analyzing from the starting instruction to obtain a target identification.
S407: and starting a target agent program corresponding to the target mark, wherein the target agent program calls a target callback event function of the virtual machine after starting.
S408: and generating call chain information among a plurality of functions of the application program to be monitored based on the target callback event function.
The descriptions of S405-S408 may be specifically referred to the above embodiments, and are not repeated here.
In this embodiment, by creating the target agent, configuring the target identifier for the target agent, associating the target identifier with the access path of the target agent, configuring the target authority for the target agent, and calling the local programming interface with the target agent to register the target callback event function with the virtual machine, it is possible to support quick and accurate determination of the storage location of the target agent directly based on the target identifier, and the storage location is available via the access path route, so that when the application program to be monitored is started, it is possible to assist in acquiring the target agent in real time based on the target identifier, and support real-time starting for the target agent. Therefore, the interactive control effect of the interactive control of the target Agent and the JVMTI is guaranteed, the function of generating the call chain information for the target Agent configuration based on the interaction of the target Agent and the JVMTI is realized, the monitoring range can be effectively guaranteed, and the situation that any call condition is perceived and recorded by the target Agent can be realized.
Fig. 5 is a schematic diagram according to a fourth embodiment of the present disclosure.
As shown in fig. 5, the call chain information generating apparatus 50 includes:
a first determining module 501, configured to determine an application program to be listened to;
the second determining module 502 is configured to determine a start instruction corresponding to the application to be monitored, and parse the start instruction to obtain a target identifier;
a starting module 503, configured to start a target agent corresponding to the target identifier, where the target agent invokes a target callback event function of the virtual machine after starting;
the generating module 504 is configured to generate call chain information between a plurality of functions of the application program to be monitored based on the target callback event function.
In some embodiments of the present disclosure, as shown in fig. 6, the generating means 60 of calling chain information includes: the first determining module 601, the second determining module 602, the starting module 603, and the generating module 604, wherein the method further comprises:
a creation module 605 for creating a target agent;
a first configuration module 606, configured to configure a target identifier for the target agent, and associate the target identifier with an access path of the target agent;
a second configuration module 607 for configuring a target authority for a target agent, wherein the target agent can invoke a local programming interface of the virtual machine based on the target authority; and
and a calling module 608, configured to call the local programming interface with the target agent program to register the target callback event function with the virtual machine.
In some embodiments of the present disclosure, as shown in fig. 6, further comprising:
the third configuration module 609 is configured to obtain an initial startup instruction corresponding to the application to be monitored, obtain an access path corresponding to the target identifier, write the call parameter into the initial startup instruction, associate the access path with the initial startup instruction, and configure the initial startup instruction obtained by association as a startup instruction corresponding to the application to be monitored.
In some embodiments of the present disclosure, the invoking module 608 is specifically configured to:
adding a local function in the target agent program;
calling the local programming interface by adopting a local function, and associating the local function with a trigger event function in the virtual machine;
and registering the trigger event function obtained by association by adopting a set event notification mode function in the virtual machine to obtain a target callback event function.
In some embodiments of the present disclosure, the startup module 603 is specifically configured to:
and starting the target agent program corresponding to the target identifier while starting the application program to be monitored.
In this embodiment, by determining an application program to be monitored, determining a start instruction corresponding to the application program to be monitored, analyzing from the start instruction to obtain a target identifier, and starting a target agent program corresponding to the target identifier, the target agent program calls a target callback event function of the virtual machine after starting, and generates call chain information among a plurality of functions of the application program to be monitored based on the target callback event function, the integrity of the call chain information can be effectively improved, and the efficiency and the generation effect of the call chain information generation can be effectively improved.
According to an embodiment of the disclosure, the disclosure further provides an electronic device, a readable storage medium.
Fig. 7 illustrates a schematic block diagram of an example electronic device 700 that may be used to implement embodiments of the present disclosure.
Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 7, the apparatus 700 includes a computing unit 701 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 702 or a computer program loaded from a storage unit 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 may also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Various components in device 700 are connected to I/O interface 705, including: an input unit 706 such as a keyboard, a mouse, etc.; an output unit 707 such as various types of displays, speakers, and the like; a storage unit 708 such as a magnetic disk, an optical disk, or the like; and a communication unit 709 such as a network card, modem, wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The computing unit 701 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 701 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 701 performs the respective methods and processes described above, for example, a call chain information generation method. For example, in some embodiments, the method of generating call chain information may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 700 via ROM 702 and/or communication unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the above-described generation method of call chain information may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform the method of generating the call chain information in any other suitable way (e.g. by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, 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, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), the internet, and blockchain networks.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service ("Virtual Private Server" or simply "VPS") are overcome. The server may also be a server of a distributed system or a server that incorporates a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel, sequentially, or in a different order, provided that the desired results of the technical solutions provided by the present disclosure are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (8)

1. A method of generating call chain information, comprising:
creating a target agent program;
configuring a target identifier for the target agent program and associating the target identifier with an access path of the target agent program;
configuring a target authority for the target agent, wherein the target agent can call a local programming interface of a virtual machine based on the target authority;
calling the local programming interface by adopting the target agent program to register a target callback event function to the virtual machine;
acquiring an initial starting instruction corresponding to an application program to be monitored; acquiring an access path corresponding to the target identifier;
writing a call parameter into the initial start instruction, and associating the access path with the initial start instruction;
configuring the initial starting instruction obtained by association as a starting instruction corresponding to the application program to be monitored;
determining the application program to be monitored;
determining the starting instruction corresponding to the application program to be monitored, and analyzing from the starting instruction to obtain the target identification;
starting the target agent program corresponding to the target identifier, wherein the target agent program calls the target callback event function of the virtual machine after starting; and
and generating call chain information among a plurality of functions of the application program to be monitored based on the target callback event function.
2. The method of claim 1, wherein the invoking the local programming interface with the target agent to register the target callback event function with the virtual machine comprises:
adding a local function among the target agents;
invoking the local programming interface with the local function and associating the local function with a trigger event function within the virtual machine;
and registering the trigger event function obtained by association by adopting a set event notification mode function in the virtual machine so as to obtain the target callback event function.
3. The method of claim 1, wherein the launching the target agent corresponding to the target identity comprises:
and starting the target agent program corresponding to the target identifier while starting the application program to be monitored.
4. A call chain information generating apparatus comprising:
the creation module is used for creating a target agent program;
a first configuration module, configured to configure a target identifier for the target agent, and associate the target identifier with an access path of the target agent;
a second configuration module, configured to configure a target authority for the target agent, where the target agent may invoke a local programming interface of a virtual machine based on the target authority;
the calling module is used for calling the local programming interface by adopting the target agent program so as to register a target callback event function to the virtual machine;
the third configuration module is used for acquiring an initial starting instruction corresponding to the application program to be monitored; acquiring an access path corresponding to the target identifier; writing a call parameter into the initial start instruction, and associating the access path with the initial start instruction; configuring the initial starting instruction obtained by association as a starting instruction corresponding to the application program to be monitored;
the first determining module is used for determining the application program to be monitored;
the second determining module is used for determining the starting instruction corresponding to the application program to be monitored and analyzing the starting instruction to obtain the target identifier;
the starting module is used for starting the target agent program corresponding to the target identifier, wherein the target agent program calls the target callback event function of the virtual machine after being started; and
and the generating module is used for generating call chain information among a plurality of functions of the application program to be monitored based on the target callback event function.
5. The device of claim 4, wherein the calling module is specifically configured to:
adding a local function among the target agents;
invoking the local programming interface with the local function and associating the local function with a trigger event function within the virtual machine;
and registering the trigger event function obtained by association by adopting a set event notification mode function in the virtual machine so as to obtain the target callback event function.
6. The device of claim 4, wherein the starting module is specifically configured to:
and starting the target agent program corresponding to the target identifier while starting the application program to be monitored.
7. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-3.
8. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-3.
CN202110637629.7A 2021-06-08 2021-06-08 Call chain information generation method and device, electronic equipment and storage medium Active CN113377614B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110637629.7A CN113377614B (en) 2021-06-08 2021-06-08 Call chain information generation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110637629.7A CN113377614B (en) 2021-06-08 2021-06-08 Call chain information generation method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113377614A CN113377614A (en) 2021-09-10
CN113377614B true CN113377614B (en) 2023-07-25

Family

ID=77576550

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110637629.7A Active CN113377614B (en) 2021-06-08 2021-06-08 Call chain information generation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113377614B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113885997A (en) * 2021-10-19 2022-01-04 深圳市元征科技股份有限公司 Dialog box display method and device, electronic equipment and storage medium
CN114911541B (en) * 2022-06-06 2023-09-01 北京百度网讯科技有限公司 Processing method and device of configuration information, electronic equipment and storage medium
CN116302218B (en) * 2023-03-15 2024-05-10 北京百度网讯科技有限公司 Function information adding method, device, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102222037A (en) * 2010-04-15 2011-10-19 国际商业机器公司 Method and equipment for positioning bottleneck of JAVA program
CN110007957A (en) * 2018-12-17 2019-07-12 阿里巴巴集团控股有限公司 Call link construction method, device and equipment
CN110069358A (en) * 2019-04-18 2019-07-30 彩讯科技股份有限公司 Call chain trace analysis method, apparatus, electronic equipment and storage medium
CN111026601A (en) * 2019-09-23 2020-04-17 拉扎斯网络科技(上海)有限公司 Monitoring method and device for Java application system, electronic equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9491247B2 (en) * 2012-02-02 2016-11-08 AppDynamics, Inc. Automatic capture of detailed analysis information based on remote server analysis
US9996379B2 (en) * 2016-01-25 2018-06-12 International Business Machines Corporation Program execution without the use of bytecode modification or injection

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102222037A (en) * 2010-04-15 2011-10-19 国际商业机器公司 Method and equipment for positioning bottleneck of JAVA program
CN110007957A (en) * 2018-12-17 2019-07-12 阿里巴巴集团控股有限公司 Call link construction method, device and equipment
CN110069358A (en) * 2019-04-18 2019-07-30 彩讯科技股份有限公司 Call chain trace analysis method, apparatus, electronic equipment and storage medium
CN111026601A (en) * 2019-09-23 2020-04-17 拉扎斯网络科技(上海)有限公司 Monitoring method and device for Java application system, electronic equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于进程生命周期的虚拟机隐藏进程检测技术;陈蒙蒙;陈兴蜀;金鑫;;计算机应用(第S2期);44-48 *
轻量级分布式追踪系统的设计与实现;温小斌;张达;诸映晴;;计算机时代(第09期);68-70 *

Also Published As

Publication number Publication date
CN113377614A (en) 2021-09-10

Similar Documents

Publication Publication Date Title
CN113377614B (en) Call chain information generation method and device, electronic equipment and storage medium
CN110096424B (en) Test processing method and device, electronic equipment and storage medium
CN111831542B (en) API application debugging method and device and storage medium
CN111158741A (en) Method and device for monitoring change of dependency relationship of business module on third-party class library
CN112527281B (en) Operator upgrading method and device based on artificial intelligence, electronic equipment and medium
US20130300744A1 (en) Creating dynamic interactive views from trace events for performing deterministic performance analysis
CN111797020A (en) Mock data method and device based on dynamic bytecode
CN114490126A (en) Page processing method and device, electronic equipment and storage medium
CN114090365A (en) Method, device and equipment for performing function test by using dynamic link library
CN114417780A (en) State synchronization method and device, electronic equipment and storage medium
CN113778849A (en) Method, apparatus, device and storage medium for testing code
CN114389969A (en) Client test method and device, electronic equipment and storage medium
CN113220367A (en) Applet running method and device, electronic equipment and storage medium
CN112925522A (en) Dependency graph generation method, dependency graph generation device, dependency graph generation apparatus, storage medium, and program product
CN112835639A (en) Hook implementation method, device, equipment, medium and product
CN111124627B (en) Method and device for determining call initiator of application program, terminal and storage medium
CN114610446B (en) Method, device and system for automatically injecting probe
CN114881235A (en) Inference service calling method and device, electronic equipment and storage medium
CN113377381A (en) Method and device for distributing small program package, electronic equipment and medium
CN114237686A (en) Installation package generation method and device, electronic equipment and storage medium
CN113568797B (en) Testing method and device of intelligent interaction system, electronic equipment and medium
CN113360365A (en) Flow testing method and flow testing system
CN110990078B (en) Application initialization method and device, storage medium and mobile terminal
CN116431108B (en) Object type processing method and device, electronic equipment and storage medium
CN116302086A (en) Application processing method and device, electronic equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant