Link monitoring method and system, storage medium and program product
By generating and associating global link tracking identifiers in service requests, the problem of the inability to realize the association monitoring of front-end and back-end links in the existing technology is solved, and the full link monitoring and analysis of front-end links is realized, which improves the faults The ability to troubleshoot and perform performance optimization.
Patent Information
- Application Number
- CN202411151986.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-12-03
AI Technical Summary
The existing link monitoring system cannot realize full-link associated monitoring between the front-end and the back-end, resulting in a lack of comprehensive observation and analysis capabilities when positioning problems.
By generating global link tracking identifiers in business requests, and associating them with the buried point components of the back-end server and the front-end device, connecting the front-end links in series to realize full-link monitoring. The specific steps include intercepting service requests on the backend server, extracting global link tracking identifiers, and associating them with backend microservice link information, adding them to the service request, and generating and associated front-end link information on the front-end device, through middleware Integrate with database link information.
It realizes full-link monitoring of the front-end and back-end, and can identify the front-end links involved in the series service request through a unique global link tracking, providing comprehensive link analysis and troubleshooting capabilities.
Smart Images

Figure CN119071182A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a link monitoring method, system, storage medium and program product. Background Art
[0002] In related technologies, the design of the link monitoring system is usually that the front end monitors the front end, and the back end monitors the back end. However, for the entire front-end and back-end systems, full-link observation is generally required when locating problems. Therefore, it is necessary to find a method that can achieve full-link monitoring of the front and back ends. Summary of the invention
[0003] The main purpose of the present application is to provide a link monitoring method, system, storage medium and program product, aiming to solve the technical problem that the front-end and back-end link correlation monitoring cannot be realized in the related technology.
[0004] To achieve the above purpose, the present application proposes a link monitoring method, which can be used in a backend server. The link monitoring method includes:
[0005] When the business request flows to the microservice of the backend server, determine the global link tracking identifier in the business request; when the tracking component of the front-end device is triggered by the business request, the global link tracking identifier is generated by the front-end device based on the business request and added to the business request;
[0006] In response to the microservice processing business request, generate backend microservice link information;
[0007] The global link tracking identifier is associated with the backend microservice link information, and the backend microservice link information is added to the business request.
[0008] In one embodiment, when a service request is transferred to a microservice of a backend server, the step of determining a global link tracking identifier in the service request includes:
[0009] Intercept business requests through the link tracking component corresponding to the microservice; the link tracking component includes the Sleuth component and / or the Jaeger component;
[0010] The global link tracking identifier is extracted from the service request.
[0011] In one embodiment, after the step of associating the global link tracking identifier with the backend microservice link information and adding the backend microservice link information to the business request, the following step is further performed:
[0012] Intercept business requests through the query language interceptor corresponding to the database;
[0013] Generate database link information;
[0014] Associating the global link tracking identifier with the database link information, and adding the database link information to the business request;
[0015] Intercept business requests through the middleware interceptor corresponding to the middleware;
[0016] Generate middleware link information;
[0017] The global link tracking identifier is associated with the middleware link information, and the middleware link information is added to the service request.
[0018] In one embodiment, the method further comprises:
[0019] Get front-end link information;
[0020] Analyze the entire link corresponding to the business request based on the front-end link information, back-end microservice link information, database link information, middleware link information, and preset link analysis strategies;
[0021] If any of the front-end link information, back-end microservice link information, database link information and middleware link information does not meet the preset link analysis strategy, link warning information is generated and sent to the front-end device so that the front-end device outputs and displays the link warning information.
[0022] In one embodiment, when the service request is transferred to the microservice of the backend server, after the step of determining the global link tracking identifier in the service request, the following steps are further included:
[0023] Generate backend log information in response to microservice processing business requests;
[0024] Associate backend log information with the global link tracking identifier.
[0025] In addition, to achieve the above purpose, the present application also proposes a link monitoring method, which can be used for a front-end device. The link monitoring method includes:
[0026] If the embedded node of the monitoring front-end device is triggered by a service request, a global link tracking identifier is generated based on the service request;
[0027] Generate front-end link information;
[0028] Associate the global link tracking identifier with the front-end link information.
[0029] In one embodiment, if the embedded node of the monitoring front-end device is triggered by a service request, the step of generating a global link tracking identifier based on the service request further includes:
[0030] Initiate operations in response to user business requests and generate front-end log information;
[0031] Associate the front-end log information with the global link tracking identifier.
[0032] In addition, to achieve the above purpose, the present application also proposes a link monitoring system, which includes:
[0033] A back-end server, the back-end server comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the link monitoring method described above;
[0034] A front-end device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the link monitoring method described above.
[0035] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium. A computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the link monitoring method as described above are implemented.
[0036] In addition, to achieve the above-mentioned purpose, the present application also proposes a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the link monitoring method as described above are implemented.
[0037] One or more technical solutions proposed in this application have at least the following technical effects:
[0038] In the link monitoring method provided by the present application, the back-end server can determine the global link tracking identifier in the business request when the business request flows to the microservice; wherein, the global link tracking identifier is generated by the front-end device based on the business request and added to the business request when the tracking component of the front-end device is triggered by the business request; in response to the microservice processing the business request, the back-end microservice link information can be generated; the obtained global link tracking identifier is associated with the back-end microservice link information, and the back-end microservice link information is added to the business request, thereby the unique global link tracking identifier generated by the front-end device can be associated with the link information on the back-end server, and the front-end and back-end links involved in the business request are connected in series through the unique link tracking identifier, thereby realizing full-link monitoring of the front-end and back-end. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0041] Figure 1 A schematic diagram of the structure of a link monitoring system provided in an embodiment of the present application;
[0042] Figure 2 A schematic diagram of the structure of a backend server of a hardware operating environment involved in the link monitoring method in an embodiment of the present application;
[0043] Figure 3 A flowchart of the first embodiment of the link monitoring method of the present application is provided;
[0044] Figure 4 A flowchart of the second embodiment of the link monitoring method of the present application is provided;
[0045] Figure 5 A brief flowchart of the link monitoring method provided in Example 2 of the present application;
[0046] Figure 6 A schematic diagram of front-end link screening is shown as an example;
[0047] Figure 7 The following is a schematic diagram of backend link screening as an example.
[0048] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0049] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0050] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0051] The main solution of the embodiment of the present application is: when the business request flows to the microservice of the back-end server, determine the global link tracking identifier in the business request; when the tracking point component of the front-end device is triggered by the business request, the global link tracking identifier is generated by the front-end device based on the business request and added to the business request; in response to the microservice processing the business request, generate the back-end microservice link information; associate the global link tracking identifier with the back-end microservice link information, and add the back-end microservice link information to the business request.
[0052] In related technologies, the design of the link monitoring system is usually that the front end monitors the front end and the back end monitors the back end. However, for the entire front-end and back-end systems, full-link observation is required when locating problems. Therefore, it is necessary to find a method that can achieve full-link monitoring of the front and back ends.
[0053] This application provides a solution, whereby the backend server can associate the global link tracking identifier generated by the frontend device with the backend microservice link information of the microservice, and add the backend microservice link information to the business request. The global link tracking identifier can thus run through the entire process of the business request, and the frontend and backend links involved in the business request are connected in series through a unique global link tracking identifier, thereby realizing full-link monitoring of the frontend and backend of the business request.
[0054] The following will provide an expanded description and introduction through multiple embodiments.
[0055] Reference Figure 1 , Figure 1 FIG. 1 is a schematic diagram of a link monitoring system provided by an embodiment. Figure 1 As shown, the link monitoring system may include a back-end server and a front-end device.
[0056] Among them, the backend server can be a physical server including an independent host, or the backend server can be a virtual server carried by a host cluster. During operation, the backend server can run server-side applications to realize relevant business functions of the application.
[0057] In one embodiment, the back-end server may include: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the link monitoring method in Embodiment 1 described below.
[0058] Refer to the following Figure 2 , which shows a schematic diagram of the structure of a back-end server suitable for implementing an embodiment of the present application. The back-end server in the embodiment of the present application may include but is not limited to mobile terminals such as laptop computers, digital broadcast receivers, PADs (Portable Application Description: tablet computers), etc., and fixed terminals such as desktop computers, etc. Figure 2 The back-end server shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0059] like Figure 2As shown, the back-end server may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the back-end server are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the back-end server to communicate with other devices wirelessly or by wire to exchange data. Although the back-end server with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0060] The front-end device is a hardware device that the user interacts directly with and can be used to access and use applications or web pages. The front-end device may include electronic devices such as the following types: smart phones, tablet devices, laptops, PDAs (Personal Digital Assistants), etc., and one or more embodiments of this specification are not limited to this.
[0061] After the user initiates a service request on the front-end device, the service request can be sent to the back-end server through the communication protocol. After responding to the service request, the back-end server can provide corresponding microservices and feed back the results to the front-end device so that the front-end device can display them, thereby completing the interaction with the user.
[0062] In one embodiment, the front-end device may include: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor so that at least one processor can execute the link monitoring method in the second embodiment described below. The hardware structure of the front-end device is similar to the hardware structure of the above-mentioned back-end server, and may also include a processing device 1001, a read-only memory 1002, a storage device 1003, and a random access memory 1004. In the RAM 1004, various programs and data required for the server operation are also stored. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other via a bus 1005. The input / output (I / O) interface 1006 is also connected to the bus. The relevant hardware description refers to the hardware structure description of the above-mentioned user terminal, which will not be repeated here.
[0063] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0064] Based on this, the present application embodiment provides a link monitoring method, referring to Figure 3 , Figure 3 This is a flow chart of the first embodiment of the link monitoring method of the present application.
[0065] It should be noted that, in this embodiment, the link monitoring method is executed by a backend server, and the link monitoring method may include steps S100 to S300:
[0066] Step S100, when a business request is transferred to a microservice of a backend server, a global link tracking identifier in the business request is determined.
[0067] Among them, the global link tracking identifier is generated by the front-end device based on the business request and added to the business request when the tracking point component of the front-end device is triggered by the business request.
[0068] Step S200, in response to the microservice processing business request, generating backend microservice link information.
[0069] Step S300: associate the global link tracking identifier with the backend microservice link information, and add the backend microservice link information to the business request.
[0070] Specifically, the user can operate on the front-end device to initiate a request for a service or resource (i.e., a business request) to the business system; for example, the user can click on the page link, interface button, etc. corresponding to the business request on the operation interface of the front-end device according to the actual business needs. After the tracking component on the front-end device detects the above operation of the user (i.e., detects that the business request is triggered), it can generate a unique global link tracking identifier according to the business request. The generated global link tracking identifier will be added to the business request and transferred to the back-end server along with the business request. For example, after the front-end tracking component captures the user behavior, it can prepare an HTTP request (Hypertext Transfer Protocol request) to send to the back-end server. At the same time, the link tracking library (such as Zipkin, OpenTracing, etc.) can be used in the front-end running code to generate the global link tracking identifier corresponding to the business request, and the generated global link tracking identifier is added to the header of the HTTP request, such as setting an HTTP request header in the form of X-Trace-Id:{trace_id} (X-Trace-Id is the header field, {trace_id} is the specific global link tracking identifier) to achieve the addition of the global link tracking identifier.
[0071] In the case where the above-mentioned business request flows to the microservice of the backend server, the backend server can parse and process the business request to obtain the global link tracking identifier carried in the business request. It is understandable that each microservice on the backend usually has a clear entry point (such as an API interface or endpoint). When the business request arrives at the entry point, the backend server can perceive the arrival of the business request through monitoring or pre-setting the tracking system. In a feasible implementation, step S100 can specifically include steps S110 to S120:
[0072] Step S110: intercepting the business request through the link tracking component corresponding to the microservice.
[0073] The link tracking component includes a Sleuth component and / or a Jaeger component.
[0074] Step S120: extracting a global link tracking identifier from the service request.
[0075] Specifically, a link tracking component can be connected to each microservice in the backend to handle the interception of incoming business requests. Link tracking components can include Sleuth components and / or Jaeger components; among them, Sleuth components can be compatible with link tracking systems such as Zipkin, and can automatically insert tracking information (such as global link tracking identifiers, link information, etc.) into the corresponding backend log information after intercepting the business request; and Jaeger components are an open source distributed tracking component that can support efficient link tracking and analysis; Jaeger components are generally used to implement support for the OpenTracing system. Integrate the Sleuth component and the Jaeger component into the backend microservices, configure the corresponding link tracking system for them, and also extract the underlying unified specifications for the Sleuth+Zipkin and OpenTracing+Jaeger systems.
[0076] It is understandable that in the relevant technology, the link system usually realizes data collection and display based on a certain type of specific standards, that is, all link data is collected based on the same standard, so the function of the link system is relatively simple. However, in a complex large system, especially a system composed of multiple applications and services, different services may use different link tracking standards and tools; that is, in a complex large system, there are inconsistencies in the link standards of different applications (different services) under it; if only based on a certain type of standard for collection and display, it will reduce the adaptability of the system and affect the efficiency of the system's link analysis. For example, in a large system, one service may use Zipkin, while another service uses Jaeger. Since these tools may use different data formats and protocols, if the same type of specific standards are used, it will make the integration of link data difficult, affecting the overall efficiency of the system.
[0077] By introducing the two systems of "Sleuth+Zipkin" and "OpenTracing+Jaeger" through the above method and extracting unified specifications between different systems and standards, it can help simplify the integration and analysis process. This ensures that the backend microservice application can choose any link system for tracing in actual application, realizes unified access of heterogeneous links, and achieves the effect of flexible design of link system.
[0078] After intercepting a business request through the link tracking component, the global link tracking identifier can be extracted from the business request for subsequent link analysis and tracking. In addition, when the link tracking component intercepts a business request, the link corresponding to the business request can be further marked. For example, the business request can be marked with the corresponding enterprise and employee identifiers, request parameters and other information in the current enterprise service scenario, so that the back-end link can be queried based on such information later.
[0079] After receiving the service request, in response to the service request corresponding to the microservice processing of the backend application, the corresponding backend microservice link information can be generated, and the backend microservice link information can include information such as the microservice processing response time and service instance. The backend server can associate the generated backend microservice link information with the unique global link tracking identifier corresponding to the service request generated by the front-end device, and add the backend microservice link information to the service request for subsequent link identification. For example, when the microservice corresponding to the service request involves cross-threading, requesting internal systems and external systems, etc., the backend microservice link information can be additionally filled into the service request for identification of the next-hop link.
[0080] It is worth mentioning that the business request may involve calling operations on the middleware and the database. In order to track and analyze the entire process of the business request more comprehensively, steps S400 to S900 may be included after step S300 to achieve link tracking of the database and the middleware:
[0081] Step S400: intercepting the business request through the query language interceptor corresponding to the database.
[0082] Step S500: Generate database link information.
[0083] Step S600: associate the global link tracking identifier with the database link information, and add the database link information to the service request.
[0084] Step S700: intercepting the service request through the middleware interceptor corresponding to the middleware.
[0085] Step S800: Generate middleware link information.
[0086] Step S900 , associating the global link tracking identifier with the middleware link information, and adding the middleware link information to the service request.
[0087] Specifically, a database is a system for storing and managing data. Back-end applications can use the database to persist data and support data addition, deletion, modification and query operations. When a business request involves a database service, the business request can be intercepted by the SQL structured query language interceptor corresponding to the database, and the corresponding database link information can be generated; the database link information can include query statements, execution time, link identifiers and other information. The back-end server can associate the global link tracking identifier with the database link information, and add the database link information to the business request for subsequent link analysis and tracking. For example, a global link tracking identifier can be added to the lifecycle hook provided at the database driver level. When SQL executes a query operation, the global link tracking identifier can be associated with the database link information including specific SQL statements, query time and query results, to help track the execution process of the SQL statement.
[0088] Middleware is generally a software layer located between application software and operating system or network, which can provide additional services and functions, such as message transmission, request cache and other services. The middleware interceptor corresponding to the middleware can intercept business requests such as message queues and cache systems, and generate corresponding middleware link information. The middleware link information can be associated with the global link tracking identifier, and the middleware link information can be added to the business request to ensure that the processing of the middleware can be tracked and monitored in the link tracking system.
[0089] It should be noted that different data in the above-mentioned link monitoring system (such as front-end, back-end, database and middleware link information, etc.) may be stored in different databases or storage systems in actual applications. However, based on the link monitoring method of the present application, each piece of data can be associated with a unique global link tracking identifier, that is, each piece of data corresponding to a business request has a corresponding unified global link tracking identifier. Therefore, the global link tracking identifier can be used to associate these scattered data to form a complete link view and realize full-link monitoring and analysis.
[0090] In addition, in order to provide better troubleshooting and performance optimization support, after step S100, backend log information can be generated in response to the microservice processing business request; the backend log information is associated with the global link tracking identifier. When the microservice processes the business request, the corresponding backend log information can be generated; the backend log information can include request processing logs (such as request start and end time, processed business logic and processing results, etc.), exception logs (such as error codes, exception stack traces, etc.) and performance logs (such as business response time, database query time, external service call time, etc.). The generated backend log information can be associated with the global link tracking identifier, and subsequent developers can directly query the corresponding backend log information based on the global link tracking identifier to quickly locate problems in the business request process and identify performance bottlenecks, so that the system can be optimized in a targeted manner.
[0091] In a feasible implementation manner, the link monitoring method may further include steps A100 to A300, which are used to analyze and warn the link corresponding to the service request:
[0092] Step A100, obtaining front-end link information.
[0093] Step A200, based on the front-end link information, the back-end microservice link information, the database link information, the middleware link information and the preset link analysis strategy, analyze the full link corresponding to the business request.
[0094] Step A300: If any of the front-end link information, back-end microservice link information, database link information and middleware link information does not meet the preset link analysis strategy, link warning information is generated and sent to the front-end device so that the front-end device outputs and displays the link warning information.
[0095] Specifically, the back-end server can obtain the front-end link information of the front-end device, and perform a full-link analysis corresponding to the business request in combination with the back-end microservice link information, database link information, and middleware link information of the back-end. The above link information can be analyzed based on a preset link analysis strategy. The preset link analysis strategy can be an integrity check (used to ensure that the front-end link information is consistent with the back-end, database, and middleware link information. If any part is missing or mismatched, it needs to be marked as abnormal), a performance indicator check (check whether the performance indicators of each link meet the preset performance standards. For example, whether the response time is within the expected range) or error detection (identify and analyze errors or abnormal situations, check whether the errors are propagated throughout the link, and record abnormal situations), etc.
[0096] If any of the front-end link information, back-end microservice link information, database link information, and middleware link information cannot meet the preset link analysis strategy, link warning information can be generated and fed back to the front-end device. The link warning information can include specific abnormal conditions of the link (such as service timeout, database query abnormality, etc.). The front-end device is usually equipped with a display interface that can output and display the link warning information so that the user can respond quickly. In one example, the above link information can be extracted to determine whether the link contains a large number of large lists and whether there is a phenomenon of cyclic request to the database with the same SQL. If the above phenomenon occurs, targeted warnings and message push can be made so that program developers can handle it in time.
[0097] It is not difficult to understand that in the link monitoring method provided in this embodiment, the backend server can associate the global link tracking identifier generated by the frontend device with the backend microservice link information of the microservice, and add the backend microservice link information to the business request. The global link tracking identifier can thus run through the entire process of the business request, and the front-end and back-end links involved in the business request are connected in series through a unique global link tracking identifier, thereby realizing the front-end and back-end full-link monitoring of the business request.
[0098] Based on the first embodiment of the present application, the second embodiment of the link monitoring method of the present application is proposed. In the second embodiment, the same or similar contents as those in the first embodiment can be referred to the above introduction, and will not be repeated later. Figure 4 , Figure 4 A flow chart of the second embodiment of the link monitoring method of the present application is shown.
[0099] It should be noted that, in this embodiment, the link monitoring method is executed by a front-end device, and the link monitoring method may include steps T100 to T300:
[0100] T100, if the embedded node of the monitoring front-end device is triggered by a service request, a global link tracking identifier is generated based on the service request.
[0101] T200, generates front-end link information.
[0102] T300 associates the global link tracking identifier with the front-end link information.
[0103] Specifically, the front-end device can perform embedding operations in the front-end application in advance to obtain pre-embedded nodes. The triggering conditions of the pre-embedded nodes can be pre-set. For example, the pre-embedded nodes can be triggered by a click operation. When the user clicks the page link, interface button, etc. corresponding to the business request on the front-end device operation interface and initiates a request for a certain service or resource (i.e., a business request) to the system, the pre-embedded node is triggered when it detects the user's click operation. After the front-end device detects that the pre-embedded node is triggered, it can generate a unique global link tracking identifier based on the business request. The global link tracking identifier can be used to track the entire life cycle of the business request. The front-end device can also generate front-end link information. The front-end link information can include user information, page path, calling interface and other information. The generated front-end link information can be associated with the unique global link tracking identifier to facilitate link tracing.
[0104] In addition, the global link tracking identifier generated by the front-end device will also be added to the business request and will flow to the back-end server along with the business request. For details, please refer to the above-mentioned embodiment 1, which will not be repeated here. In one example, the nodes can be pre-buried by building a point-burying framework, and the point-burying framework can be implemented by introducing the Jianwei SDK (software development kit) on the front end; for example, the Jianwei SDK can be imported into the user browser. When the user initiates a business request on the user browser of the front-end device, the Jianwei SDK will intercept the business request and report it to the back-end server together with the global link tracking identifier. At the same time, the Jianwei SDK can also store the generated front-end link information in the Jianwei database for subsequent analysis. Therefore, by associating the global link tracking identifier with the front-end link information, a complete request link can be constructed, so that the links of the front-end and back-end can be matched through the global link tracking identifier, providing full tracking from the front-end to the back-end, which is helpful for monitoring, debugging and optimizing system performance.
[0105] In a feasible implementation, after step T100, an operation may be initiated in response to a user's service request to generate front-end log information; and the front-end log information is associated with a global link tracking identifier.
[0106] Specifically, event listeners can be added at key points of the front-end page (such as button clicks, interface calls, etc.) to capture the operation behaviors of enterprise users. When enterprise users initiate business requests by opening a page, calling an interface, clicking a button, etc., a business log (i.e., front-end log information) of the code execution process of the corresponding event can be generated. The front-end log information can record detailed information describing user behavior, such as event type, operation element, timestamp, and operation content; the front-end log information can be associated with a global link tracking identifier, and stored and uploaded to the front-end server in a fixed format; for example, the global link tracking identifier can be added to the front-end log information, and the global link tracking identifier can be stored as a log field, so that each log record triggered by a user operation will be accompanied by this global link tracking identifier to ensure that all relevant log information can be associated with the same request link. When link tracking analysis is required later, the global link tracking identifier can also be used to find the corresponding front-end log information for comprehensive analysis.
[0107] It can be understood that in the link monitoring method provided in this embodiment, when it is monitored that the embedded node of the front-end device is triggered by a service request, a global link tracking identifier corresponding to the service request can be generated, and the global link tracking identifier can be associated with the front-end link information, so as to obtain a complete user request link view, and each link from the front-end to the back-end can be accurately tracked based on the global link tracking identifier.
[0108] For example, to help understand the implementation process of the link monitoring method obtained by combining this embodiment with the above-mentioned embodiment 1, please refer to Figure 5 , Figure 5 A brief flowchart of a link monitoring method is provided, specifically:
[0109] like Figure 5 As shown, when the business request flows to the front-end application (i.e., the front-end device), the tracking framework (see micro SDK + business extension) in the front-end application can be triggered by the business request to generate a unique global link tracking identifier and front-end link information. The front-end link information can be associated with the global link tracking identifier and stored in the see micro database. After the global link tracking identifier is generated, it will be added to the business request and will flow to the back-end server along with the business request. The microservice of the back-end server (i.e., the back-end application) can intercept the business request through the preset link framework (i.e., the link tracking component) and obtain the global link tracking identifier carried therein. As shown Figure 5As shown, the preset link framework may include the "Sleuth component + business extension" framework on business application 1, and may also include the "Jaeger + business extension" framework on business application 2. Of course, other preset link frameworks may be added according to actual application requirements. In response to the back-end application processing the business request, back-end log information may be generated and stored in the unified log library; the back-end microservice link information of the back-end microservice is associated with the global link tracking identifier and stored in the link database (i.e. Figure 5 The first hop of the link (i.e., the global link tracking identifier) is generated by the front-end application. For the back-end application, the back-end has generated a unique global link tracking identifier corresponding to this request when it first receives the service request, so there is no need for the back-end to generate it itself. The unique identifier of this service request is also recorded in the front-end, so that the front-end and back-end can unify the link identifiers and realize the link association tracking of the front-end and back-end.
[0110] When a business request involves a database service, the business request can be intercepted by the SQL interceptor, and the corresponding database link information can be generated. The database link information will be associated with the global link tracking identifier corresponding to the business request and stored in the link ES. The business request such as the message queue, cache system, etc. can also be intercepted by the middleware interceptor, and the corresponding middleware link information can be generated. Similarly, the middleware link information is also associated with the global link tracking identifier and stored in the link ES for subsequent analysis. The back-end server is configured with a link analyzer, which has preset link analysis strategies (analysis strategy 1 and analysis strategy 2). The link analyzer can obtain multiple link information from the link ES and perform link analysis based on analysis strategy 1 and analysis strategy 2. When there is an abnormality in the link, the early warning device in the link analyzer can generate link early warning information to prompt the user of the link abnormality.
[0111] In addition, in the above link monitoring method, the front-end and back-end can also independently perform link screening. For the front-end application, it can screen enterprises and employees, and can support the query of pages requested by employees, buttons clicked, front-end log information, called interfaces, etc. within the selected time period; among which, the called interface records can also be quickly linked to the back-end link; such as Figure 6 As shown, Figure 6 The following is a schematic diagram of front-end link filtering. Back-end link filtering can support multiple dimensions. In the enterprise service scenario, it can support filtering by dimensions such as enterprise, employee, and business key. Figure 7 As shown, Figure 7 The following is a schematic diagram of backend link screening as an example.
[0112] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the link monitoring method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0113] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the link monitoring method in the above-mentioned embodiment.
[0114] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0115] The computer-readable storage medium may be included in the back-end server and / or the front-end device; or may exist independently without being assembled into the back-end server and / or the front-end device.
[0116] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the back-end server, the back-end server: determines the global link tracking identifier in the business request when the business request flows to the microservice of the back-end server; when the tracking point component of the front-end device is triggered by the business request, the global link tracking identifier is generated by the front-end device based on the business request and added to the business request; generates back-end microservice link information in response to the microservice processing the business request; associates the global link tracking identifier with the back-end microservice link information, and adds the back-end microservice link information to the business request.
[0117] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0118] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0119] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0120] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned link monitoring method, and can solve the technical problem that the front-end and back-end link association monitoring cannot be realized in the related art. Compared with the related art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the link monitoring method provided by the above-mentioned embodiment, and will not be repeated here.
[0121] The present application also provides a computer program product, including a computer program, which implements the steps of the link monitoring method as described above when executed by a processor.
[0122] The computer program product provided by this application can solve the technical problem that the front-end and back-end link association monitoring cannot be realized in the related art. Compared with the related art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the link monitoring method provided by the above embodiment, which will not be repeated here.
[0123] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A link monitoring method, characterized in that: For a back-end server, the link monitoring method includes: In the case where the business request flows to the microservice of the backend server, a global link tracking identifier in the business request is determined; the global link tracking identifier is generated by the front-end device based on the business request and added to the business request when the tracking component of the front-end device is triggered by the business request; In response to the microservice processing the business request, generating backend microservice link information; The global link tracking identifier is associated with the backend microservice link information, and the backend microservice link information is added to the business request.
2. The link monitoring method according to claim 1, characterized in that: In the case where the business request is transferred to the microservice of the backend server, the step of determining the global link tracking identifier in the business request includes: Intercepting the business request through a link tracking component corresponding to the microservice; wherein the link tracking component includes a Sleuth component and / or a Jaeger component; The global link tracking identifier is extracted from the service request.
3. The link monitoring method according to claim 2, characterized in that: After the step of associating the global link tracking identifier with the backend microservice link information and adding the backend microservice link information to the business request, the step further includes: Intercepting the business request through a query language interceptor corresponding to the database; Generate database link information; Associating the global link tracking identifier with the database link information, and adding the database link information to the service request; Intercepting the business request through a middleware interceptor corresponding to the middleware; Generate middleware link information; The global link tracking identifier is associated with the middleware link information, and the middleware link information is added to the service request.
4. The link monitoring method according to claim 3, characterized in that: The method further comprises: Get front-end link information; Analyze the full link corresponding to the business request based on the front-end link information, the back-end microservice link information, the database link information, the middleware link information and the preset link analysis strategy; If any of the front-end link information, the back-end microservice link information, the database link information and the middleware link information does not meet the preset link analysis strategy, link warning information is generated and sent to the front-end device so that the front-end device outputs and displays the link warning information.
5. The link monitoring method according to any one of claims 1 to 4, characterized in that: In the case where the business request is transferred to the microservice of the backend server, after the step of determining the global link tracking identifier in the business request, the step further includes: In response to the microservice processing the business request, generating backend log information; The backend log information is associated with the global link tracking identifier.
6. A link monitoring method, characterized in that: For front-end equipment, the link monitoring method includes: If the embedded node monitoring the front-end device is triggered by a service request, a global link tracking identifier is generated based on the service request; Generate front-end link information; The global link tracking identifier is associated with the front-end link information.
7. The link monitoring method according to claim 6, characterized in that: If the embedded node monitoring the front-end device is triggered by a service request, the step of generating a global link tracking identifier based on the service request further includes: Initiate operations in response to user business requests and generate front-end log information; The front-end log information is associated with the global link tracking identifier.
8. A link monitoring system, characterized in that: The link monitoring system comprises: A back-end server, the back-end server comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the link monitoring method according to any one of claims 1 to 5; A front-end device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the link monitoring method as described in any one of claims 6 to 7.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the link monitoring method according to any one of claims 1 to 7 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the link monitoring method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Full-link service activity monitoring method and system under micro-service architecture
CN122027684A
