CN112559290B - Service call monitoring method, device, computer equipment and storage medium - Google Patents

Service call monitoring method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN112559290B
CN112559290B CN202011468124.4A CN202011468124A CN112559290B CN 112559290 B CN112559290 B CN 112559290B CN 202011468124 A CN202011468124 A CN 202011468124A CN 112559290 B CN112559290 B CN 112559290B
Authority
CN
China
Prior art keywords
monitored
service
monitoring
agent class
calling
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
CN202011468124.4A
Other languages
Chinese (zh)
Other versions
CN112559290A (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.)
Ping An International Financial Leasing Co Ltd
Original Assignee
Ping An International Financial Leasing 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 Ping An International Financial Leasing Co Ltd filed Critical Ping An International Financial Leasing Co Ltd
Priority to CN202011468124.4A priority Critical patent/CN112559290B/en
Publication of CN112559290A publication Critical patent/CN112559290A/en
Application granted granted Critical
Publication of CN112559290B publication Critical patent/CN112559290B/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/3089Monitoring arrangements determined by the means or processing involved in sensing the monitored data, e.g. interfaces, connectors, sensors, probes, agents
    • G06F11/3093Configuration details thereof, e.g. installation, enabling, spatial arrangement of the probes
    • 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/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons

Abstract

The present invention relates to the field of big data technologies, and in particular, to a method and apparatus for monitoring service call, a computer device, and a storage medium. The method comprises the following steps: receiving a starting instruction of a service system to be monitored, and starting the service system to be monitored according to the starting instruction; calling a monitoring component corresponding to the service system to be monitored according to the starting instruction; based on the monitoring component, generating a monitoring agent class corresponding to each service to be monitored in the service system to be monitored; receiving a call instruction for each service to be monitored; and calling the monitoring proxy class corresponding to each service to be monitored according to each calling instruction, and executing the calling of the corresponding service to be monitored through the monitoring proxy class. The method can reduce the coupling between the service system and the monitoring code. In addition, the invention also relates to a blockchain technology, and starting instructions, monitoring components, monitoring agent classes and calling instructions can be stored in the blockchain.

Description

Service call monitoring method, device, computer equipment and storage medium
Technical Field
The present invention relates to the field of big data technologies, and in particular, to a method and apparatus for monitoring service call, a computer device, and a storage medium.
Background
With the widespread use of computer technology, enterprises are increasingly dependent on various application systems. In order to track the status of an application in real time, a service code layer in the application is generally monitored in real time, for example, the execution process of a section of code is monitored, then the time-consuming condition of the code is counted, whether an error is generated, and the like, so as to perform performance analysis.
In the conventional manner, a monitoring code is typically added to a service code. This approach will make the monitoring code part of the business code, not only a development effort, but also intrusive to the business system, resulting in a very large coupling. And, each time the monitoring policy is adjusted, the service system needs to be developed again.
Thus, how to solve the coupling between the service system and the monitoring code is a problem to be solved.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a service call monitoring method, apparatus, computer device, and storage medium capable of reducing the coupling between a service system and a monitoring code.
A method of monitoring service invocation, the method comprising:
receiving a starting instruction of a service system to be monitored, and starting the service system to be monitored according to the starting instruction;
Calling a monitoring component corresponding to the service system to be monitored according to the starting instruction;
based on the monitoring component, generating a monitoring agent class corresponding to each service to be monitored in the service system to be monitored;
receiving a call instruction for each service to be monitored;
and calling the monitoring proxy class corresponding to each service to be monitored according to each calling instruction, and executing the calling of the corresponding service to be monitored through the monitoring proxy class.
In one embodiment, based on the monitoring component, generating a monitoring agent class corresponding to each service to be monitored in the service system to be monitored includes:
acquiring a configuration file corresponding to the monitoring component;
determining a service source program to be monitored of each service to be monitored of the service system to be monitored based on the configuration file;
and generating a monitoring agent class corresponding to each service to be monitored according to each service source program to be monitored.
In one embodiment, according to each service source program to be monitored, a monitoring agent class corresponding to each service to be monitored is generated, including:
acquiring a preset monitoring source program;
and respectively adding each service source program to be monitored into the monitoring source program to generate a monitoring agent class corresponding to each service to be monitored.
In one embodiment, after executing the call to the corresponding service to be monitored by the monitoring agent class, the method further includes:
Recording call data for calling the corresponding service to be monitored through each monitoring agent class;
generating monitoring data corresponding to the service to be monitored according to the call data;
and storing the monitoring data into a data queue and asynchronously uploading the monitoring data to a monitoring platform.
In one embodiment, the method further comprises:
acquiring a source file of a service system to be monitored, wherein the source file comprises service source programs to be monitored of each service to be monitored in the service system to be monitored;
identifying each service to be monitored of the service system to be monitored from the source file, and correspondingly acquiring a service source program to be monitored of each service to be monitored;
and writing the service source programs to be monitored of the services to be monitored into the blank monitoring components to generate monitoring components corresponding to the service systems to be monitored.
In one embodiment, the method further comprises:
and uploading at least one of the starting instruction, the monitoring component, the monitoring agent class and the calling instruction to the blockchain node for storage.
A service invocation monitoring device, the device comprising:
the starting instruction receiving module is used for receiving a starting instruction of the service system to be monitored and starting the service system to be monitored according to the starting instruction;
The monitoring component calling module is used for calling a monitoring component corresponding to the service system to be monitored according to the starting instruction;
the monitoring agent class generating module is used for generating a monitoring agent class corresponding to each service to be monitored in the service system to be monitored based on the monitoring component;
the calling instruction receiving module is used for receiving calling instructions for each service to be monitored;
and the service calling module is used for calling the monitoring proxy class corresponding to each service to be monitored according to each calling instruction and executing the calling of the corresponding service to be monitored through the monitoring proxy class.
In one embodiment, the monitoring agent class generating module includes:
the configuration file acquisition sub-module is used for acquiring the configuration file corresponding to the monitoring component;
the service source program to be monitored determining submodule is used for determining service source programs to be monitored of all the services to be monitored corresponding to the service system to be monitored based on the configuration file;
and the monitoring agent class generating sub-module is used for generating the monitoring agent class corresponding to each service to be monitored according to each service source program to be monitored.
A computer device comprising a memory storing a computer program and a processor implementing the steps of any of the methods of the embodiments described above when the processor executes the computer program.
A computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method of any of the embodiments described above.
The service call monitoring method, the device, the computer equipment and the storage medium are used for receiving the starting instruction of the service system to be monitored, starting the service system to be monitored according to the starting instruction, calling the monitoring component corresponding to the service system to be monitored according to the starting instruction, then generating the monitoring agent class corresponding to each service to be monitored in the service system to be monitored based on the monitoring component, receiving the calling instruction of the service to be monitored, calling the monitoring agent class corresponding to the service to be monitored according to the calling instruction, and calling the service to be monitored through the monitoring agent class. Therefore, the monitoring agent class corresponding to the service to be monitored can be generated through the monitoring component, then the call of the service to be monitored is monitored through the monitoring agent class, the coupling between the service system and the monitoring system can be solved, the development flow of the service system is reduced, and the development efficiency is improved.
Drawings
FIG. 1 is an application scenario diagram of a business call monitoring method in one embodiment;
FIG. 2 is a flow diagram of a method for monitoring service calls in one embodiment;
FIG. 3 is a flow diagram of a monitoring agent class generation step in one embodiment;
FIG. 4 is a flow chart of a method for monitoring service call in another embodiment;
FIG. 5 is a block diagram of a service invocation monitoring device in one embodiment;
fig. 6 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The service call monitoring method provided by the application can be applied to an application environment shown in figure 1. Wherein the terminal 102 communicates with the server 104 via a network. The user may generate a start instruction by triggering the service system to be monitored on the terminal 102. After receiving the start instruction of the service system to be monitored, the server 104 may start the service system to be monitored according to the start instruction. Further, the server 104 may call a monitoring component corresponding to the service system to be monitored according to the start instruction, and generate a monitoring proxy class corresponding to each service to be monitored in the service system to be monitored based on the monitoring component. Further, the server 104 may receive a call instruction for each service to be monitored, call a monitoring proxy class corresponding to each service to be monitored according to each call instruction, and execute the call for the corresponding service to be monitored through the monitoring proxy class. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smartphones, tablet computers, and portable wearable devices, and the server 104 may be implemented by a stand-alone server or a server cluster composed of a plurality of servers.
In one embodiment, as shown in fig. 2, a service call monitoring method is provided, and the method is applied to the server in fig. 1 for illustration, and includes the following steps:
step S202, receiving a starting instruction of the service system to be monitored, and starting the service system to be monitored according to the starting instruction.
The starting instruction is an instruction generated by a user through triggering the terminal and used for starting the service system to be monitored, and the starting instruction can carry a system identifier of the service system to be started and the like.
The service system to be monitored refers to a system which needs to be monitored in the scheme. In this embodiment, the service system to be monitored may be a called system in a system service relationship. Further, the service system to be monitored can be a leasing system or a financing system, etc. triggered from the specific service perspective.
In this embodiment, the service specifically refers to various services constituting a service system, for example, a rental service, a financing service, or other services. Further, the service may also refer to various methods or functions in the service system, which is not limited in this application.
In this embodiment, the server may generate a start instruction based on a trigger operation of the terminal to request to start the service system to be monitored. After receiving the starting instruction of the service system to be monitored sent by the terminal, the server can start the service system to be monitored based on the starting instruction.
Step S204, calling a monitoring component corresponding to the service system to be monitored according to the starting instruction.
The monitoring component is a component which is pre-constructed and used for monitoring the service system to be monitored. The method can specifically refer to a component independent of the service system to be monitored, and the composition of a code program of the component is completely independent of the service system to be monitored in the method, so that the strong correlation between the service system and the monitoring system is solved.
In this embodiment, the monitoring component may include monitoring matters of the service system to be monitored, for example, a service type and a service method to be monitored, for example, a class method set, or may include a service code corresponding to the service to be monitored.
In this embodiment, the server may pre-construct a monitoring component corresponding to the service system to be monitored, and then call the corresponding monitoring component according to the system identifier or the system name when receiving a start instruction of the service system to be monitored or detecting that the service system to be monitored is started.
Step S206, based on the monitoring component, generating a monitoring agent class corresponding to each service to be monitored in the service system to be monitored.
The monitoring agent class refers to a method class for carrying out agent on service source programs to be monitored of the service to be monitored, and each service source program to be monitored corresponds to the corresponding monitoring agent class one by one.
In this embodiment, the server may generate, through the invoked monitoring component, a monitoring proxy class corresponding to each service to be monitored in the service system to be monitored.
Specifically, the server may traverse each service to be monitored in the service system to be monitored according to the monitoring component, acquire a service source program to be monitored corresponding to each service to be monitored, and then generate a monitoring agent class corresponding to each service to be monitored according to the acquired service source program to be monitored.
Step S208, receiving a call instruction for each service to be monitored.
The calling instruction refers to an instruction of the calling system to call a corresponding service function in the called system, or may also refer to an instruction of the calling service in the same service system to call the called service. The calling instruction can carry the service identifier of the called service to be monitored.
In this embodiment, when a system is invoked or a service is invoked to execute a task, the service to be monitored in the service system to be monitored in the application may be invoked based on the requirement of the executed task. At this time, the calling system or the calling service may generate a calling instruction for calling the called service, that is, an instruction for calling the service to be monitored, and then send the server.
In this embodiment, the server may determine, according to the service identifier carried in the call instruction, the service to be monitored that is called by the call instruction, and execute the post-processing.
Step S210, calling the monitoring agent class corresponding to each service to be monitored according to each calling instruction, and executing the calling of the corresponding service to be monitored through the monitoring agent class.
In this embodiment, the server may call, according to the call instruction, a monitoring proxy class corresponding to the service system to be monitored, for example, according to information such as a service identifier, and query a monitoring proxy class corresponding to each service to be monitored in the generated service system to be monitored, so as to determine the monitoring proxy class corresponding to the called service to be monitored.
Further, the server can call the service to be monitored corresponding to the call instruction through the obtained monitoring agent class so as to monitor the call of the service to be monitored.
In the service call monitoring method, the service system to be monitored is started according to the starting instruction by receiving the starting instruction of the service system to be monitored, the monitoring component corresponding to the service system to be monitored is called according to the starting instruction, then the monitoring agent class corresponding to each service to be monitored in the service system to be monitored is generated based on the monitoring component, the calling instruction of the service to be monitored is received, the monitoring agent class corresponding to the service to be monitored is called according to the calling instruction, and the service to be monitored is called through the monitoring agent class. Therefore, the monitoring agent class corresponding to the service to be monitored can be generated through the monitoring component, then the call of the service to be monitored is monitored through the monitoring agent class, the coupling between the service system and the monitoring system can be solved, the development flow of the service system is reduced, and the development efficiency is improved.
In one embodiment, referring to fig. 3, based on the monitoring component, generating a monitoring agent class corresponding to each service to be monitored in the service system to be monitored includes:
step S302, a configuration file corresponding to the monitoring component is obtained.
The configuration file refers to a pre-configured file corresponding to the monitoring component.
In this embodiment, the server may query and obtain the configuration file of the corresponding monitoring component from the database based on the call to the monitoring component.
Step S304, determining service source programs to be monitored corresponding to the services to be monitored of the service system to be monitored based on the configuration file.
The service source program to be monitored refers to a code program for forming the service to be monitored, for example, "com.
In this embodiment, the server identifies the configuration file, determines each service to be monitored corresponding to the service system to be monitored from the configuration file, and then obtains the service source program to be monitored corresponding to each service to be monitored from the configuration file or the source file corresponding to the service system to be monitored.
In this embodiment, when the server obtains the service source program to be monitored corresponding to each service to be monitored from the source file corresponding to the service system to be monitored, the server may query the source file corresponding to the service system to be monitored according to the service to be monitored determined from the configuration file, and obtain the corresponding service source program to be monitored.
Step S306, according to each service source program to be monitored, a monitoring agent class corresponding to each service to be monitored is generated.
Specifically, after the server obtains the service source programs corresponding to each service to be monitored, the server may convert the monitoring proxy class corresponding to the service to be monitored.
In this embodiment, the server determines each service to be monitored through the configuration file, and generates the monitoring proxy class corresponding to each service to be monitored may be parallel multithreaded execution. For example, the server reads the configuration file through one thread, determines the service to be monitored, then determines the service source program to be monitored of each service to be monitored through a plurality of parallel threads, and generates the monitoring agent class corresponding to each service to be monitored.
In the above embodiment, the configuration file corresponding to the monitoring component is obtained according to the monitoring component, then each service to be monitored corresponding to the service system to be monitored is determined based on the configuration file, and according to each service to be monitored, the service source program to be monitored corresponding to each service to be monitored is obtained, and the monitoring agent class corresponding to each service to be monitored is generated. Therefore, the monitoring of the service system to be monitored can be performed without the mode of burying points in the system code, and the strong coupling between the service system and the monitoring system is solved. In addition, the business system to be monitored does not need to be monitored in a point burying mode in the system code, so that the workload when writing the system program of the business system to be monitored can be reduced.
In one embodiment, according to each service source program to be monitored, generating a monitoring agent class corresponding to each service to be monitored may include: acquiring a preset monitoring source program; and respectively adding each service source program to be monitored into the monitoring source program to generate a monitoring agent class corresponding to each service to be monitored.
The monitoring source program is a program for monitoring the service to be monitored, and is a code program which is written in advance.
In this embodiment, the server may acquire a pre-written monitoring source program from the database, then acquire service source programs to be monitored corresponding to the services to be monitored, and add the acquired service source programs to be monitored to the monitoring source programs respectively, so as to generate a monitoring agent class corresponding to the services to be monitored.
Specifically, the server may search and acquire a service source program to be monitored of the corresponding service to be monitored from the source file corresponding to the service system according to the service identifier or the service name of each service to be monitored, and then add the searched service source program to the monitoring source program to generate a monitoring agent class corresponding to the service to be monitored.
Specifically, the service source program to be monitored of the service to be monitored may be as follows:
Object res=invocation.proceed();
t.setSuccessStatus();
return res;
}catch(Throwable e){
t.setStatus(e);
Radm.logError(e);
throw e;
}finally{
t.complete();
The generated monitoring agent class may be as follows:
@Override
public Object invoke(MethodInvocation invocation)throws Throwable{
Method method=invocation.getMethod();
Transaction t=Radm.newTransaction(getType(method),getName(method));
try{
Object res=invocation.proceed();
t.setSuccessStatus();
return res;
}catch(Throwable e){
t.setStatus(e);
Radm.logError(e);
throw e;
}finally{
t.complete();
}
}
in this embodiment, the server may generate, in parallel, a monitoring proxy class corresponding to each service to be monitored according to each service source program to be monitored, so that data processing efficiency may be improved.
In the above embodiment, by acquiring the preset monitoring source program, each service source program to be monitored is added to the monitoring source program, and the monitoring agent class corresponding to each service to be monitored is generated, so that the related data of the service system can be not changed when the monitoring agent class is generated, and the stability of the service system is ensured.
In one embodiment, referring to fig. 4, after the monitoring agent class performs the call to the corresponding service to be monitored, the method may further include:
step S402, recording call data for calling the corresponding service to be monitored through each monitoring agent class.
The call data refers to data generated when a call system or a call service calls a called service, and may include, but is not limited to, data such as a service identifier, a call time, a call duration, a call interface, and the like of the call and the called service.
In this embodiment, when the server executes the call to the service to be monitored through the monitoring proxy class, the server may record the information data of the service to be monitored through the monitoring proxy class, so as to generate call data.
Step S404, monitoring data corresponding to the service to be monitored is generated according to the calling data.
The monitoring data refers to data for monitoring the service to be monitored, and may include all data contents of the calling data.
In this embodiment, after the server obtains the call data according to the service to be monitored, the monitoring data may be generated according to the call data. Specifically, the server can compress the call data recorded by the monitoring agent class at regular time in a manner of a regular task, and generate the monitoring data corresponding to the call data according to the data format requirement required by the monitoring platform.
Step S406, the monitoring data are stored in the data queue and are asynchronously uploaded to the monitoring platform.
In this embodiment, since the server may monitor a plurality of services to be monitored in the service system to be monitored, or may monitor a plurality of service systems to be monitored, the data size of the generated monitoring data is particularly large, and when one monitoring data is generated, the monitoring platform is requested to be sent, which easily causes congestion of an uploading line, and further the system runs.
In this embodiment, the server may store the generated monitoring data in the data queue, and then obtain the monitoring data from the data queue according to the data transmission requirement of the monitoring platform, for example, transmission efficiency, and send the monitoring data to the monitoring platform, so as to ensure the stability of the system operation.
In this embodiment, the server may be configured with a plurality of data queues, and when the server needs to monitor a plurality of service systems at the same time, or monitor a plurality of services to be monitored of the same service system, the monitoring data of different service systems or the monitoring data of different services to be monitored may be stored in different data queues, so as to distinguish the data of different services or different systems. And then when uploading the finger monitoring receipt, acquiring monitoring data from each data queue in turn according to the generation time sequence of the monitoring data in each data queue, and uploading the monitoring data.
In one embodiment, the server may further set priorities of different systems or different data to be monitored, and then obtain the monitoring data in the corresponding data queue according to the priorities and upload the monitoring data to the monitoring platform when uploading the monitoring platform.
In the above embodiment, the call data for calling the service to be monitored is recorded by the monitoring proxy class, the monitoring data corresponding to the service to be monitored is generated according to the call data, and the monitoring data is stored in the data queue and asynchronously uploaded to the monitoring platform, so that the monitoring platform can acquire the state of the service called in the service system, the monitoring of the service system is realized, and the running stability of the system is ensured. And the data queue is used for carrying out asynchronous uploading of the monitoring data, so that when a large amount of data needs to be uploaded, the data uploading pressure can be relieved through the data queue, the system is prevented from running or being blocked, and the running stability of the system is improved.
In one embodiment, the method further comprises: acquiring a source file of a service system to be monitored, wherein the source file comprises service source programs to be monitored of each service to be monitored in the service system to be monitored; identifying each service to be monitored of the service system to be monitored from the source file, and correspondingly acquiring a service source program to be monitored of each service to be monitored; and writing the service source programs to be monitored of the services to be monitored into the blank monitoring components to generate monitoring components corresponding to the service systems to be monitored.
In this embodiment, the server may obtain a source file of the service system, then identify each service to be monitored of the service system to be monitored by identifying a packet name in a service code or by using a regular expression matching method, for example, a Class set represented by the packet name in the service code or a Class method set matched according to a regular expression, for example, a Class method representing Class beginning with query in all classes under the packet, i.e., a Class 1.service, and write the identified service to be monitored into a blank monitoring component to obtain a monitoring component corresponding to the service system to be monitored.
In the above embodiment, each service to be monitored of the service system to be monitored is identified from the source file, and each service to be monitored is written into the blank monitoring component to obtain the monitoring component corresponding to the service system to be monitored, so that the created monitoring component is an independent file independent of the source file of the service system to be monitored, and the strong coupling between the monitoring system and the service system is solved. And when the monitoring of the service system to be monitored is required to be released later, only the corresponding monitoring component is required to be deleted, and the source file of the service system is not required to be updated, so that an unnecessary data processing process can be reduced.
In one embodiment, the method further comprises: and uploading at least one of the starting instruction, the monitoring component, the monitoring agent class and the calling instruction to the blockchain node for storage.
The blockchain refers to a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. The Block chain is essentially a decentralised database, and is a series of data blocks which are generated by correlation using a cryptography method, and each data Block contains information of a batch of network transactions and is used for verifying the validity (anti-counterfeiting) of the information and generating a next Block.
Specifically, the blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
In this embodiment, the server may upload and store one or more data of the startup instruction, the monitoring component, the monitoring agent class, and the call instruction in the nodes of the blockchain to ensure the privacy and security of the data.
In the above embodiment, at least one of the start instruction, the monitoring component, the monitoring agent class and the call instruction is uploaded to the blockchain and stored in the node of the blockchain, so that the privacy of the data stored in the blockchain link point can be ensured, and the security of the data can be improved.
It should be understood that, although the steps in the flowcharts of fig. 2 to 4 are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 2-4 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor does the order in which the sub-steps or stages are performed necessarily occur in sequence, but may be performed alternately or alternately with at least a portion of other steps or sub-steps or stages of other steps.
In one embodiment, as shown in fig. 5, there is provided a service call monitoring apparatus, including: a start instruction receiving module 100, a monitoring component calling module 200, a monitoring agent class generating module 300, a calling instruction receiving module 400 and a service calling module 500, wherein:
the starting instruction receiving module 100 is configured to receive a starting instruction of a service system to be monitored, and start the service system to be monitored according to the starting instruction.
And the monitoring component calling module 200 is used for calling the monitoring component corresponding to the service system to be monitored according to the starting instruction.
The monitoring agent class generating module 300 is configured to generate, based on the monitoring component, a monitoring agent class corresponding to each service to be monitored in the service system to be monitored.
The call instruction receiving module 400 is configured to receive a call instruction for each service to be monitored.
The service calling module 500 is configured to call a monitoring proxy class corresponding to each service to be monitored according to each calling instruction, and execute calling of the corresponding service to be monitored through the monitoring proxy class.
In one embodiment, the monitoring agent class generation module 300 may include:
and the configuration file acquisition sub-module is used for acquiring the configuration file corresponding to the monitoring component.
And the service source program to be monitored determining submodule is used for determining the service source program to be monitored corresponding to each service to be monitored of the service system to be monitored based on the configuration file.
And the monitoring agent class generating sub-module is used for generating the monitoring agent class corresponding to each service to be monitored according to each service source program to be monitored.
In one embodiment, the service monitoring agent class generation sub-module may include:
and the monitoring source program acquisition unit is used for acquiring a preset monitoring source program.
And the service monitoring agent class generating unit is used for respectively adding each service source program to be monitored into the monitoring source program to generate a monitoring agent class corresponding to each service to be monitored.
In one embodiment, the apparatus may further include:
and the call data generation module is used for recording call data for calling the corresponding service to be monitored through each monitoring agent class after the monitoring agent class executes the call of the corresponding service to be monitored.
And the monitoring data generation module is used for generating monitoring data corresponding to the service to be monitored according to the call data.
And the storage and uploading module is used for storing the monitoring data into the data queue and asynchronously uploading the monitoring data to the monitoring platform.
In one embodiment, the apparatus may further include:
the source file acquisition module is used for acquiring a source file of the service system to be monitored, wherein the source file comprises service source programs to be monitored of each service to be monitored in the service system to be monitored.
The service source program acquisition module to be monitored is used for identifying each service to be monitored of the service system to be monitored from the source file and correspondingly acquiring the service source program to be monitored of each service to be monitored.
The monitoring component generating module is used for writing the service source program to be monitored of each service to be monitored into the blank monitoring component to generate a monitoring component corresponding to the service system to be monitored.
In one embodiment, the apparatus may further include:
and the storage module is used for uploading at least one of the starting instruction, the monitoring component, the monitoring agent class and the calling instruction to the blockchain node for storage.
The specific limitation of the service call monitoring device can be referred to the limitation of the service call monitoring method hereinabove, and will not be described herein. The modules in the service call monitoring device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 6. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer equipment is used for storing data such as starting instructions, monitoring components, monitoring agent classes, calling instructions and the like. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a method of monitoring service calls.
It will be appreciated by those skilled in the art that the structure shown in fig. 6 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided comprising a memory storing a computer program and a processor that when executing the computer program performs the steps of: receiving a starting instruction of a service system to be monitored, and starting the service system to be monitored according to the starting instruction; calling a monitoring component corresponding to the service system to be monitored according to the starting instruction; based on the monitoring component, generating a monitoring agent class corresponding to each service to be monitored in the service system to be monitored; receiving a call instruction for each service to be monitored; and calling the monitoring proxy class corresponding to each service to be monitored according to each calling instruction, and executing the calling of the corresponding service to be monitored through the monitoring proxy class.
In one embodiment, the processor, when executing the computer program, generates a monitoring agent class corresponding to each service to be monitored in the service system to be monitored based on the monitoring component, and may include: acquiring a configuration file corresponding to the monitoring component; determining a service source program to be monitored of each service to be monitored of the service system to be monitored based on the configuration file; and generating a monitoring agent class corresponding to each service to be monitored according to each service source program to be monitored.
In one embodiment, when the processor executes the computer program, the generating the monitoring agent class corresponding to each service to be monitored according to each service source program to be monitored may include: acquiring a preset monitoring source program; and respectively adding each service source program to be monitored into the monitoring source program to generate a monitoring agent class corresponding to each service to be monitored.
In one embodiment, after the processor executes the computer program to execute the call to the corresponding service to be monitored through the monitoring agent class, the following steps may be further implemented: recording call data for calling the corresponding service to be monitored through each monitoring agent class; generating monitoring data corresponding to the service to be monitored according to the call data; and storing the monitoring data into a data queue and asynchronously uploading the monitoring data to a monitoring platform.
In one embodiment, the following steps may also be implemented when the processor executes the computer program: acquiring a source file of a service system to be monitored, wherein the source file comprises service source programs to be monitored of each service to be monitored in the service system to be monitored; identifying each service to be monitored of the service system to be monitored from the source file, and correspondingly acquiring a service source program to be monitored of each service to be monitored; and writing the service source programs to be monitored of the services to be monitored into the blank monitoring components to generate monitoring components corresponding to the service systems to be monitored.
In one embodiment, the following steps may also be implemented when the processor executes the computer program: and uploading at least one of the starting instruction, the monitoring component, the monitoring agent class and the calling instruction to the blockchain node for storage.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of: receiving a starting instruction of a service system to be monitored, and starting the service system to be monitored according to the starting instruction; calling a monitoring component corresponding to the service system to be monitored according to the starting instruction; based on the monitoring component, generating a monitoring agent class corresponding to each service to be monitored in the service system to be monitored; receiving a call instruction for each service to be monitored; and calling the monitoring proxy class corresponding to each service to be monitored according to each calling instruction, and executing the calling of the corresponding service to be monitored through the monitoring proxy class.
In one embodiment, the computer program, when executed by the processor, generates a monitoring agent class corresponding to each service to be monitored in the service system to be monitored based on the monitoring component, and may include: acquiring a configuration file corresponding to the monitoring component; determining a service source program to be monitored of each service to be monitored of the service system to be monitored based on the configuration file; and generating a monitoring agent class corresponding to each service to be monitored according to each service source program to be monitored.
In one embodiment, the computer program when executed by the processor generates a monitoring agent class corresponding to each service to be monitored according to each service source program to be monitored, and may include: acquiring a preset monitoring source program; and respectively adding each service source program to be monitored into the monitoring source program to generate a monitoring agent class corresponding to each service to be monitored.
In one embodiment, after the computer program is executed by the processor to implement the execution of the call to the corresponding service to be monitored by the monitoring agent class, the following steps may be implemented: recording call data for calling the corresponding service to be monitored through each monitoring agent class; generating monitoring data corresponding to the service to be monitored according to the call data; and storing the monitoring data into a data queue and asynchronously uploading the monitoring data to a monitoring platform.
In one embodiment, the computer program when executed by the processor may further implement the steps of: acquiring a source file of a service system to be monitored, wherein the source file comprises service source programs to be monitored of each service to be monitored in the service system to be monitored; identifying each service to be monitored of the service system to be monitored from the source file, and correspondingly acquiring a service source program to be monitored of each service to be monitored; and writing the service source programs to be monitored of the services to be monitored into the blank monitoring components to generate monitoring components corresponding to the service systems to be monitored.
In one embodiment, the computer program when executed by the processor may further implement the steps of: and uploading at least one of the starting instruction, the monitoring component, the monitoring agent class and the calling instruction to the blockchain node for storage.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (10)

1. A method for monitoring service invocation, the method comprising:
receiving a starting instruction of a service system to be monitored, and starting the service system to be monitored according to the starting instruction;
invoking a monitoring component corresponding to the service system to be monitored according to the starting instruction; the monitoring component is independent of the service system to be monitored;
Based on the monitoring component, generating a monitoring agent class corresponding to each service to be monitored in the service system to be monitored;
receiving a call instruction for each service to be monitored;
calling the monitoring agent class corresponding to each service to be monitored according to each calling instruction, and executing the calling of the corresponding service to be monitored through the monitoring agent class;
the generating, based on the monitoring component, a monitoring agent class corresponding to each service to be monitored in the service system to be monitored includes:
acquiring a configuration file corresponding to the monitoring component;
determining a service source program to be monitored of each service to be monitored corresponding to the service system to be monitored based on the configuration file;
generating a monitoring agent class corresponding to each service to be monitored according to each service source program to be monitored; the monitoring agent class for generating each service to be monitored is parallel multithreaded execution;
generating a monitoring agent class corresponding to each service to be monitored according to each service source program to be monitored, including:
acquiring a preset monitoring source program;
respectively adding each service source program to be monitored into the monitoring source program to generate a monitoring agent class corresponding to each service to be monitored;
After the call corresponding to the service to be monitored is executed by the monitoring agent class, the method further comprises:
recording call data for calling the corresponding service to be monitored through each monitoring agent class;
generating monitoring data corresponding to the service to be monitored according to each call data;
storing the monitoring data into a data queue and asynchronously uploading the monitoring data to a monitoring platform;
the method further comprises the steps of:
acquiring a source file of the service system to be monitored, wherein the source file comprises service source programs to be monitored of each service to be monitored in the service system to be monitored;
identifying each service to be monitored of the service system to be monitored from the source file, and correspondingly acquiring a service source program to be monitored of each service to be monitored;
and writing the service source program to be monitored of each service to be monitored into a blank monitoring component to generate a monitoring component corresponding to the service system to be monitored.
2. The method according to claim 1, wherein the method further comprises:
and uploading at least one of the starting instruction, the monitoring component, the monitoring agent class and the calling instruction to a blockchain node for storage.
3. The method of claim 1, wherein the call data comprises a service identification, a call time, a call duration, and a call interface.
4. A service invocation monitoring device, the device comprising:
the starting instruction receiving module is used for receiving a starting instruction of the service system to be monitored and starting the service system to be monitored according to the starting instruction;
the monitoring component calling module is used for calling a monitoring component corresponding to the service system to be monitored according to the starting instruction; the monitoring component is independent of the service system to be monitored;
the monitoring agent class generating module is used for generating a monitoring agent class corresponding to each service to be monitored in the service system to be monitored based on the monitoring component;
the calling instruction receiving module is used for receiving calling instructions for the businesses to be monitored;
the service calling module is used for calling the monitoring agent class corresponding to each service to be monitored according to each calling instruction and executing the calling of the corresponding service to be monitored through the monitoring agent class;
the monitoring agent class generation module is further configured to:
acquiring a configuration file corresponding to the monitoring component;
Determining a service source program to be monitored of each service to be monitored corresponding to the service system to be monitored based on the configuration file;
generating a monitoring agent class corresponding to each service to be monitored according to each service source program to be monitored; the monitoring agent class for generating each service to be monitored is parallel multithreaded execution;
the monitoring agent class generating module comprises:
a configuration file acquisition sub-module, configured to acquire a configuration file corresponding to the monitoring component;
the service source program to be monitored determining submodule is used for determining service source programs to be monitored of all services to be monitored corresponding to the service system to be monitored based on the configuration file;
the service monitoring agent class generation sub-module is used for generating a monitoring agent class corresponding to each service to be monitored according to each service source program to be monitored;
the system monitoring agent class generating sub-module is used for obtaining the monitoring agent class corresponding to the service system to be monitored based on the monitoring agent class of each service to be monitored;
the apparatus further comprises:
the call data generation module is used for recording call data for calling the corresponding service to be monitored through each monitoring agent class;
The monitoring data generation module is used for generating monitoring data corresponding to the service to be monitored according to each piece of calling data;
the storage and uploading module is used for storing the monitoring data into a data queue and asynchronously uploading the monitoring data to the monitoring platform;
the source file acquisition module is used for acquiring a source file of the service system to be monitored, wherein the source file comprises service source programs to be monitored of each service to be monitored in the service system to be monitored;
the service source program acquisition module to be monitored is used for identifying each service to be monitored of the service system to be monitored from the source file and correspondingly acquiring the service source program to be monitored of each service to be monitored;
and the monitoring component generating module is used for writing the service source programs to be monitored of the services to be monitored into the blank monitoring components to generate monitoring components corresponding to the service systems to be monitored.
5. The apparatus of claim 4, wherein the apparatus further comprises:
and the storage module is used for uploading at least one of the starting instruction, the monitoring component, the monitoring agent class and the calling instruction to a blockchain node for storage.
6. The apparatus of claim 4, wherein the call data comprises a service identification, a call time, a call duration, and a call interface.
7. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor when executing the computer program performs the steps of:
receiving a starting instruction of a service system to be monitored, and starting the service system to be monitored according to the starting instruction;
invoking a monitoring component corresponding to the service system to be monitored according to the starting instruction; the monitoring component is independent of the service system to be monitored;
based on the monitoring component, generating a monitoring agent class corresponding to each service to be monitored in the service system to be monitored;
receiving a call instruction for each service to be monitored;
calling the monitoring agent class corresponding to each service to be monitored according to each calling instruction, and executing the calling of the corresponding service to be monitored through the monitoring agent class;
the generating, based on the monitoring component, a monitoring agent class corresponding to each service to be monitored in the service system to be monitored includes:
acquiring a configuration file corresponding to the monitoring component;
determining a service source program to be monitored of each service to be monitored corresponding to the service system to be monitored based on the configuration file;
Generating a monitoring agent class corresponding to each service to be monitored according to each service source program to be monitored; the monitoring agent class for generating each service to be monitored is parallel multithreaded execution;
generating a monitoring agent class corresponding to each service to be monitored according to each service source program to be monitored, including:
acquiring a preset monitoring source program;
respectively adding each service source program to be monitored into the monitoring source program to generate a monitoring agent class corresponding to each service to be monitored;
after the call corresponding to the service to be monitored is executed by the monitoring agent class, the method further comprises:
recording call data for calling the corresponding service to be monitored through each monitoring agent class;
generating monitoring data corresponding to the service to be monitored according to each call data;
storing the monitoring data into a data queue and asynchronously uploading the monitoring data to a monitoring platform;
the processor, when executing the computer program, also implements the steps of: acquiring a source file of the service system to be monitored, wherein the source file comprises service source programs to be monitored of each service to be monitored in the service system to be monitored;
Identifying each service to be monitored of the service system to be monitored from the source file, and correspondingly acquiring a service source program to be monitored of each service to be monitored;
and writing the service source program to be monitored of each service to be monitored into a blank monitoring component to generate a monitoring component corresponding to the service system to be monitored.
8. The computer device according to claim 7, wherein the processor when executing the computer program further performs the steps of: and uploading at least one of the starting instruction, the monitoring component, the monitoring agent class and the calling instruction to a blockchain node for storage.
9. The computer device of claim 7, wherein the call data involved in executing the computer program by the processor includes a service identification, a call time, a call duration, and a call interface.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 3.
CN202011468124.4A 2020-12-14 2020-12-14 Service call monitoring method, device, computer equipment and storage medium Active CN112559290B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011468124.4A CN112559290B (en) 2020-12-14 2020-12-14 Service call monitoring method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011468124.4A CN112559290B (en) 2020-12-14 2020-12-14 Service call monitoring method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112559290A CN112559290A (en) 2021-03-26
CN112559290B true CN112559290B (en) 2024-04-05

Family

ID=75064576

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011468124.4A Active CN112559290B (en) 2020-12-14 2020-12-14 Service call monitoring method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112559290B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113138898B (en) * 2021-04-26 2023-01-17 上海淇玥信息技术有限公司 Method and device for identifying and early warning business system abnormity and electronic equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831043A (en) * 2011-06-17 2012-12-19 阿里巴巴集团控股有限公司 Monitoring method and device for application program
CN108595300A (en) * 2018-03-21 2018-09-28 北京奇艺世纪科技有限公司 A kind of method and device of configurable monitoring and alarm
CN109766241A (en) * 2018-12-29 2019-05-17 中国银行股份有限公司 System monitoring method, apparatus, computer equipment and computer readable storage medium
CN110647438A (en) * 2019-08-13 2020-01-03 平安科技(深圳)有限公司 Event monitoring method and device, computer equipment and storage medium
CN111159524A (en) * 2019-12-30 2020-05-15 北京同邦卓益科技有限公司 Monitoring method and system, and storage medium
WO2020147419A1 (en) * 2019-01-18 2020-07-23 深圳壹账通智能科技有限公司 Monitoring method and apparatus, computer device and storage medium
CN111813623A (en) * 2020-06-29 2020-10-23 北京百度网讯科技有限公司 Page monitoring method and device, electronic equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831043A (en) * 2011-06-17 2012-12-19 阿里巴巴集团控股有限公司 Monitoring method and device for application program
CN108595300A (en) * 2018-03-21 2018-09-28 北京奇艺世纪科技有限公司 A kind of method and device of configurable monitoring and alarm
CN109766241A (en) * 2018-12-29 2019-05-17 中国银行股份有限公司 System monitoring method, apparatus, computer equipment and computer readable storage medium
WO2020147419A1 (en) * 2019-01-18 2020-07-23 深圳壹账通智能科技有限公司 Monitoring method and apparatus, computer device and storage medium
CN110647438A (en) * 2019-08-13 2020-01-03 平安科技(深圳)有限公司 Event monitoring method and device, computer equipment and storage medium
CN111159524A (en) * 2019-12-30 2020-05-15 北京同邦卓益科技有限公司 Monitoring method and system, and storage medium
CN111813623A (en) * 2020-06-29 2020-10-23 北京百度网讯科技有限公司 Page monitoring method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN112559290A (en) 2021-03-26

Similar Documents

Publication Publication Date Title
CN112910945B (en) Request link tracking method and service request processing method
CN110290212B (en) Service call recording method, device, computer equipment and storage medium
CN108573371B (en) Data approval method, device, computer equipment and storage medium
US8621282B1 (en) Crash data handling
US7698602B2 (en) Systems, methods and computer products for trace capability per work unit
CN111143133B (en) Virtual machine backup method and backup virtual machine recovery method
JP4570312B2 (en) Method and apparatus for providing volume snapshot dependency in a computer system
CN112035472B (en) Data processing method, device, computer equipment and storage medium
CN112819617B (en) Data uplink method and device, electronic equipment and storage medium
CN110908812B (en) Service data processing method, device, readable storage medium and computer equipment
CN111475376A (en) Method and device for processing test data, computer equipment and storage medium
CN111290919A (en) Log file generation method and device, computer equipment and storage medium
CN114138549A (en) Data backup and recovery method based on kubernets system
CN108512930B (en) Shared file management method, device, server and storage medium
CN112559290B (en) Service call monitoring method, device, computer equipment and storage medium
CN110866011B (en) Data table synchronization method and device, computer equipment and storage medium
CN111796936A (en) Request processing method and device, electronic equipment and medium
CN114281263A (en) Storage resource processing method, system and equipment of container cluster management system
CN115470156A (en) RDMA-based memory use method, system, electronic device and storage medium
CN115794356B (en) Multithread synchronous connection processing method based on SSH server
WO2023071043A1 (en) File aggregation compatibility method and apparatus, computer device and storage medium
CN114513469A (en) Traffic shaping method and device for distributed system and storage medium
CN111274176B (en) Information processing method, electronic equipment, system and storage medium
CN114493598A (en) Computing resource management method, device, computer equipment and storage medium
WO2022237570A1 (en) Deadlock detection method, apparatus, and related device

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