CN113760636A - Method, device and storage medium for detecting fault in micro-service architecture - Google Patents

Method, device and storage medium for detecting fault in micro-service architecture Download PDF

Info

Publication number
CN113760636A
CN113760636A CN202011015584.1A CN202011015584A CN113760636A CN 113760636 A CN113760636 A CN 113760636A CN 202011015584 A CN202011015584 A CN 202011015584A CN 113760636 A CN113760636 A CN 113760636A
Authority
CN
China
Prior art keywords
node
calling
micro
service
nodes
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
CN202011015584.1A
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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202011015584.1A priority Critical patent/CN113760636A/en
Publication of CN113760636A publication Critical patent/CN113760636A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • 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/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural

Landscapes

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

Abstract

The application discloses a method, a device and a storage medium for detecting faults in a micro-service architecture, and particularly relates to a method, a device and a storage medium for acquiring at least one micro-service calling method corresponding to a user request. According to the method and the device for calling the micro service, the method calling links are established among the called micro service calling methods, and the abnormal information is positioned in real time and uploaded on the basis of the method calling links, so that the efficiency and the accuracy of fault detection and positioning in the micro service architecture are improved.

Description

Method, device and storage medium for detecting fault in micro-service architecture
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for detecting a failure in a microservice architecture, and a storage medium.
Background
The microservice architecture is widely applied to the technical field of computers as a software development technology. The call chain between the microservice structures is complex, if one node is abnormal, the manual positioning generally checks the node of the problem system, and checks the abnormal information of the log. The checking mode generally uses middleware, such as a monitoring method that adds a monitoring platform to a code by a custom method, and checks a performance index, an availability ratio and the like corresponding to the method on the monitoring platform. Further, the checking may be performed by a method of generating log exception information. When the calling method is abnormal, the abnormal information can be collected and a file can be generated independently.
However, for monitoring of the middleware, although research and development personnel can find performance and abnormal information of the calling method in time through alarming, the problem cannot be located and solved immediately, especially, research and development are needed to check logs and then analyze and solve the problems, and efficiency is very low. Additionally, if the development forgets to configure ump monitoring information, the development is unable to find an exception problem. In the mode of checking and positioning the abnormal problems through the abnormal logs, the abnormal logs need to be checked one by one under the condition that the micro-service call chain is complex, and the requirement for efficiently and quickly positioning the abnormal problems cannot be met.
Disclosure of Invention
The embodiment of the application provides a method for detecting faults in a micro-service architecture, and the problem of low abnormal information positioning efficiency is solved.
The method comprises the following steps:
acquiring at least one micro-service calling method corresponding to a user request;
when the micro service calling methods are called, a method calling link corresponding to the user request is constructed, wherein the method calling link comprises nodes corresponding to the micro service calling methods, calling method identifications corresponding to the nodes and calling relations among the nodes;
and monitoring each node in the method call link in the process of executing the method call link based on the call relation, collecting the call method identification and abnormal log information corresponding to the abnormal node when the node is the abnormal node, and returning the call method identification and the abnormal log information to the front end.
Optionally, annotation information is embedded in a calling port of the micro-service calling method, and the calling method identifier and the execution time of the node where the micro-service calling method is located are obtained by executing the annotation information.
Optionally, generating a parent node of each node in the method call chain based on a parent micro-service call method in at least one micro-service call method corresponding to the user request;
and when the father node calls other nodes, forming the calling relationship between the father node and the called other nodes, and transmitting the calling method identification layer corresponding to the father node to the called nodes layer by layer until the micro service calling method corresponding to the user request is executed.
Optionally, the father node is used as an initial node, other nodes are sequentially called according to the service logic, and each node calls other nodes according to the service logic;
and when at least two called nodes exist in the same level, sequentially executing the micro-service calling method corresponding to each node from left to right.
Optionally, the number of times of calling the parent node and the execution time are initialized to a first number and a second number, respectively, and the calling method identifier corresponding to the parent micro-service calling method is used as the calling method identifier of the parent node in the method calling link.
Optionally, the execution time of each node in the method call link is obtained;
when each node executes the corresponding micro-service calling method, comparing the execution time corresponding to the node with the total execution time of the parent node generated in advance, wherein the process of generating the total execution time when the method calling link does not contain the abnormal node is as follows:
selecting the execution time corresponding to the node with the longest execution time from at least one node in the same level as the execution time to be judged, and returning the sum of the execution time to be judged and the first number to the father node as the total execution time;
and when the execution time corresponding to the node is greater than the total execution time, determining the node as the abnormal node.
Optionally, the executed method call link is compared with a reference method call link corresponding to the case where the executed method call link does not include the abnormal node, the node different from the reference method call link is marked as the abnormal node, and the call method identifier corresponding to the abnormal node is returned to the parent node.
In another embodiment of the present invention, there is provided an apparatus for detecting a failure in a microservice architecture, the apparatus comprising:
the acquisition module is used for acquiring at least one micro-service calling method corresponding to the user request;
the building module is used for building a method calling link corresponding to the user request when calling between the micro-service calling methods, wherein the method calling link comprises nodes corresponding to the micro-service calling methods, calling method identifiers corresponding to the nodes and calling relations among the nodes;
and the return module is used for monitoring each node in the method calling link in the process of executing the method calling link based on the calling relation, collecting the calling method identification and the abnormal log information corresponding to the abnormal node when the node is the abnormal node, and returning the calling method identification and the abnormal log information to the front end.
In another embodiment of the present invention, a non-transitory computer readable storage medium is provided that stores instructions that, when executed by a processor, cause the processor to perform the steps of a method of detecting faults in a microservice architecture as described above.
In another embodiment of the present invention, a terminal device is provided, which includes a processor for executing the steps of the method for detecting a failure in a microservice architecture.
Based on the embodiment, at least one micro-service calling method corresponding to a user request is obtained firstly, then a method calling link corresponding to the user request is constructed when the micro-service calling methods are called, the method calling link comprises nodes corresponding to the micro-service calling methods, calling method identifications corresponding to the nodes and calling relations among the nodes, finally, each node in the method calling link is monitored in the process of executing the method calling link based on the calling relations, when the node is an abnormal node, the calling method identification corresponding to the abnormal node and abnormal log information are collected, and the calling method identification and the abnormal log information are returned to the front end. According to the method and the device for calling the micro service, the method calling links are established among the called micro service calling methods, and the abnormal information is positioned in real time and uploaded on the basis of the method calling links, so that the efficiency and the accuracy of fault detection and positioning in the micro service architecture are improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a schematic flow chart illustrating a method for detecting a failure in a microservice architecture, provided in an embodiment 100 of the present application;
fig. 2 is a schematic diagram illustrating a specific flow of a method for detecting a failure in a micro service architecture according to an embodiment 200 of the present application;
FIG. 3 is a diagram illustrating a method call link according to embodiment 300 of the present application;
fig. 4 is a schematic diagram illustrating another method invocation link provided in the embodiment 400 of the present application;
fig. 5 is a schematic diagram illustrating an apparatus for detecting a failure in a microservice architecture according to an embodiment 500 of the present application;
fig. 6 shows a schematic diagram of a terminal device provided in embodiment 600 of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, 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 application.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprising" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements explicitly listed, but may include other steps or elements not explicitly listed or inherent to such process, method, article, or apparatus.
Based on the problems in the prior art, the embodiment of the application provides a method for detecting a fault in a micro-service architecture, which is mainly applicable to the technical field of computers. By abstracting the calling relationship among the micro-service calling methods into the calling link relationship among the nodes, abnormal nodes with faults are positioned and reported in the micro-service execution process, so that the method for detecting the faults in the micro-service architecture is realized. Several of the following embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Fig. 1 is a schematic flowchart of a method for detecting a failure in a microservice architecture according to an embodiment 100 of the present application. The detailed steps are as follows:
and step S11, acquiring at least one micro-service calling method corresponding to the user request.
In this step, under the micro service architecture, the user request of the user generally involves a plurality of internal micro service calling methods. Calling and called relations exist among all micro-service calling methods, and the user request is completed through the cooperative execution of all the micro-service calling methods.
Step S12, when calling between the micro service calling methods, constructing a method calling link corresponding to the user request, wherein the method calling link comprises nodes corresponding to the micro service calling methods, calling method identifications corresponding to the nodes and calling relations between the nodes.
In this step, in the embodiment of the present application, each micro-service invocation method is abstracted into nodes, and a method invocation link is formed between each node through a data structure in a binary tree form and based on the invocation relationship of each micro-service invocation method. Each node corresponds to a calling method identifier of the micro-service calling method, the calling method identifier is used as a unique identifier requestId of a user request and is generated before the micro-service calling method is executed, and the user request to which the micro-service calling method belongs can be determined by transmitting the calling method identifier requestId.
And step S13, monitoring each node in the method call link in the process of executing the method call link based on the call relation, collecting the call method identification and the abnormal log information corresponding to the abnormal node when the node is the abnormal node, and returning the call method identification and the abnormal log information to the front end.
In this step, in the execution process of the method call link, after each micro-service call method corresponding to a node is executed, whether the node belongs to an abnormal node is judged. And when the abnormal node occurs, acquiring a calling method identifier and abnormal log information corresponding to the abnormal node, and transmitting the calling method identifier corresponding to the abnormal node to a father node corresponding to a father micro-service calling method in a method calling link. And the parent micro-service calling method calls the first called micro-service calling method in the link for the method corresponding to the user request. Furthermore, the front end extracts the calling method identification and the abnormal log information of the abnormal node from the father node, and judges the fault in the micro-service architecture.
As described above, based on the above embodiment, specifically, at least one micro service calling method corresponding to a user request is obtained first, then, when calling is performed between the micro service calling methods, a method calling link corresponding to the user request is constructed, the method calling link includes a node corresponding to the micro service calling method, a calling method identifier corresponding to each node, and a calling relationship between each node, and finally, based on the calling relationship, each node in the method calling link is monitored in a process of executing the method calling link, and when the node is an abnormal node, the calling method identifier corresponding to the abnormal node and abnormal log information are collected, and the calling method identifier and the abnormal log information are returned to the front end. According to the method and the device for calling the micro service, the method calling links are established among the called micro service calling methods, and the abnormal information is positioned in real time and uploaded on the basis of the method calling links, so that the efficiency and the accuracy of fault detection and positioning in the micro service architecture are improved.
Fig. 2 is a schematic diagram illustrating a specific flow of a method for detecting a failure in a micro service architecture according to an embodiment 200 of the present application. Wherein, the detailed process of the specific flow is as follows:
s201, at least one micro-service calling method corresponding to the user request is obtained.
And S202, adding annotation information for the micro-service calling method needing to be called.
And embedding annotation information in a calling port of the micro-service calling method, and acquiring calling method identification and execution time of a node where the micro-service calling method is located by executing the annotation information. Specifically, annotation information JDmonitor is added to the micro-service calling method to be monitored in a mode of embedding the anchor point. Further, method information corresponding to the annotation information JDmonitor is obtained through a reflection mechanism. The method information of the micro-service calling method comprises calling method identification, execution time and the like. If the purchase annotation information is:
@JDMonitor(alias=”method1”,requestId=””)
public void processMain(){
}
the JDmonitor is an anchor point buried in an annotation information mode, and can collect calling method identifications and calculate execution time based on a reflection mechanism. The calling method identification requestId is a unique identification corresponding to the micro service calling method generated before the micro service calling method is executed. And transmitting the requestId to a called micro-service calling method, and determining that the micro-service calling method calls the affiliated user request by the called micro-service calling method through analyzing the field.
S203, abstracting each micro-service calling method into nodes, and selecting father nodes.
Here, a plurality of microservice calling methods included in a user request are abstracted into nodes based on a data structure in the form of a binary tree. Each node comprises a calling method identifier requestId of the corresponding micro-service calling method, and the execution time is calculated when the execution of the micro-service calling method of the node is completed. Further, a parent node of each node in the method call chain is generated based on a parent micro-service call method in at least one micro-service call method corresponding to the user request. The parent micro-service calling method is the micro-service calling method executed firstly when responding to the user request.
And S204, initializing a parent node.
In this step, the number of times of calling and the execution time of the initialized father node are respectively a first number and a second number, and the calling method identifier corresponding to the father micro-service calling method is used as the calling method identifier of the father node in the method calling link. Specifically, as shown in fig. 3, a schematic diagram of a method invocation link is shown in the embodiment 300 of the present application. In the initialization stage, after the parent node M0 is generated, the M0 node initializes a calling method identifier requestId, and the calling method identifier requestId is to be used as the parent node of the whole method calling link. The number of times of being called is initialized to a first number, which is 1 in the preferred example of the first number in the present embodiment, and the execution time is a second number, which is 0ms in the preferred example of the second number in the present embodiment.
S205, constructing a method call link corresponding to the user request.
Here, a method call link corresponding to the user request is constructed, and the method call link includes nodes corresponding to the micro-service call method, call method identifiers corresponding to the nodes, and call relations among the nodes. Specifically, when the father node calls other nodes, a calling relationship is formed between the father node and the called other nodes, and the calling method identification layer corresponding to the father node is transmitted to the called nodes layer by layer until the execution of the micro-service calling method corresponding to the user request is completed. The father node is used as the first called node, the following nodes are called layer by layer, and the formed method calling link can have a plurality of layers. As shown in fig. 3, the parent node M0 calls the node M10 and the node M11, and the node M10 continues to call the node M20 and the node M21 until the micro service calling method corresponding to the user request is executed and the method calling link corresponding to the user request is constructed.
S206, executing the method call link.
Here, the father node is taken as an initial node, other nodes are called in sequence according to the service logic, and each node calls other nodes according to the service logic; and when at least two called nodes exist in the same hierarchy, executing the micro-service calling method corresponding to each node from left to right in sequence. Taking FIG. 3 as an example, when a parent node calls two or more nodes in parallel, node M10 and node M11 are generated. And initializing other called nodes and acquiring the calling method identifier requestId of the node while initializing the parent node. The two nodes M10 and M11 are in the same layer, and the left node M10 is called first, and then the right node M11 is called. Meanwhile, the requestId of the parent node is transferred to M10 and M11, and the execution time of M10 and M11 is obtained through annotation information monitoring, for example, the execution time of M10 is 100ms, and the execution time of M11 is 110 ms. In addition, if each node, for example, the M10 node, is a loop call, the number of calls is increased in the corresponding node, otherwise, the number is defaulted to 1.
S207, when each node in the method call link is executed, whether the node is an abnormal node is judged.
In this step, the mode of performing the abnormality determination on the node includes two parts, one of which is:
and acquiring the execution time of each node in the method calling link, and comparing the execution time corresponding to the node with the total execution time of the pre-generated father node when each node completes the corresponding micro-service calling method. Wherein, the process of generating the total execution time when the method call link does not contain the abnormal node is as follows: selecting the execution time corresponding to the node with the longest execution time from at least one node in the same level as the execution time to be judged, and returning the sum of the execution time to be judged and the first number to the father node as the total execution time; and when the execution time corresponding to the node is greater than the total execution time, determining the node as an abnormal node. Specifically, the total execution time is the execution time obtained by the parent node when the method call link does not include the abnormal node. After the calling of a level is not completed, the M0 node counts the execution time, as shown in fig. 3, if M10> M11, the execution time of M10 is used, and similarly, M20< M21, the execution time of M21 is used, and finally the execution time of M0 is M10+ M21.
In summary, if a performance problem occurs in a certain node, for example, the execution time of a certain node is 3000ms, the execution time of the parent node M0 is inevitably greater than 3000 ms. Therefore, if a certain node does not satisfy the rule, the node can be determined to be an abnormal node.
Another way to determine an abnormal node is:
and comparing the executed method calling link with a reference method calling link corresponding to the method calling link without the abnormal node, marking the node different from the reference method calling link as the abnormal node, and returning the calling method identification corresponding to the abnormal node to the father node. Specifically, as shown in fig. 4, a schematic diagram of another method invocation link provided in the embodiment 400 of the present application is shown. If the node M10 is abnormal, the nodes M20 and M21 will not exist, and the node M10 records the abnormal information of the node and feeds the abnormal information back to the parent node. The method call link of the same service request is generally fixed, and if a method call link graph for completing normal call without an abnormal node is shown in fig. 3, the method call link graph in fig. 3 may be used as a reference method call link graph, and the method call link graph actually executed in fig. 2 may be compared with the reference method call link graph in fig. 1. If not, it may be determined that an abnormal node exists.
S208, transmitting the calling method identification and the abnormal log information of the abnormal node to the father node.
S209, the front end acquires the calling method identification and the abnormal log information of the abnormal node through the father node of the method calling link.
In addition, when an abnormal node exists, if the execution can be continued according to the normal service logic, the next-level call can be continuously executed, and if the execution cannot be continuously executed, the execution is ended.
The method for detecting the fault in the micro-service architecture is achieved based on the steps. The method comprises the steps of adding annotation JDmonitor to a micro-service calling method to be monitored, obtaining calling method identification and execution time corresponding to the annotation JDmonitor through a reflection mechanism, further constructing a method calling link, initializing a father node, and initializing each node. Executing each node layer by layer based on business logic, judging whether the node has abnormity, if the node has abnormity, capturing through try { } catch () { }, reporting the data of the abnormal node to a father node, and judging whether the execution can be continued according to the business logic; if not, the call continues to be executed. And when the execution of the method call link is finished, synchronizing the maximum execution time of the node to the parent node. The method call relation is added into the remote call protocol to realize the monitoring of the request link of the cross-component. According to the monitoring information, the method is realized by utilizing the principle of a binary tree data structure to call the link and realize the quick search of the corresponding node information, and the efficiency and the accuracy of fault detection and positioning in the micro-service architecture are improved.
Based on the same inventive concept, embodiment 500 of the present application further provides an apparatus for detecting a fault in a microservice architecture, where, as shown in fig. 5, the apparatus includes:
an obtaining module 51, configured to obtain at least one micro-service calling method corresponding to a user request;
the building module 52 is configured to build a method call link corresponding to the user request when calling between the micro-service call methods, where the method call link includes nodes corresponding to the micro-service call methods, call method identifiers corresponding to the nodes, and call relationships between the nodes;
and a returning module 53, configured to monitor each node in the method call link in the process of executing the method call link based on the call relationship, and when the node is an abnormal node, collect a call method identifier and abnormal log information corresponding to the abnormal node, and return the call method identifier and the abnormal log information to the front end.
In this embodiment, the specific functions and interaction manners of the obtaining module 51, the constructing module 52 and the returning module 53 may refer to the record of the embodiment corresponding to fig. 1, and are not described herein again.
As shown in fig. 6, another embodiment 600 of the present application further provides a terminal device, which includes a processor 601, where the processor 601 is configured to execute the steps of the method for detecting a failure in a microservice architecture. As can also be seen from fig. 6, the terminal device provided by the above embodiment further comprises a non-transitory computer readable storage medium 602, the non-transitory computer readable storage medium 602 having stored thereon a computer program, which when executed by the processor 601, performs the steps of the above method for detecting a failure in a microservice architecture. In practice, the terminal device may be one or more computers, as long as the computer-readable medium and the processor are included.
In particular, the storage medium can be a general-purpose storage medium, such as a removable disk, a hard disk, a FLASH, etc., and when executed, the computer program on the storage medium can perform the steps of the above-mentioned method for detecting a failure in a microservice architecture. In practical applications, the computer readable medium may be included in the apparatus/device/system described in the above embodiments, or may exist alone without being assembled into the apparatus/device/system. The computer readable storage medium carries one or more programs which, when executed, perform the steps of a method for detecting faults in a microservice architecture as described above.
According to embodiments disclosed herein, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example and without limitation: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing, without limiting the scope of the present disclosure. In the embodiments disclosed herein, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The flowchart and block diagrams in the figures of the present application illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments disclosed herein. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not explicitly recited in the present application. In particular, the features recited in the various embodiments and/or claims of the present application may be combined and/or coupled in various ways, all of which fall within the scope of the present disclosure, without departing from the spirit and teachings of the present application.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present application, and are used for illustrating the technical solutions of the present application, but not limiting the same, and the scope of the present application is not limited thereto, and although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can still change or easily conceive of the technical solutions described in the foregoing embodiments or equivalent replacement of some technical features thereof within the technical scope disclosed in the present application; such changes, variations and substitutions do not depart from the spirit and scope of the exemplary embodiments of the present application and are intended to be covered by the appended claims. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method of detecting faults in a microservice architecture, comprising:
acquiring at least one micro-service calling method corresponding to a user request;
when the micro service calling methods are called, a method calling link corresponding to the user request is constructed, wherein the method calling link comprises nodes corresponding to the micro service calling methods, calling method identifications corresponding to the nodes and calling relations among the nodes;
and monitoring each node in the method call link in the process of executing the method call link based on the call relation, collecting the call method identification and abnormal log information corresponding to the abnormal node when the node is the abnormal node, and returning the call method identification and the abnormal log information to the front end.
2. The method according to claim 1, wherein between the step of obtaining at least one micro service calling method corresponding to the user request and the step of calling between the micro service calling methods, the method further comprises:
and embedding annotation information in a calling port of the micro-service calling method, and acquiring the calling method identifier and the execution time of the node where the micro-service calling method is located by executing the annotation information.
3. The method of claim 2, wherein the step of constructing the method call link corresponding to the user request comprises:
generating a father node of each node in the method calling chain based on a father micro-service calling method in at least one micro-service calling method corresponding to the user request;
and when the father node calls other nodes, forming the calling relationship between the father node and the called other nodes, and transmitting the calling method identification layer corresponding to the father node to the called nodes layer by layer until the micro service calling method corresponding to the user request is executed.
4. The method of claim 3, wherein the step of forming the calling relationship between the parent node and the other nodes that are called comprises:
sequentially calling other nodes by taking the father node as an initial node according to service logic, and calling other nodes by each node according to the service logic;
and when at least two called nodes exist in the same level, sequentially executing the micro-service calling method corresponding to each node from left to right.
5. The method of claim 4, wherein between the step of generating a parent node for each of the nodes in the chain of method calls and the step of when the parent node calls other of the nodes, the method further comprises:
initializing the called times and the execution time of the father node to be a first quantity and a second quantity respectively, and taking the calling method identification corresponding to the father micro-service calling method as the calling method identification of the father node in the method calling link.
6. The method of claim 5, wherein determining that the node is the abnormal node comprises:
acquiring the execution time of each node in the method call link;
when each node executes the corresponding micro-service calling method, comparing the execution time corresponding to the node with the total execution time of the parent node generated in advance, wherein the process of generating the total execution time when the method calling link does not contain the abnormal node is as follows:
selecting the execution time corresponding to the node with the longest execution time from at least one node in the same level as the execution time to be judged, and returning the sum of the execution time to be judged and the first number to the father node as the total execution time;
and when the execution time corresponding to the node is greater than the total execution time, determining the node as the abnormal node.
7. The method of claim 5, wherein the step of determining that the node is the abnormal node further comprises:
and comparing the executed method calling link with a reference method calling link corresponding to the abnormal node, marking the node different from the reference method calling link as the abnormal node, and returning the calling method identification corresponding to the abnormal node to the father node.
8. An apparatus for detecting a failure in a microservice architecture, comprising:
the acquisition module is used for acquiring at least one micro-service calling method corresponding to the user request;
the building module is used for building a method calling link corresponding to the user request when calling between the micro-service calling methods, wherein the method calling link comprises nodes corresponding to the micro-service calling methods, calling method identifiers corresponding to the nodes and calling relations among the nodes;
and the return module is used for monitoring each node in the method calling link in the process of executing the method calling link based on the calling relation, collecting the calling method identification and the abnormal log information corresponding to the abnormal node when the node is the abnormal node, and returning the calling method identification and the abnormal log information to the front end.
9. A non-transitory computer readable storage medium storing instructions that, when executed by a processor, cause the processor to perform the steps of a method of detecting faults in a microservice architecture as claimed in any one of claims 1 to 7.
10. A terminal device comprising a processor configured to perform the steps of a method of detecting a failure in a microservice architecture according to any of claims 1 to 7.
CN202011015584.1A 2020-09-24 2020-09-24 Method, device and storage medium for detecting fault in micro-service architecture Pending CN113760636A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011015584.1A CN113760636A (en) 2020-09-24 2020-09-24 Method, device and storage medium for detecting fault in micro-service architecture

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011015584.1A CN113760636A (en) 2020-09-24 2020-09-24 Method, device and storage medium for detecting fault in micro-service architecture

Publications (1)

Publication Number Publication Date
CN113760636A true CN113760636A (en) 2021-12-07

Family

ID=78785740

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011015584.1A Pending CN113760636A (en) 2020-09-24 2020-09-24 Method, device and storage medium for detecting fault in micro-service architecture

Country Status (1)

Country Link
CN (1) CN113760636A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115022213A (en) * 2022-06-30 2022-09-06 福州畅昕信息科技有限公司 Method for identifying request abnormity and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106656536A (en) * 2015-11-03 2017-05-10 阿里巴巴集团控股有限公司 Method and device for processing service invocation information
CN109873717A (en) * 2019-01-18 2019-06-11 深圳壹账通智能科技有限公司 Monitoring method, device, computer equipment and storage medium
CN111176941A (en) * 2019-12-25 2020-05-19 贝壳技术有限公司 Data processing method, device and storage medium
CN111459766A (en) * 2019-11-14 2020-07-28 国网浙江省电力有限公司信息通信分公司 Calling chain tracking and analyzing method for micro-service system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106656536A (en) * 2015-11-03 2017-05-10 阿里巴巴集团控股有限公司 Method and device for processing service invocation information
CN109873717A (en) * 2019-01-18 2019-06-11 深圳壹账通智能科技有限公司 Monitoring method, device, computer equipment and storage medium
CN111459766A (en) * 2019-11-14 2020-07-28 国网浙江省电力有限公司信息通信分公司 Calling chain tracking and analyzing method for micro-service system
CN111176941A (en) * 2019-12-25 2020-05-19 贝壳技术有限公司 Data processing method, device and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115022213A (en) * 2022-06-30 2022-09-06 福州畅昕信息科技有限公司 Method for identifying request abnormity and storage medium
CN115022213B (en) * 2022-06-30 2024-04-05 福州畅昕信息科技有限公司 Method for identifying request abnormality and storage medium

Similar Documents

Publication Publication Date Title
CN110245078B (en) Software pressure testing method and device, storage medium and server
KR102146173B1 (en) Service call information processing method and device
CN107807877B (en) Code performance testing method and device
US9703687B2 (en) Monitor usable with continuous deployment
US20130024842A1 (en) Software test automation systems and methods
US9122784B2 (en) Isolation of problems in a virtual environment
CN111881014B (en) System test method, device, storage medium and electronic equipment
CN112395156A (en) Fault warning method and device, storage medium and electronic equipment
CN112148606B (en) Buried point test method, buried point test device, buried point test equipment and computer readable medium
CN111078513A (en) Log processing method, device, equipment, storage medium and log alarm system
CN109739527A (en) A kind of method, apparatus, server and the storage medium of the publication of client gray scale
CN112416708A (en) Asynchronous call link monitoring method and system
CN113760636A (en) Method, device and storage medium for detecting fault in micro-service architecture
CN112162908A (en) Program call link monitoring implementation method and device based on bytecode injection technology
CN112887123A (en) Service alarm method, system and device based on call chain
CN111708712A (en) User behavior test case generation method, flow playback method and electronic equipment
KR100496958B1 (en) System hindrance integration management method
CN114500249B (en) Root cause positioning method and device
US20050149809A1 (en) Real time determination of application problems, using a lightweight diagnostic tracer
CN115587041A (en) Mobile application delivery task processing method and device, electronic equipment and storage medium
CN112199275B (en) Component interface test analysis method and device, server and storage medium
CN114445162A (en) Method for reversely tracing enterprise invoice system configuration
CN112579436B (en) Micro-service software architecture identification and measurement method
CN110620698A (en) Software abnormity diagnosis method, device, equipment and system
CN114003457A (en) Data acquisition method and device, storage medium and electronic equipment

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