CN114389970A - Link monitoring method and device - Google Patents

Link monitoring method and device Download PDF

Info

Publication number
CN114389970A
CN114389970A CN202111466559.XA CN202111466559A CN114389970A CN 114389970 A CN114389970 A CN 114389970A CN 202111466559 A CN202111466559 A CN 202111466559A CN 114389970 A CN114389970 A CN 114389970A
Authority
CN
China
Prior art keywords
link
micro
monitoring
information
processing
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.)
Pending
Application number
CN202111466559.XA
Other languages
Chinese (zh)
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.)
Zhejiang Geely Holding Group Co Ltd
Zhejiang Shikong Daoyu Technology Co Ltd
Original Assignee
Zhejiang Geely Holding Group Co Ltd
Zhejiang Shikong Daoyu 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 Zhejiang Geely Holding Group Co Ltd, Zhejiang Shikong Daoyu Technology Co Ltd filed Critical Zhejiang Geely Holding Group Co Ltd
Priority to CN202111466559.XA priority Critical patent/CN114389970A/en
Publication of CN114389970A publication Critical patent/CN114389970A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0631Management of faults, events, alarms or notifications using root cause analysis; using analysis of correlation between notifications, alarms or events based on decision criteria, e.g. hierarchy, tree or time analysis
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0677Localisation of faults
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/1066Session management
    • H04L65/1073Registration or de-registration

Abstract

The invention discloses a link monitoring method and device, relates to the technical field of computers, and solves the problem of low timeliness of the link positioning problem. The specific scheme comprises the following steps: the micro-service device receives a link message which comprises a monitoring mode and rule information corresponding to the monitoring mode from the monitoring equipment, determines that the link is abnormal when determining that the processing information meets a preset rule corresponding to the rule information, and sends a tracking message to the monitoring equipment. The processing information is information obtained when the request is processed, and the link is used for representing the process of processing the request. The trace message comprises an entry time and an exit time, the trace message is used for positioning abnormal information of the link, the entry time is the starting time of processing the request, and the exit time is the ending time of processing the request. Therefore, the micro-service device reports the tracking message according to the link message and the preset rule, so that the tracking message is automatically reported, the monitoring equipment analyzes abnormal information conveniently, and the timeliness of locating the link problem is improved.

Description

Link monitoring method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a link monitoring method and apparatus.
Background
With the development of computer technology, the development of applications using microservice architecture is becoming increasingly popular. In the micro-service architecture, the development of an application program is jointly completed by a plurality of micro-service devices which can independently run, and each micro-service device completes one service function of the application program, thereby completing the whole service function of the application program. When the application program is used, if the time from the time when the application program receives the request to the time when each micro-processing module processes the request to the time when the application program generates the response is long, the link tracking of each micro-service device is needed to locate the problem, so that the problem is solved.
In the prior art, link monitoring equipment collects link information of each micro-service device processing request at a certain sampling frequency, and generates and stores a monitoring log according to the link information of each micro-service device, so that a user can locate a problem by calling the monitoring log.
However, in the prior art, in order to reduce resource consumption, a lower sampling frequency is usually configured, so that the timeliness of the problem of locating the link is low.
Disclosure of Invention
The invention provides a link monitoring method and a link monitoring device, which solve the problem of low timeliness of the link positioning problem.
In order to achieve the purpose, the invention adopts the following technical scheme:
in a first aspect, the present invention provides a link monitoring method applied to a microserver device, including:
receiving a link message from monitoring equipment, wherein the link message comprises a monitoring mode and rule information corresponding to the monitoring mode;
determining that a link is abnormal under the condition that the processing information meets a preset rule corresponding to the rule information, wherein the processing information is information obtained when a request is processed, and the link is used for representing the process of processing the request;
sending a tracking message to the monitoring device;
the processing information is information obtained by the micro service device when the micro service device processes the request, the tracking information comprises an entry time and an exit time, the tracking information is used for positioning abnormal information of the link, the entry time is the starting time of the micro service device processing the request, and the exit time is the ending time of the micro service device processing the completion request.
In a possible implementation manner, the link monitoring method further includes: and acquiring processing information at the embedded point by an interceptor technology.
In another possible implementation manner, the monitoring mode is an overtime mode, the rule information includes a preset duration corresponding to the microservice device, and the sending of the trace message to the monitoring device is performed when it is determined that the processing information satisfies a preset rule corresponding to the rule information, where the sending of the trace message includes: acquiring an entrance time and the exit time; determining a processing time length according to the entrance time and the exit time; and determining that the link has abnormity under the condition that the processing time length is greater than the preset time length.
In another possible implementation manner, when the monitoring mode is an interface mode and the rule information includes a preset interface and a preset value corresponding to the microserver, and when it is determined that the processing information satisfies a preset rule corresponding to the rule information, the sending a trace message to the monitoring device includes: calling a preset interface to process the request to obtain a processed return value; and under the condition that the return value and the preset value meet the preset rule, determining that the link is abnormal.
In another possible implementation manner, the method further includes: and sending registration information to the monitoring equipment after starting, wherein the registration information comprises equipment identification, and the equipment identification is used for identifying the micro-service device.
In a second aspect, the present invention provides a link monitoring method applied to a monitoring device, including:
sending a link message to the micro-service device, wherein the link message comprises a monitoring mode and rule information corresponding to the monitoring mode;
receiving a tracking message sent by a micro-service device;
the trace message is sent under the condition that the link is determined to have abnormity, the link is used for representing the process of processing the request, the trace message comprises an entry time and an exit time, the entry time is the starting time of the micro-service device for processing the request, and the exit time is the ending time of the micro-service device for processing the request;
and determining the abnormal information of the link according to the tracking message.
In a possible implementation manner, the method further includes:
receiving registration information from the micro-service device, wherein the registration information comprises a device identifier which is used for identifying the micro-service device; the registration information is stored.
In another possible implementation manner, the sending the link message to the micro service device includes: and transmitting a link message to the registered micro service device based on the stored registration information.
In a third aspect, the present invention provides a microserver device, comprising:
the receiving module is used for receiving a link message from the monitoring equipment, wherein the link message comprises a monitoring mode and rule information corresponding to the monitoring mode;
the determining module is used for determining that the link has abnormity under the condition that the processing information is determined to meet the preset rule corresponding to the rule information;
a sending module, configured to send a trace message to the monitoring device;
the processing information is information obtained when the micro-service device processes a request, the tracking message comprises an entry time and an exit time, the tracking message is used for positioning abnormal information, the entry time is the starting time of the micro-service device processing the request, and the exit time is the ending time of the micro-service device processing the request.
In a possible implementation manner, on the basis of the foregoing embodiment, the determining module is further configured to: and acquiring processing information at the embedded point by an interceptor technology.
In another possible implementation manner, on the basis of the foregoing embodiment, when the monitoring mode is an overtime mode and the rule information includes a preset duration corresponding to the microservice device, the determining module is specifically configured to: acquiring an entrance moment and an exit moment; determining a processing time length according to the entrance time and the exit time; and determining that the link has abnormity under the condition that the processing time length is greater than the preset time length.
In another possible implementation manner, on the basis of the foregoing embodiment, when the monitoring mode is an interface mode and the rule information includes a preset interface and a preset value corresponding to the microserver, the determining module is specifically configured to: calling a preset interface processing request to obtain a processed return value; and determining that the link has abnormity under the condition that the return value is the same as the preset value.
In another possible implementation manner, on the basis of the foregoing embodiment, the micro service device may further include: and the registration module is used for sending registration information to the monitoring equipment after starting, wherein the registration information comprises an equipment identifier, and the equipment identifier is used for identifying the micro-service device.
In a fourth aspect, the present invention provides a monitoring device, comprising:
the sending module is used for sending a link message to the micro-service device, wherein the link message comprises a monitoring mode and rule information corresponding to the monitoring mode;
the first receiving module is used for receiving the tracking message sent by the micro-service device;
the trace message is sent under the condition that the link is determined to have abnormity, the link is used for representing the process of processing the request, the trace message comprises an entry time and an exit time, the entry time is the starting time of the micro-service device for processing the request, and the exit time is the ending time of the micro-service device for processing the request;
and the determining module is used for determining the abnormal information of the link according to the tracking message.
In a possible implementation manner, on the basis of the foregoing embodiment, the monitoring device may further include: the second receiving module is used for receiving registration information from the micro-service device, wherein the registration information comprises a device identifier, and the device identifier is used for identifying the micro-service device; and the storage module is used for storing the registration information.
In another possible implementation manner, on the basis of the foregoing embodiment, the sending module is specifically configured to: and transmitting a link message to the registered micro service device based on the stored registration information.
In a fifth aspect, the present invention provides a microservice device that includes a memory and a processor. The memory is coupled to the processor. The memory is for storing computer program code, the computer program code including computer instructions. When the processor executes the computer instructions, the microserver device performs a link monitoring method as in the first aspect and any possible implementation thereof.
In a sixth aspect, the present invention provides a monitoring device, the microserver comprising a memory and a processor. The memory is coupled to the processor. The memory is for storing computer program code, the computer program code including computer instructions. When the processor executes the computer instructions, the microserver device performs a link monitoring method as in the first aspect and any possible implementation thereof.
In a seventh aspect, the present invention provides a computer-readable storage medium, on which computer instructions are stored, which, when run on a micro service device, cause the micro service device to perform a link monitoring method as in the first aspect or any one of the possible implementations of the first aspect.
In an eighth aspect, the present invention provides a computer-readable storage medium having stored thereon computer instructions which, when run on a monitoring device, cause the monitoring device to perform a link monitoring method as described in the second aspect or any one of its possible implementations.
In a ninth aspect, the present invention provides a link monitoring system, which includes at least one micro service device as in the third aspect and a monitoring apparatus as in the fourth aspect, and is used for implementing the above link monitoring method.
In the link monitoring method provided by the embodiment of the invention, the micro-service device receives the link message which comprises the monitoring mode and the rule information corresponding to the monitoring mode from the monitoring equipment, determines that the link is abnormal when the processing information meets the preset rule corresponding to the rule information, and sends the tracking message to the monitoring equipment. The processing information is information obtained when the request is processed, and the link is used for representing the process of processing the request. The trace message comprises an entry time and an exit time, the trace message is used for positioning abnormal information of the link, the entry time is the starting time of processing the request, and the exit time is the ending time of processing the request. Therefore, the micro-service device reports the tracking message according to the link message and the preset rule, so that the tracking message is automatically reported, the monitoring equipment analyzes abnormal information conveniently, and the timeliness of locating the link problem is improved.
Drawings
Fig. 1A is a schematic diagram of a link monitoring system according to an embodiment of the present invention;
fig. 1B is a schematic diagram of a link monitoring system according to an embodiment of the present invention;
fig. 2 is a flowchart of a link monitoring method according to an embodiment of the present invention;
fig. 3 is a flowchart of a link monitoring method according to another embodiment of the present invention;
fig. 4 is a flowchart of a link monitoring method according to another embodiment of the present invention;
fig. 5 is a flowchart of a link monitoring method according to another embodiment of the present invention;
fig. 6 is a schematic diagram illustrating a micro server device according to an embodiment of the present invention;
fig. 7 is a schematic diagram illustrating a micro server device according to another embodiment of the present invention;
fig. 8 is a schematic composition diagram of a monitoring device according to an embodiment of the present invention;
fig. 9 is a schematic composition diagram of a monitoring device according to another embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the following, the terms "first", "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the embodiments of the present disclosure, "a plurality" means two or more unless otherwise specified.
Additionally, the use of "based on" or "according to" means open and inclusive, as a process, step, calculation, or other action that is "based on" or "according to" one or more stated conditions or values may in practice be based on additional conditions or exceeding the stated values.
In order to solve the problem of low timeliness of the link positioning problem, embodiments of the present invention provide a link monitoring method and apparatus, where a micro-service apparatus receives a link message from a monitoring device, where the link message includes a monitoring mode and rule information corresponding to the monitoring mode, and when it is determined that processing information satisfies a preset rule corresponding to the rule information, determines that an abnormality exists in a link, and sends a trace message to the monitoring device. The processing information is information obtained when the request is processed, and the link is used for representing the process of processing the request. The trace message comprises an entry time and an exit time, the trace message is used for positioning abnormal information of the link, the entry time is the starting time of processing the request, and the exit time is the ending time of processing the request. Therefore, the micro-service device reports the tracking message according to the link message and the preset rule, so that the tracking message is automatically reported, the monitoring equipment analyzes abnormal information conveniently, and the timeliness of locating the link problem is improved.
Fig. 1A is a schematic diagram of a link monitoring system according to an embodiment of the present invention, and the link monitoring method according to the embodiment of the present invention may be applied to the link monitoring system. As shown in fig. 1A, the link monitoring system may include: a plurality of microservice devices 11 and a monitoring apparatus 12. The monitoring device 12 communicates with each micro server 11 through a wired communication method or a wireless communication method. And a plurality of micro-service devices 11 together complete the development of one application program.
In some embodiments, the monitoring device 12 may be a terminal device. The terminal device may be a mobile phone, a tablet computer, a desktop, a laptop, a handheld computer, a notebook computer, etc. Alternatively, the monitoring device 12 may be one server, or may be a server cluster formed by multiple servers, which is not limited in this embodiment of the present invention. Fig. 1A illustrates the monitoring device 12 as a server.
The microserver 11 is configured to receive a link message sent by the monitoring device 12, where the link message includes a monitoring mode and rule information corresponding to the monitoring mode. The micro-service device 11 is further configured to determine that the link is abnormal and send a trace message to the monitoring device 12 when it is determined that the processing information meets a preset rule corresponding to the rule information.
In some embodiments, the microserver 11 may be a server or a server cluster, and the embodiments of the present invention are not limited thereto.
The monitoring device 12 is further configured to receive a trace message sent by the microserver 11, and locate an abnormality of the link based on the trace message.
For example, fig. 1B illustrates an example in which the plurality of micro service devices 11 includes 5 micro service devices. As shown in fig. 1B, the 5 micro service devices may include: a microservice device A, B, C, D, E. Wherein, the micro-service device A is a front end, the micro-service devices B and C are two intermediate layers, and the micro-service devices D and E are two rear ends.
After receiving the user request, the front end divides the request into two sub-requests and respectively sends the two sub-requests to corresponding middle layers. As a possible implementation, the middle layer obtains a processing result after processing the sub-request, and returns the processing result to the front end. As another possible implementation, the middle layer interacts with the back end to obtain a processing result, and the processing result is returned to the front end. The front end generates a response message to the request based on all processing results received. When the response speed of the 5 micro-service devices to process the request is too slow, the link tracing of each micro-service device is needed to locate the problem. According to the link monitoring method provided by the embodiment of the invention, the monitoring equipment can monitor the link of the whole process from the receiving of the request to the sending of the response when each micro-service device processes the request every time.
Based on the introduction of the link monitoring system shown in fig. 1A and fig. 1B, an embodiment of the present invention provides a link monitoring method. As shown in fig. 2, the method may include the following steps 201-206.
201. The monitoring equipment sends a link message to the micro-service device, wherein the link message comprises a monitoring mode and rule information corresponding to the monitoring mode.
When the monitoring device needs to monitor the links of the processing requests of the micro service devices, the monitoring device may send link messages to the micro service devices respectively in response to the link monitoring instructions. For example, the monitoring device may send the link message in the form of a broadcast. The link message may include a monitoring mode and rule information corresponding to the monitoring mode.
It will be appreciated that in some embodiments, one or more monitoring modes and corresponding rule information for each monitoring mode may be preconfigured in the monitoring device. One monitoring mode may correspond to one or more different rule information. The rule information may be used by the microservice device to determine whether an anomaly exists in the link.
Optionally, in some embodiments, the monitoring mode and the corresponding rule information may be pre-configured by a user in a configuration interface of the monitoring device. When there is a need to monitor the link, the monitoring device may carry the configured monitoring mode and the corresponding rule information in the link message for broadcasting.
202. The microserver receives a link message from the monitoring device.
In the embodiment of the present invention, a micro server device is taken as an example for description. The microserver may save the link message to the memory after receiving the link message from the monitoring device.
203. And the micro-service device determines that the link has abnormity under the condition that the processing information is determined to meet the preset rule corresponding to the rule information.
Wherein the link is used to characterize the process by which the microservice device processes the request. The processing information is information obtained when the micro-service device processes the request. It will be appreciated that in one implementation, the processing information may be time duration information spent by the microservice device processing the request. In another implementation, the processing information may be related to the micro service device invoking the preset interface to process the request.
After receiving the link message, the microserver device may obtain the processing information and determine whether the processing information satisfies a preset rule corresponding to the rule information. If so, the micro server device may determine that there is an anomaly in the link and perform the following step 204. If not, the link is normal.
It can be understood that the preset rule corresponding to the rule information may be sent to the micro service device by the monitoring device in advance, or may be configured in the micro service device by the user in advance, and the embodiment of the present invention is not limited specifically herein.
Optionally, in some embodiments, the micro service device may obtain the processing information at the embedded point through an interceptor technology. The buried point is a link for collecting some information in the microserver processing request to track the processing information of the request. For example, the burial points may be made at the entrance and exit of the link. The interceptor technology may be a method of adding annotation to a link to be monitored, and intercept an entry and an exit of the link to be monitored through an Aspect Oriented Programming (AOP) slicing technology.
Therefore, the micro-service device obtains the processing information at the embedded point through the interceptor technology, and the performance loss in the link tracking process can be reduced.
204. The microserver sends a trace message to the monitoring device.
The trace message is used to locate the abnormal information of the link, and may include an entry time and an exit time. The entry time is the starting time of the micro-service device for processing the request, and the exit time is the ending time of the micro-service device for processing the completion request.
Optionally, the trace message may further include link identification information (traceID), where the link identification information is used to uniquely identify the link.
205. And the monitoring equipment receives the tracking message sent by the micro-service device.
After receiving the link message sent by the micro-service device, the monitoring device may store the link message in the form of a log, and output a prompt message, where the prompt message is used to prompt a user to view the trace message, so as to locate the link abnormality.
It is understood that in some embodiments, the output mode of the prompt message includes, but is not limited to, interface display, audible and visual alarm, and the like.
206. And the monitoring equipment determines the abnormal information of the link according to the tracking message.
The exception information may be information for characterizing a timeout problem of the microserver when processing the request.
Specifically, the monitoring device may determine a link in which an abnormality occurs according to a link identifier included in the trace message, and determine the abnormal information of the link according to the start time and the end time included in the trace message, thereby locating the problem.
In the link monitoring method provided in this embodiment, the micro service device receives a link message including a monitoring mode and rule information corresponding to the monitoring mode from the monitoring device, determines that the link is abnormal when it is determined that the processing information satisfies a preset rule corresponding to the rule information, and sends a trace message to the monitoring device. The processing information is information obtained when the request is processed, and the link is used for representing the process of processing the request. The trace message comprises an entry time and an exit time, the trace message is used for positioning abnormal information of the link, the entry time is the starting time of processing the request, and the exit time is the ending time of processing the request. Therefore, the micro-service device reports the tracking message according to the link message and the preset rule, so that the tracking message is automatically reported, the monitoring equipment analyzes abnormal information conveniently, and the timeliness of locating the link problem is improved.
Optionally, in some embodiments, the monitoring mode in step 201 may be a timeout mode, an interface mode, or the like. When the monitoring mode is the timeout mode, the rule information may include a preset duration corresponding to the micro service device. When the monitoring mode is the interface mode, the rule information may include a preset interface and a preset value corresponding to the micro service device.
It can be understood that the preset time lengths corresponding to the different micro service devices may be the same or different. The preset duration can be configured in advance according to the difficulty of the micro-service device in processing the request, and the preset duration can be the maximum allowable duration for the micro-service device to normally process the request, and when the duration for the micro-service device to process the request exceeds the preset duration, the link is abnormal. When the duration of processing the request is less than the preset duration, the micro-service device is shown to have almost negligible influence on the performance of the application program.
As a possible implementation, when the monitoring mode is the timeout mode, based on fig. 2, as shown in fig. 3, the step 203 may specifically include the following steps 301 to 303.
301. The microservice device obtains an entry time and an exit time.
The micro-service device may intercept an entry and an exit of the link by an interceptor technique to obtain an entry time and an exit time, respectively, in which case the processing information includes the entry time and the exit time.
302. The microserver determines a processing duration based on the entry time and the exit time.
After the micro-service device obtains the entry time and the exit time, the total duration from the entry time to the exit time can be determined as the processing duration of the micro-service device for processing the request according to the entry time and the exit time.
303. And the micro-service device determines that the link has abnormity under the condition that the processing time length is determined to be greater than the preset time length.
After the micro-service device determines the processing time length, whether the processing time length is greater than the preset time length or not is judged through the rule information in the memory, the link is determined to be abnormal under the condition that the processing time length is greater than the preset time length, and the link is determined to be normal under the condition that the processing time length is less than the preset time length.
In the link monitoring method provided in this embodiment, when the monitoring mode is the timeout mode, and the rule information includes the preset time duration corresponding to the micro service device, the micro service device determines the processing time duration according to the entry time duration and the exit time duration by acquiring the entry time duration and the exit time duration, and then determines that the link is abnormal when the processing time duration is determined to be greater than the preset time duration. Therefore, the micro-service device realizes the monitoring of the link by comparing the processing time length with the preset time length, and can effectively track the link problem of the micro-service device in time.
As another possible implementation, when the monitoring mode is the interface mode, based on fig. 2, as shown in fig. 4, the step 203 may specifically include the following steps 401 to 402.
401. And the micro-service device calls a preset interface to process the request to obtain a processed return value.
The preset interface is an interface preset in the monitoring equipment, and the returned value can be a value returned when the micro-service device calls the preset interface to process the request.
Specifically, when the micro service device calls the preset interface to process the request, a return value after processing the request can be obtained. When the micro service device does not call the preset interface, the rule information is not valid, namely, the micro service device is not in a monitored state at the moment.
402. And the micro-service device determines that the link has abnormity under the condition that the return value is determined to meet the preset rule.
The preset rule may include a rule relationship between a preset value and a return value, where the preset value and the return value may be a numeric return value, a character return value, or other types of return values, and are not limited herein.
Specifically, after obtaining the return value, the micro service device may send a trace message to the monitoring device when determining that the return value satisfies a preset rule.
In a possible implementation manner, the micro service device may implement the data reporting frequency through a preset interface, where the preset value may be a preset reporting frequency value, and after the micro service device obtains the return value, the micro service device may determine that the link is abnormal under the condition that the return value is determined to be greater than the preset reporting frequency value.
In the link monitoring method provided in this embodiment, when the monitoring mode is the interface mode and the rule information includes the preset interface and the preset value corresponding to the micro service device, the micro service device may obtain the processed return value after calling the preset interface processing request, and determine that the link is abnormal when the return value and the preset value meet the preset condition, thereby implementing monitoring on the link and simultaneously being capable of timely and effectively tracking the link problem of the micro service device.
Optionally, based on fig. 2, as shown in fig. 5, before the step 201 is executed, the link monitoring method may further include steps 501 to 502.
501. And the micro-service device sends registration information to the monitoring equipment after being started, wherein the registration information comprises an equipment identifier, and the equipment identifier is used for identifying the micro-service device.
The device identifier may be a module name, or may be information that can uniquely identify the micro service apparatus.
Specifically, after being started, the micro service device may send registration information to the monitoring device, and simultaneously start monitoring of a control service message corresponding to the micro service device, so as to receive a control command sent by the monitoring device.
502. And the monitoring equipment receives the registration information from the micro-service device and stores the registration information.
Specifically, the monitoring device receives and stores registration information from the micro service device. In this case, the step 201 may specifically include: the monitoring device may send a link message to the registered microservice apparatus based on the stored registration information.
Illustratively, the registration information may be a module name of the micro service device, the monitoring device receives and stores the registration information from the micro service device, and sends a link message with a communication identifier (topic) as the module name, the link message may be in a json format, and the content of the link message may include attributes and values of the monitoring mode and rule information corresponding to the monitoring mode.
In the link monitoring method provided in this embodiment, the micro service device sends registration information to the monitoring device after being started, where the registration information includes a device identifier, and the device identifier is used to identify the micro service device. Further, the monitoring device receives and stores the registration information from the micro service devices, so that all the registered micro service devices can be monitored by the monitoring device.
The above description mainly introduces the scheme provided by the embodiment of the present invention from the perspective of the microserver and the monitoring device. It is understood that the microserver and the monitoring device, in order to implement the above-described functions, comprise corresponding hardware structures and/or software modules for performing the respective functions. Those of skill in the art will readily appreciate that the present invention can be implemented in hardware or a combination of hardware and computer software, in conjunction with the exemplary algorithm steps described in connection with the embodiments disclosed herein. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
Fig. 6 shows a schematic diagram of a possible composition of the micro server apparatus involved in the above embodiments, which may include: a receiving module 61, a determining module 62 and a sending module 63.
A receiving module 61, configured to receive a link message from a monitoring device, where the link message includes a monitoring mode and rule information corresponding to the monitoring mode;
a determining module 62, configured to determine that a link is abnormal when it is determined that processing information satisfies a preset rule corresponding to rule information, where the processing information is information obtained when a request is processed, and the link is used to characterize a process of processing the request;
a sending module 63, configured to send a trace message to the monitoring device, where the trace message includes an entry time and an exit time, and the trace message is used to locate the abnormal information of the link, where the entry time is a start time of processing the request, and the exit time is an end time of completing the processing of the request.
Optionally, on the basis of the foregoing embodiment, the determining module 62 is further configured to: and acquiring processing information at the embedded point by an interceptor technology.
Optionally, on the basis of the foregoing embodiment, when the monitoring mode is an overtime mode and the rule information includes a preset duration corresponding to the microservice device, the determining module 62 is specifically configured to: acquiring an entrance moment and an exit moment; determining a processing time length according to the entrance time and the exit time; and determining that the link has abnormity under the condition that the processing time length is greater than the preset time length.
Optionally, on the basis of the foregoing embodiment, when the monitoring mode is an interface mode and the rule information includes a preset interface and a preset value corresponding to the microserver, the determining module 62 is specifically configured to: calling a preset interface processing request to obtain a processed return value; and determining that the link has abnormity under the condition that the return value is the same as the preset value.
Optionally, on the basis of the foregoing embodiment, as shown in fig. 7, the micro server device may further include: and the registration module 64 is configured to send registration information to the monitoring device after the monitoring device is started, where the registration information includes a device identifier, and the device identifier is used to identify the micro service device.
Fig. 8 shows a schematic diagram of a possible composition of the monitoring device referred to in the above embodiments, which may include: a sending module 81, a first receiving module 82 and a determining module 83.
A sending module 81, configured to send a link message to the micro service device, where the link message includes a monitoring mode and rule information corresponding to the monitoring mode;
a first receiving module 82, configured to receive a trace message sent by a micro service device;
the trace message is sent under the condition that the processing information is determined to meet a preset rule corresponding to the rule information, the processing information is information obtained by the micro service device when the micro service device processes the request, the trace message comprises an entry time and an exit time, the entry time is the starting time of the micro service device processing the request, and the exit time is the finishing time of the micro service device processing the request;
and the determining module 83 is configured to determine the abnormal information of the link according to the trace message.
Optionally, on the basis of the foregoing embodiment, as shown in fig. 9, the monitoring device may further include: a second receiving module 84, configured to receive registration information from the micro service apparatus, where the registration information includes a device identifier, and the device identifier is used to identify the micro service apparatus; the storage module 85 is used for storing the registration information.
Optionally, on the basis of the foregoing embodiment, the sending module 81 is specifically configured to: and transmitting a link message to the registered micro service device based on the stored registration information.
The micro-service device and the monitoring equipment provided by the embodiment of the invention are used for executing the link monitoring method, so that the same effect as the link monitoring method can be achieved.
An embodiment of the present invention further provides a computer storage medium, which stores one or more computer instructions and is used to implement the link monitoring method provided in the foregoing embodiment of the present invention when executed.
The above description is only an embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions within the technical scope of the present invention are intended to be covered by the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (14)

1. A link monitoring method is applied to a micro-service device and is characterized by comprising the following steps:
receiving a link message from a monitoring device, wherein the link message comprises a monitoring mode and rule information corresponding to the monitoring mode;
determining that a link is abnormal under the condition that processing information is determined to meet a preset rule corresponding to the rule information, wherein the processing information is information obtained when a request is processed, and the link is used for representing the process of processing the request;
and sending a tracking message to the monitoring equipment, wherein the tracking message comprises an entrance moment and an exit moment, the tracking message is used for positioning the abnormal information of the link, the entrance moment is the starting moment for processing the request, and the exit moment is the finishing moment for processing the request.
2. The link monitoring method according to claim 1, further comprising:
and acquiring the processing information at the embedded point through an interceptor technology.
3. The link monitoring method according to claim 1 or 2, wherein the monitoring mode is a timeout mode, the rule information includes a preset duration corresponding to the microserver, and the determining that the link has an abnormality when it is determined that the processing information satisfies a preset rule corresponding to the rule information includes:
acquiring the entry time and the exit time;
determining a processing time length according to the entrance time and the exit time;
and determining that the link has abnormity under the condition that the processing time length is greater than the preset time length.
4. The link monitoring method according to claim 1 or 2, wherein the monitoring mode is an interface mode, and when the rule information includes a preset interface and a preset value corresponding to the microserver, and the determining that the link has an abnormality when it is determined that the processing information satisfies a preset rule corresponding to the rule information includes:
calling the preset interface to process the request to obtain a processed return value;
and under the condition that the return value and the preset value meet the preset rule, determining that the link is abnormal.
5. The link monitoring method according to claim 1 or 2, wherein the method further comprises:
and sending registration information to the monitoring equipment after starting, wherein the registration information comprises equipment identification, and the equipment identification is used for identifying the micro-service device.
6. A link monitoring method is applied to monitoring equipment and is characterized by comprising the following steps:
sending a link message to a micro-service device, wherein the link message comprises a monitoring mode and rule information corresponding to the monitoring mode;
receiving a trace message sent by the micro service device;
the trace message is sent when determining that a link is abnormal, wherein the link is used for representing a process of processing a request, the trace message comprises an entry time and an exit time, the entry time is a starting time when the micro service device processes the request, and the exit time is an ending time when the micro service device finishes processing the request;
and determining the abnormal information of the link according to the tracking message.
7. The link monitoring method of claim 6, further comprising:
receiving registration information from the micro-service device, wherein the registration information comprises a device identifier, and the device identifier is used for identifying the micro-service device;
and storing the registration information.
8. The link monitoring method according to claim 7, wherein the sending the link message to the micro service device comprises:
sending the link message to the registered microservice device based on the stored registration information.
9. A microservice apparatus, comprising:
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving a link message from monitoring equipment, and the link message comprises a monitoring mode and rule information corresponding to the monitoring mode;
the determining module is used for determining that the link has abnormity under the condition that the processing information is determined to meet the preset rule corresponding to the rule information received by the receiving module;
a sending module, configured to send a trace message to the monitoring device;
the processing information is information obtained when the micro-service device processes a request, the tracking message comprises an entry time and an exit time, the tracking message is used for positioning abnormal information, the entry time is the starting time of the micro-service device processing the request, and the exit time is the ending time of the micro-service device processing the request.
10. A monitoring device, comprising:
the system comprises a sending module, a receiving module and a sending module, wherein the sending module is used for sending a link message to a micro-service device, and the link message comprises a monitoring mode and rule information corresponding to the monitoring mode;
the receiving module is used for receiving the tracking message sent by the micro-service device;
the trace message is sent when it is determined that processing information meets a preset rule corresponding to the rule information, the processing information is information obtained by the micro-service device when the micro-service device processes a request, the trace message comprises an entry time and an exit time, the entry time is a starting time when the micro-service device processes the request, and the exit time is an ending time when the micro-service device finishes processing the request;
and the determining module is used for determining abnormal information according to the entrance time and the exit time received by the receiving module.
11. A microservice apparatus, comprising a memory and a processor, the memory being coupled to the processor, the memory being configured to store computer program code, the computer program code comprising computer instructions which, when executed by the processor, cause the microservice apparatus to perform the link monitoring method according to any one of claims 1 to 5.
12. A monitoring device, comprising a memory and a processor, the memory coupled to the processor, the memory for storing computer program code, the computer program code comprising computer instructions, which when executed by the processor, the monitoring device performs the link monitoring method of any one of claims 6 to 8.
13. A computer readable storage medium comprising computer instructions that, when run on a microservice device, cause the microservice device to perform the link monitoring method of any of claims 1-5.
14. A computer-readable storage medium comprising computer instructions that, when executed on a monitoring device, cause the monitoring device to perform a link monitoring method according to any one of claims 6-8.
CN202111466559.XA 2021-12-03 2021-12-03 Link monitoring method and device Pending CN114389970A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111466559.XA CN114389970A (en) 2021-12-03 2021-12-03 Link monitoring method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111466559.XA CN114389970A (en) 2021-12-03 2021-12-03 Link monitoring method and device

Publications (1)

Publication Number Publication Date
CN114389970A true CN114389970A (en) 2022-04-22

Family

ID=81195469

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111466559.XA Pending CN114389970A (en) 2021-12-03 2021-12-03 Link monitoring method and device

Country Status (1)

Country Link
CN (1) CN114389970A (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180270107A1 (en) * 2017-03-16 2018-09-20 International Business Machines Corporation Microservices communication pattern for fault detection in end-to-end flows
US20190104184A1 (en) * 2017-09-29 2019-04-04 Siemens Aktiengesellschaft Information processing method, apparatus, and system
CN109672741A (en) * 2018-12-25 2019-04-23 鼎信信息科技有限责任公司 Micro services monitoring method, device, computer equipment and storage medium
CN110737592A (en) * 2019-09-16 2020-01-31 平安科技(深圳)有限公司 link abnormity identification method, server and computer readable storage medium
CN111385123A (en) * 2018-12-29 2020-07-07 广州市百果园信息技术有限公司 WEB service distributed intelligent monitoring method, device, computer equipment and storage medium
CN111813418A (en) * 2020-06-30 2020-10-23 平安国际智慧城市科技股份有限公司 Distributed link tracking method, device, computer equipment and storage medium
CN112446786A (en) * 2020-11-13 2021-03-05 中信银行股份有限公司 Abnormal transaction processing method and device, electronic equipment and readable storage medium
CN112527410A (en) * 2020-12-17 2021-03-19 深圳市欢太科技有限公司 Full link tracking method, device, equipment and storage medium
CN113127343A (en) * 2021-03-30 2021-07-16 广东电网有限责任公司 Power grid code test analysis system based on micro-service architecture
CN113312241A (en) * 2021-06-29 2021-08-27 中国农业银行股份有限公司 Abnormal alarm method, access log generation method and operation and maintenance system

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180270107A1 (en) * 2017-03-16 2018-09-20 International Business Machines Corporation Microservices communication pattern for fault detection in end-to-end flows
US20190104184A1 (en) * 2017-09-29 2019-04-04 Siemens Aktiengesellschaft Information processing method, apparatus, and system
CN109672741A (en) * 2018-12-25 2019-04-23 鼎信信息科技有限责任公司 Micro services monitoring method, device, computer equipment and storage medium
CN111385123A (en) * 2018-12-29 2020-07-07 广州市百果园信息技术有限公司 WEB service distributed intelligent monitoring method, device, computer equipment and storage medium
CN110737592A (en) * 2019-09-16 2020-01-31 平安科技(深圳)有限公司 link abnormity identification method, server and computer readable storage medium
CN111813418A (en) * 2020-06-30 2020-10-23 平安国际智慧城市科技股份有限公司 Distributed link tracking method, device, computer equipment and storage medium
CN112446786A (en) * 2020-11-13 2021-03-05 中信银行股份有限公司 Abnormal transaction processing method and device, electronic equipment and readable storage medium
CN112527410A (en) * 2020-12-17 2021-03-19 深圳市欢太科技有限公司 Full link tracking method, device, equipment and storage medium
CN113127343A (en) * 2021-03-30 2021-07-16 广东电网有限责任公司 Power grid code test analysis system based on micro-service architecture
CN113312241A (en) * 2021-06-29 2021-08-27 中国农业银行股份有限公司 Abnormal alarm method, access log generation method and operation and maintenance system

Similar Documents

Publication Publication Date Title
EP3952423A1 (en) Method and device for determining terminal behavior analysis
CN109698934B (en) Region monitoring method and device
US20170171713A1 (en) Method and apparatus for determining location of target portable device
CN109446309B (en) Question feedback method and device
EP2988472B1 (en) Method for detecting eavesdropping activity and terminal device
CN107908487B (en) Task control management method, device and equipment and computer readable storage medium
CN113468515A (en) User identity authentication method and device, electronic equipment and storage medium
CN111385123A (en) WEB service distributed intelligent monitoring method, device, computer equipment and storage medium
CN111597065A (en) Method and device for collecting equipment information
CN113468025A (en) Data warning method, system, device and storage medium
CN110881224B (en) Network long connection method, device, equipment and storage medium
CN112565062B (en) Processing method, related device, equipment and medium of instant messaging order
CN112948224A (en) Data processing method, device, terminal and storage medium
CN112965799B (en) Task state prompting method and device, electronic equipment and medium
CN113242301A (en) Method and device for selecting real server, computer equipment and storage medium
CN114389970A (en) Link monitoring method and device
CN110896569B (en) Bullet screen automatic reconnection method, storage medium, electronic equipment and system
CN114302351B (en) Short message service processing method and device, computer equipment and storage medium
CN107766232B (en) Plug-in management method and device
CN105228139A (en) A kind of call processing method based on smart machine, device and equipment
CN109246718B (en) Terminal user behavior monitoring method and device
CN107872381B (en) Prompting method and device
CN117311892B (en) Remote assistance method, system, electronic device and storage medium
CN111475322A (en) Method and device for positioning stuck thread, computer equipment and readable storage medium
CN110996374B (en) Wireless network control method, device, equipment and 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20220422