Abnormal positioning method, device, system and computer readable storage medium

By generating call results and displaying exception objects, the problem of low efficiency in locating exceptions in multi-system calls in existing technologies is solved, and the root cause of exceptions can be located quickly and accurately.

CN111538616BActive Publication Date: 2026-01-30WEBANK (CHINA)
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010365756.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-04-30
Publication Date
2026-01-30
Estimated Expiration
2040-04-30

AI Technical Summary

Technical Problem

In the daily operation and maintenance services of banks and other financial institutions, existing technologies are insufficient to quickly and accurately locate the root cause of anomalies in the process of multi-system calls, resulting in low search efficiency.

Method used

By generating the call results of the exception response, including the call chain ID and span ID, the call order and hierarchical relationship of the service nodes are determined, a call tree or sequence diagram is generated, and the exception object is directly displayed on the display interface.

Benefits of technology

This technology enables the rapid location of abnormal objects without having to log into each system individually to find the root cause when an abnormal response is detected, thus improving the convenience and efficiency of abnormal location.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111538616B_ABST
    Figure CN111538616B_ABST
Patent Text Reader

Abstract

This invention discloses an anomaly localization method, comprising: if an abnormal response is detected, determining the service request of the abnormal response, and based on the service request, determining the call information corresponding to the abnormal response; based on the call information, generating the call result corresponding to the abnormal response; based on the call result, determining the abnormal object corresponding to the abnormal response, and displaying the abnormal object on a display interface. This invention also discloses an anomaly localization device, system, and computer-readable storage medium. When an abnormal response is detected, this invention does not require logging into multiple systems one by one to find the root cause of the anomaly. Instead, it generates a call result from the call information corresponding to the abnormal response, and then locates the abnormal object from the call result, allowing the abnormal object to be directly displayed on the display interface. This improves the convenience of anomaly localization and achieves rapid anomaly localization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of financial technology (Fintech), and more particularly to anomaly location methods, apparatus, systems and computer-readable storage media. Background Technology

[0002] In recent years, with the continuous development of financial technology (Fintech), especially internet finance, anomaly localization technology has been introduced into the daily services of banks and other financial institutions. In the daily operation and maintenance of these institutions, to meet increasingly complex business needs, multiple systems often need to be invoked to respond to a single request. If an abnormal response occurs during this process, it is necessary to log into each system and check the relevant log information to determine which system is malfunctioning. Clearly, this method of troubleshooting is extremely inefficient.

[0003] In existing technologies, link tracing is generally used to improve the efficiency of anomaly detection. This involves collecting link information of the systems called by the current request, such as the called systems and the call sequence, to determine the system links invoked by the current request, and then searching for the root cause of the anomaly within those links. However, while querying the collected link information narrows the search scope and eliminates the need to search all systems, the results still cannot accurately pinpoint the root cause of the request anomaly. Therefore, the efficiency of anomaly localization in multi-system call scenarios needs further improvement. Summary of the Invention

[0004] The main objective of this invention is to provide an anomaly localization method, apparatus, system, and computer-readable storage medium, with the aim of achieving rapid anomaly localization.

[0005] To achieve the above objectives, the present invention provides an anomaly localization method, which includes the following steps:

[0006] If an abnormal response is detected, the service request of the abnormal response is determined, and based on the service request, the call information corresponding to the abnormal response is determined;

[0007] Based on the call information, generate the call result corresponding to the abnormal response;

[0008] Based on the call result, the exception object corresponding to the exception response is determined, and the exception object is displayed on the display interface.

[0009] Preferably, the call information includes a call chain ID and a span ID, and the step of generating the call result corresponding to the abnormal response based on the call information includes:

[0010] Based on the call chain ID, determine the service node corresponding to the abnormal response;

[0011] Based on the span ID, the calling order of the service nodes and the hierarchical relationship of the service nodes are determined;

[0012] Based on the service node, the call order, and the hierarchical relationship, the call result corresponding to the abnormal response is generated.

[0013] Preferably, the call information includes a response ID, and the step of determining the call order of the service nodes and the hierarchical relationship of the service nodes based on the span ID includes:

[0014] Based on the span ID, the calling order of the service nodes is determined.

[0015] Based on the response ID, determine the responder of the service node;

[0016] The hierarchical relationship of the service nodes is determined based on the call order and the responder.

[0017] Preferably, the step of generating the call result corresponding to the abnormal response based on the service node, the call order, and the hierarchical relationship includes:

[0018] Based on the hierarchical relationship, the call depth of the service node is determined;

[0019] Based on the call depth, the service node, and the call order, the call result corresponding to the abnormal response is generated.

[0020] Preferably, the step of generating the call result corresponding to the abnormal response based on the service node, the call order, and the hierarchical relationship includes:

[0021] Based on the call order, the root service node among the service nodes is determined;

[0022] Based on the hierarchical relationship and the root service node, a call tree is generated from the service nodes, and the call tree is determined as the call result corresponding to the abnormal response.

[0023] Preferably, before the step of determining the business information of the abnormal response if an abnormal response is detected, and determining the call information corresponding to the abnormal response based on the business information, the anomaly localization method further includes:

[0024] If the service request is detected, the call chain ID of the service request and the first span ID of the service request are generated based on the preset proxy component;

[0025] Based on the preset proxy component, the service node invoked by the service request is determined, and based on the service node, a second span ID of the service request is generated, wherein the span ID includes the first span ID and the second span ID;

[0026] The span ID and the call chain ID are associated and saved.

[0027] Preferably, the step of determining the exception object corresponding to the exception response based on the call result and displaying the exception object on the display interface includes:

[0028] Identify the abnormal nodes in the call results, and determine the abnormal objects of the abnormal nodes based on the log information of the abnormal nodes;

[0029] Determine the location of the abnormal node in the call result;

[0030] Based on the location of the anomaly, the anomaly object is displayed on the display interface.

[0031] Furthermore, to achieve the above objectives, the present invention also provides an anomaly location device, the anomaly location device comprising:

[0032] The first determining module is used to determine the service request of the abnormal response if an abnormal response is detected, and to determine the call information corresponding to the abnormal response based on the service request.

[0033] The generation module is used to generate the call result corresponding to the abnormal response based on the call information;

[0034] The second determining module is used to determine the exception object corresponding to the exception response based on the call result, and display the exception object on the display interface.

[0035] Preferably, the call information includes a call chain ID and a span ID, and the generation module is further used for:

[0036] Based on the call chain ID, determine the service node corresponding to the abnormal response;

[0037] Based on the span ID, the calling order of the service nodes and the hierarchical relationship of the service nodes are determined;

[0038] Based on the service node, the call order, and the hierarchical relationship, the call result corresponding to the abnormal response is generated.

[0039] Preferably, the invocation information includes a response ID, and the generation module is further configured to:

[0040] Based on the span ID, the calling order of the service nodes is determined.

[0041] Based on the response ID, determine the responder of the service node;

[0042] The hierarchical relationship of the service nodes is determined based on the call order and the responder.

[0043] Preferably, the generation module is further configured to:

[0044] Based on the hierarchical relationship, the call depth of the service node is determined;

[0045] Based on the call depth, the service node, and the call order, the call result corresponding to the abnormal response is generated.

[0046] Preferably, the generation module is further configured to:

[0047] Based on the call order, the root service node among the service nodes is determined;

[0048] Based on the hierarchical relationship and the root service node, a call tree is generated from the service nodes, and the call tree is determined as the call result corresponding to the abnormal response.

[0049] Preferably, the anomaly location device further includes a tracking module, the tracking module being used for:

[0050] If the service request is detected, the call chain ID of the service request and the first span ID of the service request are generated based on the preset proxy component;

[0051] Based on the preset proxy component, the service node invoked by the service request is determined, and based on the service node, a second span ID of the service request is generated, wherein the span ID includes the first span ID and the second span ID;

[0052] The span ID and the call chain ID are associated and saved.

[0053] Preferably, the second determining module is further configured to:

[0054] Identify the abnormal nodes in the call results, and determine the abnormal objects of the abnormal nodes based on the log information of the abnormal nodes;

[0055] Determine the location of the abnormal node in the call result;

[0056] Based on the location of the anomaly, the anomaly object is displayed on the display interface.

[0057] In addition, to achieve the above objectives, the present invention also provides an anomaly localization system, the anomaly localization system comprising: a memory, a processor, and an anomaly localization program stored in the memory and executable on the processor, wherein the anomaly localization program, when executed by the processor, implements the steps of the anomaly localization method as described above.

[0058] In addition, to achieve the above objectives, the present invention also provides a computer-readable storage medium storing an anomaly location program, which, when executed by a processor, implements the steps of the anomaly location method as described above.

[0059] The anomaly localization method proposed in this invention, upon detecting an abnormal response, determines the service request of the abnormal response and, based on the service request, determines the call information corresponding to the abnormal response; based on the call information, generates the call result corresponding to the abnormal response; based on the call result, determines the abnormal object corresponding to the abnormal response and displays the abnormal object on the display interface. This invention, upon detecting an abnormal response, does not require logging into multiple systems one by one to find the root cause of the anomaly. Instead, it generates a call result from the call information corresponding to the abnormal response and then locates the abnormal object from the call result, allowing the abnormal object to be directly displayed on the display interface. Compared to existing technologies that can only determine that the anomaly is on a certain link without generating intuitive call results and directly locating the anomaly, this invention improves the convenience of anomaly localization while achieving rapid anomaly localization. Attached Figure Description

[0060] Figure 1 This is a schematic diagram of the system structure of the hardware operating environment involved in the embodiments of the present invention;

[0061] Figure 2 This is a flowchart illustrating the first embodiment of the anomaly localization method of the present invention.

[0062] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0063] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0064] like Figure 1 As shown, Figure 1 This is a schematic diagram of the system structure of the hardware operating environment involved in the embodiments of the present invention.

[0065] The system of this invention includes a mobile terminal or a server device.

[0066] like Figure 1As shown, the system may include: a processor 1001, such as a CPU; a network interface 1004; a user interface 1003; a memory 1005; and a communication bus 1002. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0067] Those skilled in the art will understand that Figure 1 The system structure shown does not constitute a limitation on the anomaly location system and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0068] like Figure 1 As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and an anomaly location program.

[0069] The operating system is a program that manages and controls the anomaly location system and software resources, and supports the operation of the network communication module, user interface module, anomaly location program and other programs or software; the network communication module is used to manage and control the network interface 1002; the user interface module is used to manage and control the user interface 1003.

[0070] exist Figure 1 In the anomaly localization system shown, the anomaly localization system calls the anomaly localization program stored in the memory 1005 through the processor 1001 and executes the operations in the various embodiments of the anomaly localization method described below.

[0071] Based on the above hardware structure, an embodiment of the anomaly localization method of the present invention is proposed.

[0072] Reference Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the anomaly localization method of the present invention. The method includes:

[0073] Step S10: If an abnormal response is detected, determine the service request of the abnormal response, and determine the call information corresponding to the abnormal response based on the service request;

[0074] Step S20: Based on the call information, generate the call result corresponding to the abnormal response;

[0075] Step S30: Based on the call result, determine the exception object corresponding to the exception response and display the exception object on the display interface.

[0076] This embodiment of the anomaly localization method is applied to the anomaly localization system of financial institutions such as wealth management institutions or banking systems. For ease of description, the anomaly localization system is abbreviated as localization system. The localization system in this embodiment includes a front-end service, a proxy component, and a back-end service. Users can initiate service requests through a front-end service window, such as a webpage. When the proxy component receives a service request, it sends it to the corresponding back-end service. The proxy component can be a forward proxy or a reverse proxy. This embodiment preferably uses an Nginx proxy component. To adapt to distributed call scenarios, a reverse proxy is used to send and receive messages on behalf of the back-end service. Then, the call process of the service request in the back-end service is traced. When the localization system detects an abnormal response, it can obtain call information based on the previously traced call process, thereby generating a call result, and then locate the anomaly based on the call result.

[0077] This embodiment is applicable to application scenarios where multiple systems coordinate to respond to the same request, as well as scenarios where multiple systems coordinate to respond to multiple requests. Examples include microservice architectures where the overall business is broken down into multiple service nodes with specific functions. Microservice architectures respond to service requests through the cooperation of distributed service nodes. In a microservice architecture, most service nodes are deployed and run independently, interacting with each other via a bus. These are stateless services. In this microservice architecture environment, front-end and back-end service requests pass through multiple microservices, i.e., multiple service nodes, for processing and transmission. However, during the processing of service requests, users can only know the final result of the service request, but not the processing order or the results of each service node. If an error or exception occurs in the service request, it is necessary to log in to the servers of each service node to check the log files to find and locate the problem, which is too time-consuming and inefficient.

[0078] In this embodiment, when an abnormal response is detected, the call result corresponding to the abnormal response is generated through the call information of the abnormal response. By analyzing the call result, the abnormal object corresponding to the abnormal response is determined. It is not necessary to log in to the server of each service node to view log files and other information one by one. Finally, the abnormal object is displayed on the display interface, so that users can quickly and intuitively locate the abnormality.

[0079] The following will provide a detailed explanation of each step:

[0080] Step S10: If an abnormal response is detected, determine the service request of the abnormal response, and determine the call information corresponding to the abnormal response based on the service request.

[0081] In this embodiment, if an abnormal response is detected, the service request causing the abnormal response is first determined, i.e., which service request caused the current abnormal response. Then, the call information corresponding to the abnormal response is determined through the service request. Specifically, after determining the service request, the call information corresponding to the abnormal response is determined based on the service request's business ID or service name, etc. The call information refers to the service node information called to respond to the service request. That is, when an abnormal response is detected, the service node information called when processing the service request is determined. For example, if the service request is an order placement request, and an abnormality occurs during the user's order placement process, the location system needs to first determine the service node information during the order placement process. This includes which service nodes responded to the service request, such as the order placement service node and the payment service node, as well as the call time of each service node.

[0082] Step S20: Based on the call information, generate the call result corresponding to the abnormal response.

[0083] In this embodiment, after determining the call information, that is, the service node information, the call result corresponding to the abnormal response is generated based on the service node information. The service node information includes the call time, call name, call type, and log information of each service node. Specifically, the service nodes corresponding to each call name are linked together in the order of the call time, and the call type and log information are attached to each service node to generate the call result.

[0084] Further, in one embodiment, step S20 includes:

[0085] Step a1: Based on the call chain ID, determine the service node corresponding to the abnormal response;

[0086] In one embodiment, the call information includes a call chain ID (trace ID) and a span ID (span ID). Here, a trace represents a directed acyclic graph (DAG) composed of multiple spans, and a span can be a method call, a program block call, or an RPC / database access. As long as it is a program access with a complete time cycle, it can be considered a span. Therefore, a trace can be considered a call chain, that is, the chain through which service requests are passed and transferred.

[0087] After determining the call information, the location system determines the call chain corresponding to the abnormal response based on the trace ID, and then determines the service node corresponding to the abnormal response based on the call chain. That is, it first determines which call chain the abnormal response occurred on, and then determines which service nodes make up the current call chain.

[0088] Step a2: Based on the span ID, determine the calling order of the service nodes and the hierarchical relationship of the service nodes;

[0089] Next, based on the span ID, the calling order of the service nodes and the hierarchical relationship of the service nodes are determined. The calling order of the service nodes can be directly determined by the span ID, that is, the service nodes with different calling orders have different span IDs. For example, the span ID of the front-end service node is span1, the span ID of the back-end service node is span2, etc., and the calling order can be determined as front-end service node → back-end service node, etc.

[0090] It should be noted that the span ID includes the parentspan ID, which is the parent span ID. Therefore, the hierarchical relationship between service nodes, i.e., the parent-child relationship, can be determined based on the parentspan ID. For example, if there is a parent-child relationship between a front-end service node and a back-end service node, then the span ID of the front-end service node is span1, the span ID of the back-end service node is span2, and the parentspan ID is span1, etc.

[0091] In addition, each spanID can be configured to include the span IDs of all parent and predecessor nodes. In specific implementation, a period symbol can be used as a separator. As shown in the example above, the span ID of the backend service node is span2.1, which means that the span ID of the backend service node is span2 and the parentspan ID is span1. In this case, the ParentSpan ID field is no longer needed.

[0092] Step a3: Based on the service node, the call order, and the hierarchical relationship, generate the call result corresponding to the abnormal response.

[0093] In one embodiment, the positioning system generates a call result corresponding to the abnormal response based on the determined service nodes, the call order of the service nodes, and the hierarchical relationship of the service nodes. Specifically, the system connects the various service nodes in series according to the call order and hierarchical relationship of the service nodes to form the call result.

[0094] Specifically, step a3 includes:

[0095] Step a31: Based on the calling order, determine the root service node among the service nodes;

[0096] In this step, the positioning system first determines the root service node, which is the starting service node of the call chain, based on the calling order of each service node.

[0097] Step a32: Based on the hierarchical relationship and the root service node, generate a call tree for the service node, and determine the call tree as the call result corresponding to the abnormal response.

[0098] Then, starting from the root service node, each service node is connected to the root service node in a hierarchical manner to generate a call tree. The call tree is used as the call result corresponding to the exception response. That is, the call tree is generated in a tree-like form with the root service node as the location and other service nodes as branches.

[0099] It should be noted that, in addition to a call tree, the call result can also be a sequence diagram. That is, based on the call information, a call sequence diagram corresponding to the exception response is generated, and the call sequence diagram is determined as the call result. Specifically, according to the call order and hierarchical relationship, each service node is arranged into a call sequence diagram, etc.

[0100] Step S30: Based on the call result, determine the exception object corresponding to the exception response and display the exception object on the display interface.

[0101] In this embodiment, after obtaining the call result, the abnormal object is determined from the call result, and then the abnormal object is displayed on the display interface.

[0102] Specifically, step S30 includes:

[0103] Step b1: Identify the abnormal nodes in the call results, and determine the abnormal objects of the abnormal nodes based on the log information of the abnormal nodes;

[0104] In this embodiment, the positioning system identifies abnormal nodes in the call results by recognizing abnormal identifiers, and then reads the log information of the abnormal nodes to determine the abnormal objects of the abnormal nodes. That is, after identifying which node is abnormal, the system reads the log information of that node in a targeted manner to determine what the specific abnormal object is, without having to search through the servers of each service node, thus achieving rapid abnormal location.

[0105] Among them, the exception identifier can be represented by the call timeout. If the call time of a service node in a certain call result exceeds the preset time, the current service node is determined to be abnormal, and the current service node is marked as abnormal. That is, the current service node carries an exception identifier. Therefore, the abnormal node in the call result can be identified by recognizing the exception identifier in the call result.

[0106] In practical implementation, the preset time corresponding to each service node can be determined first. The preset time is the average time range of the historical normal calls of each service node. The preset time corresponding to each service node can be the same or different. Then, it is determined whether the call time of each service node in response to the current service request exceeds its corresponding preset time. If so, the current service node is determined to be abnormal; if not, the current service node is determined to be normal.

[0107] Step b2: Determine the abnormal node at the abnormal location in the call result;

[0108] In this embodiment, the abnormal node is then located at the abnormal position in the call result, that is, at which node the abnormality occurs. In specific implementation, the starting service node can be used as the starting point, and the relative position of the current abnormal node relative to the starting service node is the abnormal position.

[0109] Step b3: Based on the abnormal location, display the abnormal object on the display interface.

[0110] In this embodiment, the abnormal object is displayed on the display interface according to the abnormal location for the user to view intuitively. In specific implementation, the abnormal object can be displayed in a bright color at the abnormal location of the call result, and the abnormal object can be displayed. That is, the display interface displays both the call result containing the abnormal location and the specific abnormal object, which makes it easier for the user to intuitively locate the abnormality.

[0111] In this embodiment, if an abnormal response is detected, the service request of the abnormal response is determined, and based on the service request, the call information corresponding to the abnormal response is determined; based on the call information, the call result corresponding to the abnormal response is generated; based on the call result, the abnormal object corresponding to the abnormal response is determined, and the abnormal object is displayed on the display interface. When an abnormal response is detected, this invention does not require logging into multiple systems one by one to find the root cause of the abnormality. Instead, it generates a call result from the call information corresponding to the abnormal response, and then locates the abnormal object from the call result, allowing the abnormal object to be directly displayed on the display interface. This improves the convenience of abnormality location while achieving rapid abnormality localization.

[0112] Furthermore, based on the first embodiment of the anomaly localization method of the present invention, a second embodiment of the anomaly localization method of the present invention is proposed.

[0113] The second embodiment of the anomaly localization method differs from the first embodiment in that, based on the span ID, the steps for determining the call order of the service nodes and the hierarchical relationship of the service nodes include:

[0114] Step a21: Based on the span ID, determine the calling order of the service nodes.

[0115] Step a22: Based on the response ID, determine the responder of the service node;

[0116] Step a23: Determine the hierarchical relationship of the service nodes based on the call order and the responder.

[0117] This embodiment considers asynchronous call scenarios where, when a requester sends a service request, multiple downstream service nodes may receive the same service request. In this case, there is a 1:N relationship between the requester and the responders. If only the span ID is used to distinguish a call, multiple responders receiving the call will be marked as the same call. However, in reality, there are multiple responses, and the response time may be different each time. It is evident that using only the span ID to record each call will result in an unclear call hierarchy. Therefore, this embodiment introduces a response ID, using the span ID + response ID to uniquely identify a complete call process. This allows multiple consumptions of service requests by the responder to be constructed with an independent identifier, ultimately reflecting the multiple consumption processes and restoring the true call situation.

[0118] The following will provide a detailed explanation of each step:

[0119] Step a21: Determine the calling order of the service nodes based on the span ID.

[0120] In this embodiment, the call information includes a call chain ID (trace ID), a span ID (span ID), and a response ID (response ID). After the location system determines all service nodes corresponding to the abnormal response based on the trace ID, it determines the call order of each service node based on the span ID, that is, the transmission order of the service request. The specific process is similar to that in the above embodiment and will not be repeated here.

[0121] Step a22: Based on the response ID, determine the responder of the service node.

[0122] In this embodiment, the positioning system further determines the responder of the service node, i.e., the consumer of the service request, based on the response ID. In asynchronous call scenarios, a service request may be consumed by multiple responders of the same service node, or the same responder may be consumed multiple times. For example, if a user initiates a withdrawal request, the corresponding withdrawal service node must not only send the withdrawal information to the user terminal to inform the user of the withdrawal status, but also report the withdrawal amount to the internal audit service node for review. That is, in the current situation, the same withdrawal request is consumed twice by the withdrawal service node. If only the span ID is used, it can only indicate that the withdrawal service node participated in the call, but it cannot know that the withdrawal service node consumed it twice. Therefore, this embodiment adds a response ID. Multiple consumptions by the same service node are distinguished by the response ID. As mentioned in the example above, the withdrawal service node can be represented by span ID + response ID1, span ID + response ID2, that is, the span ID is the same, but the response ID is different, which is used to distinguish multiple consumptions.

[0123] Step a23: Determine the hierarchical relationship of the service nodes based on the call order and the responder.

[0124] In this embodiment, the positioning system determines the hierarchical relationship of service nodes based on the call order and the responder. That is, in order to obtain a clear and reliable hierarchical relationship of each service node, this embodiment adds a response ID to distinguish the case of asynchronous multiple consumption, making the hierarchical relationship of each service node clearer and more transparent.

[0125] This embodiment identifies a complete call process by adding a response ID, combining the span ID and the response ID. This makes it applicable even in special scenarios where the responder consumes multiple times, restoring the real call process and obtaining a clear hierarchical relationship between each service node. This makes the subsequently generated call results more accurate. At the same time, it can more accurately locate the abnormal object in the subsequent anomaly detection process. That is, the abnormal object can be specific to the responder. For example, if the withdrawal service node is abnormal, it can be further determined whether the abnormality is in the withdrawal service node sending the withdrawal information to the user terminal, or in the withdrawal service node reporting the withdrawal request amount to the internal audit service node.

[0126] Furthermore, based on the first and second embodiments of the anomaly localization method of the present invention, a third embodiment of the anomaly localization method of the present invention is proposed.

[0127] The third embodiment of the anomaly localization method differs from the first and second embodiments in that the step of generating the call result corresponding to the anomaly response based on the service node, the call order, and the hierarchical relationship includes:

[0128] Step a33: Based on the hierarchical relationship, determine the call depth of the service node;

[0129] Step a34: Based on the call depth, the service node, and the call order, generate the call result corresponding to the abnormal response.

[0130] In order to improve the speed of generating call results, this embodiment first determines the call depth of each service node during the process of generating call results, and then generates call results by arranging the service nodes in the order of call based on the call depth.

[0131] The following will provide a detailed explanation of each step:

[0132] Step a33: Determine the call depth of the service node based on the hierarchical relationship.

[0133] In this embodiment, the positioning system first determines the call depth of each service node according to the hierarchical relationship, that is, it determines how many service nodes are after the current service node. For example, there are 2 layers after service node A, specifically service nodes B and C. After service node B, there is service node D. That is, the first layer after service node A is service nodes B and C, and the second layer is service node D. At this time, the call depth of service node A is 3 layers, and so on.

[0134] Step a34: Based on the call depth, the service node, and the call order, generate the call result corresponding to the abnormal response.

[0135] In this embodiment, the positioning system generates the call result corresponding to the abnormal response based on the call depth, service node, and the call order of the service node.

[0136] Specifically, based on the call depth, each service node is sorted. In practice, they are sorted from smallest to largest by call depth. Then, the service node with the smallest call depth is used as the basis for the call result. Next, service nodes with a larger call depth are added to the service node with the smallest call depth, and so on. Finally, the call node with the largest call depth is placed at the top. After that, the positions of the service nodes at each level are adjusted according to the call order to finally generate the call result.

[0137] In the example above, if the call depth of service node A is 3, the call depth of service node B is 2, the call depth of service node C is 2, and the call depth of service node D is 1, then in the process of generating the call result, service node D is used as the base first. Then, service nodes B and C are built on top of service node D. Finally, service node A is placed on top. That is, the call results of service nodes with lower call depths are cached first. Then, when generating the call results of service nodes with higher call depths, the call results of the already built service nodes with lower call depths are directly used, thereby speeding up the generation of the final call result.

[0138] In this embodiment, during the generation of call results, call depth is used as one of the parameters. The call results of service nodes with low call depth are generated first. When generating call results of service nodes with high call depth, the call results of service nodes with low call depth that have already been built are directly used, thereby speeding up the generation of the final call results.

[0139] Furthermore, based on the first, second, and third embodiments of the anomaly localization method of the present invention, a fourth embodiment of the anomaly localization method of the present invention is proposed.

[0140] The fourth embodiment of the anomaly localization method differs from the first, second, and third embodiments in that the anomaly localization method further includes:

[0141] Step c: If the service request is detected, then based on the preset proxy component, generate the call chain ID of the service request and the first span ID of the service request;

[0142] Step d: Based on the preset proxy component, determine the service node invoked by the service request, and based on the service node, generate a second span ID for the service request, wherein the span ID includes the first span ID and the second span ID;

[0143] Step e: Associate and save the span ID and the call chain ID.

[0144] In this embodiment, when a service request is detected, a call chain ID and a span ID are generated to track the flow and transmission of the service request, and these are saved to facilitate the location of the anomaly when an abnormal response occurs later.

[0145] The following will provide a detailed explanation of each step:

[0146] Step c: If the service request is detected, then based on the preset proxy component, generate the call chain ID of the service request and the first span ID of the service request.

[0147] The positioning system in this embodiment includes a proxy component, specifically an Nginx proxy component, which is used to generate a globally unique trace ID for each service request actually triggered by the proxy entity service Tomcat (deployment container, i.e., service node) according to the specifications of a preset standard, such as OpenTracing, and at the same time generate the span ID of the first call, i.e., the first span ID (first span ID).

[0148] In the specific implementation process, firstly, the proxy component will output the detailed information of the call, such as the called interface name, call time, return code, whether there is an exception, and the generated trace ID and first span ID, to the original log of the proxy component, such as the access.log of the Nginx proxy component. Among them, the exception information for detecting abnormal responses, that is, determining whether there is an exception, can be obtained in two ways: 1) By intercepting service requests through the location system's filter, capturing exceptions thrown by Druid (database connection pool) and MyBatis (persistence layer framework), and parsing the error return code and error exception information and reporting them. The filter has built-in preset interception rules and preset filtering rules. In specific implementation, the exception log information can be used as the filtering standard to intercept and filter exceptions, and the error return code and error exception information can be parsed according to the parsing method corresponding to the filtering rules; 2) Within the common framework of the business, if the common framework itself identifies business failure and logic failure, it can obtain the trace ID and span based on the spanContext of Opentracing (the state passed to the lower-level span across process boundaries). ID, actively reporting abnormal information, that is, the location system receives abnormal information actively reported by the business framework. For example, when the SpanContext is in an abnormal state, the location system receives the trace ID and Span ID reported by the current service node.

[0149] Secondly, the proxy component uses the generated trace ID as part of the service request header of the service node, and then passes it to the service request header of the HttpRequest of the RESTful interface of the service node. In other words, the trace ID is encapsulated in the header of the service request.

[0150] Step d: Based on the preset proxy component, determine the service node invoked by the service request, and based on the service node, generate a second span ID for the service request, wherein the span ID includes the first span ID and the second span ID.

[0151] In this embodiment, based on a preset proxy component, the service node invoked by the service request is first determined. Specifically, this can be determined according to the service type of the service request; different service types correspond to different service nodes, which can be determined by establishing a service type-service node mapping table beforehand. After receiving the request proxied by the proxy component, the service node first parses the HttpRequest header information to confirm whether it conforms to preset standards, such as the traceID and span ID of the OpenTracing specification. If so, the HttpRequest header information is used to construct the first parent span, and the span of the RESTful interface is constructed as the child of the parent span. That is, the current service node's span is the child span, which is also the second span ID. Therefore, in the subsequent anomaly location process, the span ID includes both the first and second span IDs.

[0152] Step e: Associate and save the span ID and the call chain ID.

[0153] Finally, the span ID and trace ID are reported to the corresponding database and saved according to the preset reporting method, such as the HBase database on the MSS server.

[0154] Furthermore, it should be noted that during the process of tracing the flow of service requests, the log collection component of the MSS (Message Server) system in the location system is used to collect logs generated by the proxy component. It's important to note that the log collection component must first be deployed on the server corresponding to the proxy component. During log collection, if logs conforming to the aforementioned preset standards, such as OpenTracing, are encountered, they are collected and reported to the HBase database on the MSS server. That is, during log collection, it is also necessary to determine whether the currently collected log is an OpenTracing standard log. If it is, it is reported to the HBase database on the MSS server; otherwise, it can be collected into a preset general database. In other words, different logs are stored separately, facilitating subsequent anomaly localization based on different log types.

[0155] Finally, relying on the MSS server-side MSS-LOGVIEW (web page), the parent span generated by the proxy component and the child span of the service node are retrieved from the HBase database. The parent span and child span of the service node are then retrieved and displayed using a unified trace ID. This constructs the entire process of an actual service request call passing through the proxy component and finally calling the service node. This facilitates the rapid acquisition of relevant call information when abnormal responses occur, thereby generating call results and locating the abnormality based on the call results, achieving rapid abnormality location.

[0156] It should be noted that since multiple responders may consume the same request within a service node, when tracing and determining the service node called by the service request, it is also necessary to trace and determine the responders consuming the current service request within the current service node in turn. That is, when generating the span ID of the service node, it is also necessary to further track the consumption trend of the service request within the current service node.

[0157] If a responder is detected consuming the current service request on the current service node, a response ID corresponding to the current responder is generated.

[0158] In one embodiment, the response ID generation process includes: determining the business function of the responder, such as withdrawal notification and withdrawal audit in the same service node; and then generating a unique response ID based on the business function of the responder. This is because different business functions of the same service node are executed by different responders. If the business function is the same, theoretically, it would be assigned to the same responder during the design phase. Therefore, a unique response ID of the responder can be generated through the business function of the responder to distinguish different responders of the same service node.

[0159] In another embodiment, the response ID generation process includes: determining the location information of the responder, specifically the link information where the responder is located, such as the trace ID, and the node information of the service node, such as the span ID; then, based on preset rules, such as random numbers or ordered sequences with specific increments, and the location information, that is, according to the preset rules, the trace ID, and the span ID, a unique response ID is generated. The preset rules are used to distinguish different responders on the same service node, and the location information is used to distinguish responders on different service nodes with the same business function.

[0160] If the current service node has two responders, A and B, to reflect the multiple consumption of service requests by the same service node, the response ID1 of responder A is obtained based on the link information of the link where responder A is located, such as the trace ID, the node information of the current service node, such as the span ID, and a preset rule (such as a random number M). Then, the response ID2 of responder B is obtained based on the link information of the link where responder B is located, such as the trace ID, the node information of the current service node, such as the span ID, and a preset rule (adding a preset threshold m to the previous value M). At this time, the response IDs of different responders of the same service node are different, and they will not be the same as the responders of the same business function on other different service nodes.

[0161] Before implementing anomaly localization, this embodiment generates a call chain ID and a span ID to track and save the flow of the service request when it is detected. In other words, the call process of the service request is stored in advance so that when an abnormal response occurs later, the relevant call information can be obtained, thereby generating the call result. Then, the anomaly can be located based on the call result, thus achieving rapid anomaly localization.

[0162] The present invention also provides an anomaly location device. The anomaly location device of the present invention includes:

[0163] The first determining module is used to determine the service request of the abnormal response if an abnormal response is detected, and to determine the call information corresponding to the abnormal response based on the service request.

[0164] The generation module is used to generate the call result corresponding to the abnormal response based on the call information;

[0165] The second determining module is used to determine the exception object corresponding to the exception response based on the call result, and display the exception object on the display interface.

[0166] Preferably, the call information includes a call chain ID and a span ID, and the generation module is further used for:

[0167] Based on the call chain ID, determine the service node corresponding to the abnormal response;

[0168] Based on the span ID, the calling order of the service nodes and the hierarchical relationship of the service nodes are determined;

[0169] Based on the service node, the call order, and the hierarchical relationship, the call result corresponding to the abnormal response is generated.

[0170] Preferably, the invocation information includes a response ID, and the generation module is further configured to:

[0171] Based on the span ID, the calling order of the service nodes is determined.

[0172] Based on the response ID, determine the responder of the service node;

[0173] The hierarchical relationship of the service nodes is determined based on the call order and the responder.

[0174] Preferably, the generation module is further configured to:

[0175] Based on the hierarchical relationship, the call depth of the service node is determined;

[0176] Based on the call depth, the service node, and the call order, the call result corresponding to the abnormal response is generated.

[0177] Preferably, the generation module is further configured to:

[0178] Based on the call order, the root service node among the service nodes is determined;

[0179] Based on the hierarchical relationship and the root service node, a call tree is generated from the service nodes, and the call tree is determined as the call result corresponding to the abnormal response.

[0180] Preferably, the anomaly location device further includes a tracking module, the tracking module being used for:

[0181] If the service request is detected, the call chain ID of the service request and the first span ID of the service request are generated based on the preset proxy component;

[0182] Based on the preset proxy component, the service node invoked by the service request is determined, and based on the service node, a second span ID of the service request is generated, wherein the span ID includes the first span ID and the second span ID;

[0183] The span ID and the call chain ID are associated and saved.

[0184] Preferably, the second determining module is further configured to:

[0185] Identify the abnormal nodes in the call results, and determine the abnormal objects of the abnormal nodes based on the log information of the abnormal nodes;

[0186] Determine the location of the abnormal node in the call result;

[0187] Based on the location of the anomaly, the anomaly object is displayed on the display interface.

[0188] The present invention also provides a computer-readable storage medium.

[0189] The present invention provides a computer-readable storage medium storing an anomaly location program, which, when executed by a processor, implements the steps of the anomaly location method described above.

[0190] The method implemented when the anomaly location program running on the processor is executed can be referred to in various embodiments of the anomaly location method of the present invention, and will not be repeated here.

[0191] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0192] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0193] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0194] The above are merely preferred embodiments of the present invention and do not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method of anomaly localization, the method comprising: The abnormal positioning method comprises the following steps: If a service request is detected, based on an Nginx proxy component, a call chain ID of the service request and a first span ID of the service request are generated according to a preset specification standard, the call chain ID and the first span ID are output to a log of the Nginx proxy component, and the call chain ID is encapsulated into the service request; Based on the Nginx proxy component, a service node called by the service request is determined, and based on the service node, a second span ID of the service request is determined; When a log collection component deployed to a server corresponding to the Nginx proxy component collects a log of the preset specification standard from the log of the Nginx proxy component, a span ID and the call chain ID are associated and saved into a database of a message server service end, the span ID comprising the first span ID and the second span ID; If an abnormal response is detected, a service request of the abnormal response is determined, and based on the service request, calling information corresponding to the abnormal response is determined, the calling information comprising a call chain ID, a span ID and a response ID, the response ID being used to distinguish multiple consumptions of a service request by a same service node; Based on the call chain ID, a service node corresponding to the abnormal response is determined; Based on the span ID, a calling order of the service node is determined; Based on the response ID, a responder of the service node is determined; Based on the calling order and the responder, a hierarchical relationship of the service node is determined; Based on the hierarchical relationship, a calling depth of the service node is determined; The service nodes are sorted from small to large according to the size of the calling depth; The service node with the smallest calling depth is taken as a basis of a calling result, and then the service node with a calling depth one layer larger is built in on the basis of the service node with the smallest calling depth, and so on, and finally the service node with the largest calling depth is placed at the top; According to the calling order, the positions of the service nodes of each level are adjusted to generate a calling result corresponding to the abnormal response; By identifying an abnormal identifier in the calling result, an abnormal node in the calling result is identified, and based on log information of the abnormal node, an abnormal object of the abnormal node is determined; wherein the abnormal identifier is obtained by marking a current service node as abnormal when the current service node is determined to be abnormal; whether the current service node is abnormal is determined by determining a preset time corresponding to each service node, the preset time being an average time range of historical normal calling of each service node; determining whether the calling time of the current service node responding to the current service request exceeds the preset time corresponding thereto, if yes, the current service node is determined to be abnormal; if not, the current service node is determined to be normal; The abnormal position of the abnormal node in the calling result is determined; Based on the abnormal position, the abnormal object is displayed in bright color at the abnormal position in the calling result, and the abnormal object is displayed on a display interface.

2. An anomaly locating device, characterized in that The abnormal positioning device comprises: The tracking module is configured to, if a service request is detected, generate, based on an Nginx proxy component, a call chain ID of the service request and a first span ID of the service request according to a preset specification standard, output the call chain ID and the first span ID to a log of the Nginx proxy component, and encapsulate the call chain ID into the service request; determine, based on the Nginx proxy component, a service node called by the service request, and determine, based on the service node, a second span ID of the service request; and when a log collection component deployed to a server corresponding to the Nginx proxy component collects a log of the preset specification standard from the log of the Nginx proxy component, associate and save a span ID and the call chain ID in a database of a message server service end, the span ID including the first span ID and the second span ID. The first determination module is configured to, if an abnormal response is detected, determine a service request of the abnormal response, and determine, based on the service request, call information corresponding to the abnormal response, the call information including a call chain ID, a span ID, and a response ID, the response ID being used to distinguish multiple consumptions of a service request by a same service node. The generation module is configured to generate, based on the call information, a call result corresponding to the abnormal response. The second determination module is configured to determine, based on the call result, an abnormal object corresponding to the abnormal response, and display the abnormal object on a display interface. The generation module is further configured to: determine, based on the call chain ID, a service node corresponding to the abnormal response; determine, based on the span ID, a call order of the service node; determine, based on the response ID, a responder of the service node; determine, based on the call order and the responder, a hierarchical relationship of the service node; determine, based on the hierarchical relationship, a call depth of the service node; sort the service nodes in ascending order according to the call depth; take a service node with the smallest call depth as a basis of the call result, and then build a service node with a call depth one layer larger on the basis of the service node with the smallest call depth, and so on, and finally place a service node with the largest call depth at the top; adjust positions of the service nodes of each level according to the call order, and generate the call result corresponding to the abnormal response; and the second determination module is configured to determine, based on the call result, an abnormal object corresponding to the abnormal response, and display the abnormal object on a display interface. The second determining module is further configured to identify an abnormal node in the calling result by identifying an abnormal identifier in the calling result, and determine an abnormal object of the abnormal node based on log information of the abnormal node; wherein the abnormal identifier is obtained by marking a current service node as abnormal when determining whether the current service node is abnormal; whether the current service node is abnormal is determined by determining a preset time corresponding to each service node, the preset time being an average time range of historical normal calling of each service node; determining whether a calling time of the current service node in response to a current service request exceeds the preset time corresponding to the current service node, and if yes, determining that the current service node is abnormal; and if no, determining that the current service node is normal; determining an abnormal position of the abnormal node in the calling result; and displaying the abnormal object in the abnormal position of the calling result in bright color based on the abnormal position, and displaying the abnormal object on a display interface.

3. An anomaly locating system characterized by The abnormal positioning system comprises a memory, a processor, and an abnormal positioning program stored on the memory and executable on the processor, and the abnormal positioning program, when executed by the processor, implements the steps of the abnormal positioning method of claim 1.

4. A computer-readable storage medium, characterized in that, The computer readable storage medium stores an abnormal positioning program, and the abnormal positioning program, when executed by the processor, implements the steps of the abnormal positioning method of claim 1.

Citation Information

Patent Citations

  • Monitoring method and device, computer device and storage medium

    CN109873717A