Abnormal link tracking method and device
By mounting probes in the microservice system and injecting web interface and log processing components, catching and encapsulating exception logs, and querying exception links with traceID, the problem of exception location and troubleshooting in the microservice architecture is solved, and lightweight distributed exception link tracking is realized, reducing resource occupation and maintenance complexity.
Patent Information
- Application Number
- CN202510162484.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2045-02-14
AI Technical Summary
In the microservice architecture, the location, tracking, root cause confirmation and troubleshooting and repairing processes when abnormalities occur face huge challenges. The existing solutions have problems such as high deployment costs, high resource consumption and complex maintenance.
By mounting the probe at system startup, the probe acquires the IOC container and injects the Web interface component and the log processing component. When an abnormality occurs in the page function, the probe captures the ERROR log and feedbacks it in the form of a page pop-up window. The log processing component encapsulates the log information, including traceID. The developer querys the exception link through traceID, and the web interface component uses key-value memory cache middleware (such as Redis) to obtain exception details and encapsulates the http return value.
It realizes lightweight distributed exception link tracking, significantly reduces the use of storage and computing resources, simplifies the exception feedback and troubleshooting process, and improves the stability and maintainability of the system.
Smart Images

Figure CN119621491A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of anomaly detection, and in particular to an abnormal link tracking method and device. Background Art
[0002] With the continuous development of science and technology and the advent of the information age, microservice architecture has gradually become the mainstream architecture model in modern system design. By splitting a single system into multiple independent services, microservice architecture not only effectively improves the system's concurrent processing capabilities, but also significantly enhances the system's flexibility and scalability, thus becoming an important technical means to promote business growth.
[0003] In a microservice system, each service is usually composed of multiple nodes, and the nodes process requests collaboratively through a load balancing mechanism. The complete business process is jointly participated and supported by multiple services, and the services cooperate with each other to ensure the stability, reliability and high throughput of the system. However, due to the distributed nature of the microservice architecture, the location, tracking, root cause confirmation, and troubleshooting and repair processes when an exception occurs face huge challenges. How to quickly, efficiently and accurately locate problems and reduce the communication costs between testers and developers has become an important issue affecting system maintenance efficiency and availability.
[0004] At present, the location and troubleshooting of anomalies in microservice scenarios mainly rely on manual troubleshooting. After the tester finds a system error, he notifies the developer. The developer reproduces the problem, speculates the possible cause, and uses the interface URL to execute the log query command in the relevant Web service node to filter out the log records related to the anomaly. If the anomaly involves multiple services or middle-end services, the above query process needs to be repeated in other service nodes. Since each service in the microservice architecture contains multiple nodes and the number of services is large, the workload of manual troubleshooting will increase exponentially with the number of nodes, resulting in low troubleshooting efficiency. Especially in complex business scenarios with a large number of nodes, manual troubleshooting can easily cause fault response delays, seriously affecting the maintainability of the system. Existing solutions have problems such as high deployment cost, high resource consumption, and complex maintenance in abnormal link tracking in microservice scenarios. How to properly solve the above problems has become a topic that the industry needs to solve urgently. Summary of the invention
[0005] The present invention provides an abnormal link tracking method and device for realizing lightweight distributed abnormal link tracking, which not only reduces the occupancy of storage and computing resources, but also simplifies the abnormal feedback and troubleshooting process.
[0006] According to a first aspect of the present invention, a method for tracing an abnormal link is provided, the method comprising: When the system starts, a probe is mounted, and the probe is used to obtain the IOC container loaded by the current system, into which the web interface component and the log processing component are injected; When an exception occurs in the page function, the probe is triggered to obtain the ERROR log, and feedback is given in the form of a page pop-up window. The log processing component is used to receive the ERROR log and encapsulate it. The page pop-up window includes a web interface component and a traceID; When viewing the abnormal details link in the page pop-up window, a request to query the abnormal link is initiated to the current service according to the web interface component and traceID included in the page pop-up window; According to the request for querying the abnormal link, the web interface component queries the key-value memory cache middleware to obtain the abnormal details, encapsulates the abnormal details, and feeds back the http return value.
[0007] In one embodiment, it includes: A web interface component is injected into the IOC container, and the web interface component is used to query exception details.
[0008] In one embodiment, it further includes: A log processing component is added to the log framework, and the log processing component is used to print ERROR-level logs to the key-value memory cache middleware, wherein the log processing component needs to be registered in the log framework.
[0009] In one embodiment, it includes: Before mounting the probe, prepare one or more business projects with call relationships that rely on Spring Boot open source components, and keep the traceId consistent in the call link.
[0010] In one embodiment, it includes: The encapsulated value information in the ERROR log includes any one or more of a service name, an IP address, a log category, a method-level code line number, and a key, where the key is composed of a prefix and a traceID.
[0011] In one embodiment, it further includes: The encapsulated value information in the ERROR log is stored in JSON format; Use key-value memory cache middleware to save the ERROR log.
[0012] According to a second aspect of the present invention, there is provided an abnormal link tracking device, comprising: The mounting module is used to mount the probe when the system starts, and the probe is used to obtain the IOC container loaded by the current system, and the web interface component and the log processing component are injected into the IOC container; The trigger module is used to trigger the probe to obtain the ERROR log when an abnormality occurs in the page function, and to provide feedback in the form of a page pop-up window. The log processing component is used to receive and encapsulate the ERROR log. The page pop-up window includes a web interface component and a traceID. A request module, used to initiate a request to query the abnormal link to the current service according to the web interface component and traceID included in the page pop-up window when viewing the abnormal details link in the page pop-up window; The query module is used to query the key-value memory cache middleware to obtain the exception details according to the request for querying the exception link, encapsulate the exception details, and feedback the http return value.
[0013] According to a third aspect of the present invention, there is provided an electronic device, the electronic device comprising: a communication interface, a processor, and a memory; The memory is used to store program instructions, and when the program instructions are executed by the processor that is communicatively connected to the memory through the communication interface, any of the above-mentioned abnormal link tracking methods is implemented.
[0014] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a computer (eg, a processor in a computer), any of the above-mentioned abnormal link tracking methods is implemented.
[0015] In summary, the present invention provides an abnormal link tracking method and device, the method comprising: when the system is started, a probe is mounted, the probe is used to obtain the IOC container loaded by the current system, and the web interface component and the log processing component are injected into the IOC container; when an abnormality occurs in the page function, the probe is triggered to obtain the ERROR log, and feedback is given in the form of a page pop-up window, the log processing component is used to receive the ERROR log and encapsulate it, and the page pop-up window includes the web interface component and the traceID; when viewing the abnormal details link in the page pop-up window, a request to query the abnormal link is initiated to the current service according to the web interface component and the traceID included in the page pop-up window; according to the request to query the abnormal link, the web interface component queries the key-value memory cache middleware to obtain the abnormal details, and encapsulates the abnormal details into the http return value, so that developers can easily obtain the abnormal details, thereby analyzing and repairing, and avoiding obtaining the abnormal details by the cumbersome way of querying the log. The technical solution of the present application provides a lightweight distributed abnormal link tracking technical solution, which can not only significantly reduce the occupancy of storage and computing resources, but also simplify the abnormal feedback and troubleshooting process, which is of great significance to improving the stability and maintainability of the system.
[0016] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description and the accompanying drawings.
[0017] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 A flowchart of an abnormal link tracing method provided by an embodiment of the present invention; Figure 2 A schematic diagram of a page pop-up window of another abnormal link tracking method provided by an embodiment of the present invention; Figure 3 An abnormality details diagram of another abnormal link tracing method provided by an embodiment of the present invention; Figure 4A traceID diagram of another abnormal link tracing method provided by an embodiment of the present invention; Figure 5 A structural diagram of an abnormal link tracking device provided by an embodiment of the present invention; Figure 6 A structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0020] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0021] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0022] like Figure 1 As shown, the present invention provides an abnormal link tracing method, the abnormal link tracing method comprising: In step S11, when the system starts, a probe is mounted, and the probe is used to obtain the IOC container loaded by the current system, and the web interface component and the log processing component are injected into the IOC container; In step S12, when an exception occurs in the page function, the probe is triggered to obtain an ERROR log, and feedback is given in the form of a page pop-up window. The log processing component is used to receive and encapsulate the ERROR log, and the page pop-up window includes a web interface component and a traceID; In step S13, when viewing the abnormal details link in the page pop-up window, a request for querying the abnormal link is initiated to the current service according to the web interface component and traceID included in the page pop-up window; In step S14, according to the request for querying the abnormal link, the web interface component queries the key-value memory cache middleware to obtain the abnormal details, encapsulates the abnormal details, and feeds back the http return value.
[0023] In one embodiment, a probe is mounted when the system starts, and the probe is used to obtain the IOC container currently loaded by the system. The IOC container is an implementation method of dependency injection, which is often used in modern development frameworks such as the Spring framework. It is responsible for managing the life cycle of objects and the dependencies between objects, ensuring that dependencies are correctly injected into each object when needed. The probe can monitor and manage each component in the system by accessing the IOC container when the system starts. The Web interface component is responsible for providing an interface for the system to interact with the outside, while the log processing component is responsible for recording errors and related information that occur during the operation of the system. These two components are injected into the IOC container through the mounting of the probe when the system starts, thereby ensuring that they can respond to and handle various events immediately during the operation of the system. The IOC container is not only for dependency injection, but also for component management of the application system. In the microservice architecture, the IOC container can flexibly manage each module, ensure loose coupling between components, and realize dynamic injection and configuration of modules. Through the IOC container, each service in the system can run independently without relying on the specific implementation of other services.
[0024] When a page function in the system fails, the system will trigger a probe, and the probe will capture ERROR-level logs. ERROR-level logs will be presented to the user in the form of a page pop-up window, prompting the system to fail, as shown in the attached figure. Figure 2 As shown. The log processing component is responsible for receiving the captured ERROR log and encapsulating it. The encapsulated log information is stored and provided to the user in the form of a page pop-up window. The purpose of encapsulating log information is to ensure the structuring and standardization of exception information, so that developers and testers can quickly understand and handle problems. Encapsulated log information includes but is not limited to service name, IP address, log category, method-level code lines, and traceID. With this information, developers can quickly locate the specific location where the error occurred, thereby reducing the time to troubleshoot the problem.
[0025] In addition to displaying the encapsulated information of the error log, the pop-up window also includes traceID. TraceID is a tracing mechanism in a distributed system that is used to identify the entire call chain of a request from the beginning to the end of the system. The introduction of traceID allows developers to quickly locate problems by tracing the call chain of the same traceID and accurately find the nodes and links where the problem occurs. When developers or testers view the exception details link in the pop-up window, the system will initiate a request to query the exception link to the current service based on the Web interface component and traceID in the pop-up window, and query the entire exception link information, as shown in the attached figure. Figure 3 As shown, you can find the upstream and downstream services where the exception occurred and trace the root cause of the problem.
[0026] The request to query the abnormal link is implemented through traceID. The system can trace back to all service nodes through which the request passes and find the errors that may occur on each node, such as Figure 4 Querying abnormal links not only helps locate errors in a single node, but also reveals problems in cross-service calls.
[0027] When querying the abnormal link, the Web interface component needs to query the key-value memory cache middleware (such as Redis) to obtain the abnormal details. Redis is an efficient memory storage system that stores data in the form of key-value pairs and supports high-speed reading. By using the efficient characteristics of Redis as a cache system, the abnormal log information can be quickly obtained and queried with almost no delay. As an in-memory database, Redis can provide very high read and write speeds, and is particularly suitable for storing data that needs to be accessed frequently, such as abnormal logs. Because Redis is memory-based, its access latency is almost negligible. For developers who need to quickly locate problems, it is very important to be able to quickly obtain abnormal details. Although Redis is an in-memory storage, it also provides a persistence option to ensure that log data will not be lost even if the system is restarted. ERROR logs are stored as a structured JSON format data. The key value of each log consists of a traceID and a prefix. The advantage of this design is that all related logs of the request can be easily queried through the traceID. By storing these log data in Redis, the system can ensure efficient storage and query of a large amount of abnormal information. Use the IOC container to manage the life cycle and dependencies of the Web interface component and the log processing component. The web interface component is responsible for querying exception details, while the log processing component is responsible for processing and storing error logs.
[0028] The web interface component is responsible for exposing the interface for querying exception details, receiving user requests and returning exception information. After the log processing component captures the ERROR log in the background, it encapsulates and stores the log information in a structured manner for subsequent queries. The log processing component needs to be registered with the log framework to ensure that the capture and storage of logs does not miss any important information. The encapsulation value of the ERROR log includes the service name, IP address, log category, method-level code lines, any information or multiple information in the key, and is stored in Redis using traceID as the key. The encapsulated log information is stored in JSON format to ensure the data is structured, easy to read, and compatible across systems.
[0029] The service name and IP address can help developers confirm which service node has a problem, and then locate the environment where the fault occurs. The method-level code line number provides specific code line information when the exception occurs, further helping developers locate the specific location of the code. The traceID ensures that developers can track the entire call chain and understand the flow of requests in the system. JSON, as a lightweight data exchange format, can easily store structured data and easily interact with other systems. Using JSON format to store ERROR logs allows exception logs to be quickly accessed within the system and compatible with other external tools, facilitating subsequent exception analysis and troubleshooting.
[0030] Before mounting the probe, develop one or more business projects with call relationships and maintain the traceID consistency of the call link. Spring Boot is a lightweight framework that can help developers simplify application development, configuration, and deployment in microservice architecture. Business projects developed with Spring Boot can easily integrate various distributed components and technologies, such as Redis, logging framework, etc., to achieve efficient abnormal link tracking. Spring Boot can simplify configuration and development. The features of automatic configuration and convention over configuration can greatly reduce the configuration workload, and developers can focus on business implementation. Spring Boot is tightly integrated with other Spring ecosystem components (such as Spring Cloud), which can easily build distributed systems.
[0031] The present invention provides an innovative lightweight distributed abnormal link tracking technology, which combines the IOC container, Web interface component, log processing component and key-value memory cache middleware (such as Redis) in the microservice architecture to achieve efficient abnormal log capture, storage and query. Developers can quickly locate abnormalities and avoid tedious log query processes, thereby improving system stability and developer work efficiency.
[0032] A distributed microservice system developed based on Spring Boot open source components. The system contains one or more business projects with a certain calling relationship. Each business project keeps the traceID consistent during the calling process to achieve call link tracking.
[0033] When each business project of the distributed microservice system is started, the probe of the present invention is mounted. The probe is lightweight and does not require the introduction of additional code layer changes such as second-party packages, and is non-invasive to business projects. When an exception occurs in the system, the probe combines the log framework to capture exception information, including stack, service name, thread, class, method and code line number where the exception occurs, etc. The exception is prompted through a page pop-up window, and a hyperlink is provided in the pop-up window. Click the hyperlink to locate the display of the exception details, return the page model of the same format, and display the captured exception details. If it is necessary to directly request the defined interface url on the page to pass the parameter traceID, add a line of hyperlinks in the pop-up window prompt, and the traceID is obtained from the returned interface return model. The probe automatically stores the captured exception details in a key-value memory cache middleware in a certain format. The cache middleware has an automatic expiration function, which can realize low-cost lightweight storage of exception information. It can be expanded in the original probe to implement different Controllers, define and write different key-value memory cache middleware data structure logic, and add interception to each entry, thereby realizing the display of the call link flow chart. Since each business project keeps the traceID consistent during the call process, the traceID can be used to track the call link, quickly locate the location where the exception occurs, reduce the time and energy spent by developers to troubleshoot exceptions, and reduce the communication cost and exception reproduction cost between testers and developers. Only the exception logs where the exception occurs are stored, making full use of the existing storage resources of the business system without the need for additional complex storage deployment, and realizing non-intrusive, low-cost storage and display of exception information, which is of great significance to improving the maintainability of the entire business system.
[0034] There is no need to deploy complex supporting services. You only need to mount a probe when deploying the service to implement the function, which takes up little business system resources. Business engineering does not need to introduce additional dependencies, does not need to make changes to the code layer, and has no impact on the existing business system. It can be expanded on the basis of the original probe, flexibly define the data structure logic of writing different key-value memory cache middleware, increase interception to achieve call link flow chart display, and adapt to different business needs. Only store exception logs, use the existing storage resources of the business system, realize low-cost storage and display of exception information, and reduce development and testing costs. Quickly locate the location where the exception occurs, reduce the workload of developers and testers, and improve the maintainability of the entire business system.
[0035] The technical solution in this embodiment provides a lightweight distributed abnormal link tracking technical solution, which can not only significantly reduce the occupancy of storage and computing resources, but also simplify the abnormal feedback and troubleshooting process, especially for microservice scenarios with many nodes, greatly reducing the workload of manual troubleshooting of abnormalities.
[0036] In one embodiment, Figure 5 FIG. 1 is a block diagram of an abnormal link tracking device according to an exemplary embodiment. Figure 5 As shown, the abnormal link tracking device includes a mounting module 51, a triggering module 52, a request module 53 and a query module 54.
[0037] The mounting module 51 is used to mount a probe when the system starts, and the probe is used to obtain the IOC container loaded by the current system, and the web interface component and the log processing component are injected into the IOC container; The trigger module 52 is used to trigger the probe to obtain the ERROR log when an abnormality occurs in the page function, and to provide feedback in the form of a page pop-up window. The log processing component is used to receive and encapsulate the ERROR log. The page pop-up window includes a web interface component and a traceID. The request module 53 is used to initiate a request to query the abnormal link to the current service according to the web interface component and traceID included in the page pop-up window when viewing the abnormal details link in the page pop-up window; The query module 54 is used to query the key-value memory cache middleware to obtain the exception details according to the request for querying the exception link, and encapsulate the exception details into HTTP return values, so that developers can easily obtain the exception details for analysis and repair, avoiding the cumbersome way of querying logs to obtain the exception details.
[0038] The mounting module 51, the triggering module 52, the requesting module 53 and the querying module 54 included in the abnormal link tracking device block diagram are controlled to execute the abnormal link tracking method described in any of the above embodiments.
[0039] like Figure 6 As shown, the present invention provides an electronic device 600, which includes: a communication interface, a processor 601, and a memory 602; Among them, the memory 602 is used to store program instructions. When the program instructions are executed by the processor 601 that is communicatively connected to the memory 602 through the communication interface, when the system starts, a probe is mounted, and the probe is used to obtain the IOC container loaded by the current system, and the web interface component and the log processing component are injected into the IOC container; when an exception occurs in the page function, the probe is triggered to obtain the ERROR log, and feedback is given in the form of a page pop-up window. The log processing component is used to receive the ERROR log and encapsulate it, and the page pop-up window includes the web interface component and the traceID; when viewing the exception details link in the page pop-up window, a request for querying the exception link is initiated to the current service according to the web interface component and the traceID included in the page pop-up window; according to the request for querying the exception link, the web interface component queries the key-value memory cache middleware to obtain the exception details, and encapsulates the exception details into the http return value, so that developers can easily obtain the exception details, thereby analyzing and repairing, and avoiding obtaining the exception details through cumbersome log query methods.
[0040] The present invention provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, when the system starts, a probe is mounted, and the probe is used to obtain an IOC container loaded by the current system, and a web interface component and a log processing component are injected into the IOC container; when an exception occurs in a page function, the probe is triggered to obtain an ERROR log, and feedback is given in the form of a page pop-up window, and the log processing component is used to receive and encapsulate the ERROR log, and the page pop-up window includes a web interface component and a traceID; when the exception details link in the page pop-up window is viewed, a request for querying an exception link is initiated to the current service according to the web interface component and the traceID included in the page pop-up window; according to the request for querying the exception link, the web interface component queries a key-value memory cache middleware to obtain the exception details, and encapsulates the exception details into an http return value, so that developers can conveniently obtain the exception details, thereby performing analysis and repair, and avoiding obtaining the exception details in a cumbersome way of querying logs.
[0041] It should be understood that the specific features, operations and details described hereinabove about the method of the present invention may also be similarly applied to the device and system of the present invention, or, vice versa. In addition, each step of the method of the present invention described above may be performed by the corresponding parts or units of the device or system of the present invention.
[0042] It should be understood that each module / unit of the device of the present invention can be implemented in whole or in part by software, hardware, firmware or a combination thereof. Each module / unit can be embedded in the processor of the computer device in the form of hardware or firmware or independent of the processor, or can be stored in the memory of the computer device in the form of software for the processor to call to perform the operation of each module / unit. Each module / unit can be implemented as an independent component or module, or two or more modules / units can be implemented as a single component or module.
[0043] In one embodiment, a computer device is provided, which includes a memory and a processor, and the memory stores computer instructions executable by the processor, and the computer instructions instruct the processor to execute each step of the method of the embodiment of the present invention when executed by the processor. The computer device can be a server, a terminal, or any other electronic device with necessary computing and / or processing capabilities in a broad sense. In one embodiment, the computer device may include a processor, a memory, a network interface, a communication interface, etc. connected through a system bus. The processor of the computer device can be used to provide necessary computing, processing and / or control capabilities. The memory of the computer device may include a non-volatile storage medium and an internal memory. An operating system, a computer program, etc. may be stored in or on the non-volatile storage medium. The internal memory can provide an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface and the communication interface of the computer device can be used to connect and communicate with external devices through a network. The steps of the method of the present invention are executed by the processor.
[0044] The present invention may be implemented as a computer-readable storage medium having a computer program stored thereon, which causes the steps of the method of an embodiment of the present invention to be executed when executed by a processor. In one embodiment, the computer program is distributed on a plurality of computer devices or processors coupled to a network so that the computer program is stored, accessed, and executed in a distributed manner by one or more computer devices or processors. A single method step / operation, or two or more method steps / operations, may be performed by a single computer device or processor or by two or more computer devices or processors. One or more method steps / operations may be performed by one or more computer devices or processors, and one or more other method steps / operations may be performed by one or more other computer devices or processors. One or more computer devices or processors may perform a single method step / operation, or perform two or more method steps / operations.
[0045] It can be understood by a person skilled in the art that the method steps of the present invention can be completed by instructing related hardware such as a computer device or a processor through a computer program, and the computer program can be stored in a non-temporary computer-readable storage medium, and the steps of the present invention are executed when the computer program is executed. Depending on the circumstances, any reference to memory, storage, database or other media in this article may include non-volatile and / or volatile memory. Examples of non-volatile memory include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EPROM), flash memory, magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid-state disk, etc. Examples of volatile memory include random access memory (RAM), external cache memory, etc.
[0046] The various technical features described above can be combined arbitrarily. Although all possible combinations of these technical features are not described, any combination of these technical features should be considered to be covered by this specification as long as there is no contradiction in such combination.
[0047] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. An abnormal link tracking method, characterized in that: Applied to distributed systems, including: When the system starts, a probe is mounted, and the probe is used to obtain the IOC container loaded by the current system, into which the web interface component and the log processing component are injected; When an exception occurs in the page function, the probe is triggered to obtain the ERROR log, and feedback is given in the form of a page pop-up window. The log processing component is used to receive the ERROR log and encapsulate it. The page pop-up window includes a web interface component and a traceID; When viewing the abnormal details link in the page pop-up window, a request to query the abnormal link is initiated to the current service according to the web interface component and traceID included in the page pop-up window; According to the request for querying the abnormal link, the web interface component queries the key-value memory cache middleware to obtain the abnormal details, encapsulates the abnormal details, and feeds back the http return value.
2. The abnormal link tracing method according to claim 1, characterized in that: The IOC container includes: A web interface component is injected into the IOC container, and the web interface component is used to query exception details.
3. The abnormal link tracing method according to claim 1, characterized in that: The log processing component includes: A log processing component is added to the log framework, and the log processing component is used to print ERROR-level logs to the key-value memory cache middleware, wherein the log processing component needs to be registered in the log framework.
4. The abnormal link tracing method according to claim 1, characterized in that: Also includes: Before mounting the probe, prepare one or more business projects with call relationships that rely on Spring Boot open source components, and keep the traceID consistent in the call link.
5. The abnormal link tracing method according to claim 1, characterized in that: Also includes: The encapsulated value information in the ERROR log includes any one or more of a service name, an IP address, a log category, a method-level code line number, and a key, where the key is composed of a prefix and a traceID.
6. The abnormal link tracing method according to claim 1, characterized in that: Also includes: The encapsulated value information in the ERROR log is stored in JSON format; Use key-value memory cache middleware to save the ERROR log.
7. An abnormal link tracking device, characterized in that: include: The mounting module is used to mount the probe when the system starts, and the probe is used to obtain the IOC container loaded by the current system, and the web interface component and the log processing component are injected into the IOC container; The trigger module is used to trigger the probe to obtain the ERROR log when an abnormality occurs in the page function, and to provide feedback in the form of a page pop-up window. The log processing component is used to receive and encapsulate the ERROR log. The page pop-up window includes a web interface component and a traceID. A request module, used to initiate a request to query the abnormal link to the current service according to the web interface component and traceID included in the page pop-up window when viewing the abnormal details link in the page pop-up window; The query module is used to query the key-value memory cache middleware to obtain the exception details according to the request for querying the exception link, encapsulate the exception details, and feedback the http return value.
8. The abnormal link tracking device according to claim 7, characterized in that: The mounting module, the triggering module, the request module and the query module are controlled to execute the abnormal link tracking method described in any one of claims 1-6.
9. An electronic device, characterized in that: include: Communication interface, processor, memory; Wherein, the memory is used to store program instructions, and when the program instructions are executed by the processor that is communicatively connected to the memory through the communication interface, the electronic device implements the abnormal link tracking method described in any one of claims 1 to 6.
10. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a computer, the computer implements the abnormal link tracing method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Service call chain implementation method based on self-research framework
CN112559212A
JS-based log analysis method and device, electronic equipment and medium
CN114443337A
Program exception observation method and device for business system
CN117215964A
Micro-service fault positioning method and terminal
CN118193258A
Link state tracking method and apparatus, and electronic device and computer storage medium
WO2021189899A1