Full-link monitoring method and system, terminal device, and storage medium
By binding header parameters to the interface request and rewriting and encapsulating the interface set using a toolkit, node data is generated and transmitted. This solves the problem of not being able to quickly locate the cause of the interface request in the existing technology, realizes full-link monitoring, and improves the efficiency of fault diagnosis and user experience.
Patent Information
- Application Number
- CN202211143655.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-20
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2042-09-20
AI Technical Summary
Existing technologies cannot quickly pinpoint the specific cause of interface requests through link tracing, and lack user-related data dimensions, resulting in slow system response and poor user experience, and making it impossible to effectively investigate the scope of impact.
By binding preset header parameters to the interface request, and rewriting and encapsulating the interface set using the toolkit, node data is generated and transmitted to achieve end-to-end monitoring, thereby obtaining specific information about each node.
It improves troubleshooting efficiency, enables quick location of the cause of interface request failures, and enhances system response speed and user experience.
Smart Images

Figure CN115580525B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of end-to-end monitoring technology, and in particular to an end-to-end monitoring method, system, terminal device, and storage medium. Background Technology
[0002] With the large-scale migration of systems to the cloud and the adoption of microservices, the need for effective performance monitoring and analysis of various system interfaces is increasing. Currently, front-end web application monitoring solutions for interface performance interception rely on obtaining the time taken from when a client sends a request to when it receives the response. This approach has the following shortcomings: 1. The time taken to intercept an interface request from the client to the server cannot be quickly located through tracing the connection. Second, the lack of data dimensions associated with users leads to slow system response and a poor user experience, but it is impossible to investigate the scope of the impact from the user's perspective. Summary of the Invention
[0003] The main purpose of this application is to provide a method, system, terminal device and storage medium for end-to-end monitoring, which aims to solve the problem of not being able to obtain specific information of each node through the link and improve the efficiency of fault diagnosis.
[0004] To achieve the above objectives, this application provides a full-link monitoring method, which is applied to a front-end, the front-end interacting with a back-end, the front-end including a toolkit, and the full-link monitoring method comprising: Generate an API request; When sending the interface request to the backend, the toolkit binds preset header parameters to the interface request, wherein the toolkit is obtained by rewriting and encapsulating a preset set of interfaces; The interface request is sent to the backend so that the backend can identify the header parameters carried in the interface request and obtain the corresponding node data based on the header parameters. Receive the node data.
[0005] Optionally, before the step of binding preset header parameters to the interface request using the toolkit when sending the interface request to the backend, the method further includes: Obtain an interface set, the interface set including sending methods; Set the header parameters in the sending method to obtain the rewritten and encapsulated interface set; Import the rewritten and encapsulated interface set, generate the toolkit, and enable the corresponding link switch.
[0006] Optionally, the step of binding preset header parameters to the interface request through the toolkit includes: The sending method is triggered by the interface request to bind the header parameters to the interface request.
[0007] Optionally, after the step of receiving the node data, the method further includes: The node data is displayed through a pre-defined visual interface.
[0008] This application also provides a full-link monitoring method, which is applied to a backend, wherein the backend interacts with the frontend, and the full-link monitoring method includes the following steps: Respond to the interface request from the front end to identify the header parameters carried in the interface request; Based on the header parameters, the corresponding node data is obtained; The node data is sent to the front end.
[0009] Optionally, the backend includes at least one node, and the step of responding to the interface request from the frontend to identify the header parameters carried in the interface request includes: Each node responds to the interface request from the front end and identifies the header parameters of the interface request based on a preset collection service.
[0010] Optionally, the header parameters include an identity identifier, and the step of obtaining the corresponding node data based on the header parameters includes: Determine whether the identity identifier is valid; If the identity identifier is valid, then the node data is generated based on the header parameters and processed asynchronously and non-blockingly.
[0011] This application also proposes a full-link monitoring system, which includes a front-end and a back-end; The front end is used to generate interface requests. When sending the interface request to the back end, the front end uses the toolkit to bind preset header parameters to the interface request. The toolkit is obtained by rewriting and encapsulating a preset set of interfaces. The front end sends the interface request to the back end so that the back end can identify the header parameters carried by the interface request, obtain the corresponding node data according to the header parameters, and receive the node data. The backend is used to respond to the interface request of the frontend, identify the header parameters carried by the interface request, obtain the corresponding node data according to the header parameters, and send the node data to the frontend.
[0012] This application also proposes a terminal device, which includes a memory, a processor, and a full-link monitoring program stored in the memory and executable on the processor. When the full-link monitoring program is executed by the processor, it implements the steps of the full-link monitoring method as described above.
[0013] This application also proposes a computer-readable storage medium storing a full-link monitoring program, which, when executed by a processor, implements the steps of the full-link monitoring method described above.
[0014] The full-link monitoring method, system, terminal device, and storage medium proposed in this application generate an interface request. When sending the interface request to the backend, a toolkit is used to bind preset header parameters to the interface request. The toolkit is obtained by rewriting and encapsulating a preset interface set. The interface request is sent to the backend so that the backend can identify the header parameters carried in the interface request and obtain the corresponding node data based on the header parameters. The node data is then received. By intercepting the interface request and binding header parameters, the backend can generate node data based on the header parameters, solving the problem of not being able to obtain specific information about each node through the link and improving the efficiency of fault diagnosis. Based on the solution of this application, starting from the needs and challenges faced by the performance monitoring and analysis of each interface in the system, the monitoring of the entire link is completed. That is, full-link monitoring from the user initiating an interface request to the completion of the interface request is realized, and faults can be quickly located through the node information of the link. Attached Figure Description
[0015] Figure 1 This is a schematic diagram of the functional modules of the terminal equipment belonging to the end-to-end monitoring system of this application; Figure 2 This is a flowchart illustrating a first exemplary embodiment of the end-to-end monitoring method of this application; Figure 3 This is a flowchart illustrating a second exemplary embodiment of the end-to-end monitoring method of this application; Figure 4 This is a flowchart illustrating the interface request interception process of the end-to-end monitoring method in this application. Figure 5 This is a flowchart illustrating a third exemplary embodiment of the end-to-end monitoring method of this application; Figure 6 This is a flowchart illustrating the front-end access process of the end-to-end monitoring method in this application. Figure 7 This is a flowchart illustrating a fourth exemplary embodiment of the end-to-end monitoring method of this application; Figure 8 This is a full-link visualization diagram of the full-link monitoring method of this application; Figure 9 This is a schematic diagram of end-to-end data query from the user's perspective for the end-to-end monitoring method of this application; Figure 10 This is a flowchart illustrating a fifth exemplary embodiment of the end-to-end monitoring method of this application; Figure 11 This is a flowchart illustrating the sixth exemplary embodiment of the end-to-end monitoring method of this application; Figure 12 This is a flowchart illustrating the seventh exemplary embodiment of the end-to-end monitoring method of this application; Figure 13 This is a flowchart of the backend data processing of the end-to-end monitoring method in this application; Figure 14 This is a flowchart illustrating the eighth exemplary embodiment of the end-to-end monitoring method of this application.
[0016] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0017] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0018] The main solution of this application embodiment is as follows: An interface request is generated; when the interface request is sent to the backend, a toolkit is used to bind preset header parameters to the interface request, wherein the toolkit is obtained by rewriting and encapsulating a preset interface set; the interface request is sent to the backend so that the backend can identify the header parameters carried by the interface request and obtain the corresponding node data based on the header parameters; the node data is received. By intercepting the interface request and binding header parameters, the backend can generate node data based on the header parameters, which solves the problem of not being able to obtain specific information about each node through the link, thus improving the efficiency of fault diagnosis. Based on the solution of this application, starting from the patterns of needs and challenges faced by the performance monitoring and analysis of each interface in the system, the monitoring of the entire link is completed, that is, full-link monitoring from the user initiating an interface request to the completion of the interface request is realized, and faults can be quickly located through the node information of the link.
[0019] This application's embodiments take into account that, with the large-scale cloud migration and microservice architecture of systems, there are increasing demands and challenges in effectively monitoring and analyzing the performance of various system interfaces. Currently, front-end web application monitoring interception schemes for interface performance all obtain the time taken from the client sending a request to receiving the response. This scheme has the following shortcomings: While intercepting the time taken for an interface request from the client to the server, the lack of front-end link nodes makes it impossible to quickly locate the specific cause through back-end link tracing; there is no data dimension associated with the user, making it impossible to investigate the scope of impact from the user's perspective when users report slow system response and poor experience; and the monitoring data for each interface request is independent, failing to form a complete visual link and lacking visualization of the time taken for all link nodes, which greatly hinders performance optimization efforts.
[0020] Therefore, the embodiments of this application, starting from the patterns of needs and challenges faced by the performance monitoring and analysis of various interfaces of the system, propose an implementation method for front-end full-link monitoring, which completes the monitoring of the entire link. That is, it realizes full-link monitoring from the user initiating an interface request to the completion of the interface request. Faults can be quickly located through the node information of the link, solving the problem of not being able to obtain the specific information of each node through the link, and improving the efficiency of fault diagnosis.
[0021] Technical terms used in the embodiments of this application: XMLHttpRequest, or XMLHTTP, is a set of API functions that can be called by JavaScript, JScript, VBScript, and other scripting languages embedded in web browsers. It sends and receives XML or its data between the browser and the web server via HTTP. The advantage of XMLHTTP is that it allows for dynamic updates to web pages without needing to re-fetch the entire page from the server or install additional plugins.
[0022] WebFlux, a reactive web framework, can improve system throughput and scalability with limited resources. With the same amount of resources, WebFlux can handle more requests.
[0023] The Web, World Wide Web, also known as the World Wide Web, is a global, dynamic, interactive, cross-platform distributed graphical information system based on hypertext and HTTP. It is a network service built on the Internet, providing users with a graphical, easily accessible, and intuitive interface for finding and browsing information. Documents and hyperlinks within it organize information nodes on the Internet into an interconnected network structure.
[0024] The header is a string of characters that the server sends before transmitting HTML data to the browser using the HTTP protocol.
[0025] Nginx (engine x) is a high-performance HTTP and reverse proxy web server that also provides IMAP / POP3 / SMTP services. Its source code is released under a BSD-like license and it is known for its stability, rich feature set, simple configuration files, and low system resource consumption. Nginx is a lightweight web server / reverse proxy server and email (IMAP / POP3) proxy server, released under a BSD-like license. Its characteristics include low memory consumption and high concurrency capabilities; in fact, Nginx's concurrency performance is better than other web servers of its type.
[0026] Specifically, refer to Figure 1 , Figure 1 This diagram illustrates the functional modules of the terminal device belonging to the end-to-end monitoring system of this application. The end-to-end monitoring system can be a device independent of the terminal device, capable of intercepting interface requests and binding header parameters. It can be implemented on the terminal device in hardware or software form. The terminal device can be a smart mobile terminal with data processing capabilities, such as a mobile phone or tablet, or a fixed terminal device or server with data processing capabilities.
[0027] In this embodiment, the terminal device of the end-to-end monitoring system includes at least an output module 110, a processor 120, a memory 130, and a communication module 140.
[0028] The memory 130 stores the operating system and the end-to-end monitoring program. The end-to-end monitoring system can generate interface requests; intercept interface requests through a toolkit, and obtain a toolkit by rewriting and encapsulating a preset interface set based on the preset header parameters bound to the interface requests; send interface requests to the backend for the backend to recognize the header parameters carried by the interface requests, and obtain the corresponding node data based on the header parameters; and receive node data, etc., all stored in the memory 130. The output module 110 can be a display screen, etc. The communication module 140 can include a WIFI module, a mobile communication module, and a Bluetooth module, etc., and communicates with external devices or servers through the communication module 140.
[0029] When the end-to-end monitoring program in memory 130 is executed by the processor, it performs the following steps: Generate an API request; When sending the interface request to the backend, the toolkit binds preset header parameters to the interface request, wherein the toolkit is obtained by rewriting and encapsulating a preset set of interfaces; The interface request is sent to the backend so that the backend can identify the header parameters carried in the interface request and obtain the corresponding node data based on the header parameters. Receive the node data.
[0030] Furthermore, when the end-to-end monitoring program in memory 130 is executed by the processor, it also performs the following steps: Obtain an interface set, the interface set including sending methods; Set the header parameters in the sending method to obtain the rewritten and encapsulated interface set; Import the rewritten and encapsulated interface set, generate the toolkit, and enable the corresponding link switch.
[0031] Furthermore, when the end-to-end monitoring program in memory 130 is executed by the processor, it also performs the following steps: The sending method is triggered by the interface request to bind the header parameters to the interface request.
[0032] Furthermore, when the end-to-end monitoring program in memory 130 is executed by the processor, it also performs the following steps: The node data is displayed through a pre-defined visual interface.
[0033] When the end-to-end monitoring program in memory 130 is executed by the processor, it also performs the following steps: Respond to the interface request from the front end to identify the header parameters carried in the interface request; Based on the header parameters, the corresponding node data is obtained; The node data is sent to the front end.
[0034] Furthermore, when the end-to-end monitoring program in memory 130 is executed by the processor, it also performs the following steps: Each node responds to the interface request from the front end and identifies the header parameters of the interface request based on a preset collection service.
[0035] Furthermore, when the end-to-end monitoring program in memory 130 is executed by the processor, it also performs the following steps: Determine whether the identity identifier is valid; If the identity identifier is valid, then the node data is generated based on the header parameters and processed asynchronously and non-blockingly.
[0036] This embodiment, through the above-described scheme, specifically generates an interface request; when sending the interface request to the backend, the toolkit binds preset header parameters to the interface request, wherein the toolkit is obtained by rewriting and encapsulating a preset interface set; the interface request is sent to the backend so that the backend can identify the header parameters carried in the interface request and obtain the corresponding node data based on the header parameters; the node data is then received. By intercepting the interface request and binding header parameters, the backend can generate node data based on the header parameters, which solves the problem of not being able to obtain specific information about each node through the link, thus improving the efficiency of fault diagnosis. Based on the scheme of this application, starting from the needs and challenges faced by the performance monitoring and analysis of each interface of the system, the monitoring of the entire link is completed, that is, the full-link monitoring from the user initiating the interface request to the completion of the interface request is realized, and faults can be quickly located through the node information of the link.
[0037] Based on, but not limited to, the terminal device architecture described above, this application proposes method embodiments.
[0038] Reference Figure 2 , Figure 2 This is a flowchart illustrating a first exemplary embodiment of the end-to-end monitoring method of this application. The end-to-end monitoring method is applied to a front-end, which interacts with a back-end. The front-end includes a toolkit, and the end-to-end monitoring method includes: Step S210: Generate an interface request; Specifically, due to the large-scale cloud migration and microservice architecture of current systems, the need for effective performance monitoring and analysis of various system interfaces is increasing. Therefore, this application provides a method for implementing end-to-end front-end monitoring. Users access services through the front-end, which generates corresponding interface requests based on the selected service. Header parameters are then bound to these requests, and the requests are sent to the back-end to obtain node data for each node, thereby monitoring each node in the entire chain. The front-end can be a webpage, an app, or other application used by users to initiate interface requests. In this embodiment, the use of native XMLHttpRequest is preferred.
[0039] Step S220: When sending the interface request to the backend, the toolkit is used to bind preset header parameters to the interface request, wherein the toolkit is obtained by rewriting and encapsulating a preset set of interfaces; Specifically, the toolkit is used to intercept API requests. The frontend accesses the rewritten and encapsulated toolkit, then enables full-link tracing configuration. The toolkit intercepts API requests sent by frontend users and automatically binds link information to the API requests. After generating information related to the first hop node in the full link, the information that needs to be passed down the entire link is added to the header (i.e., header parameters) of the user's API request. In this way, the backend identifies the header, allowing the service links of the downstream backend to be connected, generating node data corresponding to each node in the full link.
[0040] Furthermore, by binding header parameters to API requests, user information can be linked, allowing for the querying of specific details regarding user page access and API requests, and providing insight into the user's entire operation chain. This greatly aids in problem analysis and troubleshooting. By establishing a connection between the chain and users, the system can obtain API requests and types from each user through end-to-end data. Furthermore, it's possible to statistically analyze the system's core functional modules based on API access patterns, and to analyze user frequency to determine which features users prefer.
[0041] Step S230: Send the interface request to the backend so that the backend can identify the header parameters carried by the interface request and obtain the corresponding node data based on the header parameters; Specifically, by identifying the header at the backend, the service links of the downstream backend can be connected to generate node data corresponding to each node in the entire link, thus forming a complete link. In this embodiment, the first node in the entire link is the frontend, and all subsequent nodes are backends.
[0042] Step S240: Receive the node data.
[0043] Specifically, by receiving complete link node data from the backend at the front end, the specific situation of each node can be quickly determined, thereby solving the problem of low efficiency in interface troubleshooting and improving the efficiency of interface troubleshooting.
[0044] This embodiment, through the above-described scheme, specifically generates an interface request; when sending the interface request to the backend, the toolkit binds preset header parameters to the interface request, wherein the toolkit is obtained by rewriting and encapsulating a preset interface set; the interface request is sent to the backend so that the backend can identify the header parameters carried in the interface request and obtain the corresponding node data based on the header parameters; the node data is then received. By intercepting the interface request and binding header parameters, the backend can generate node data based on the header parameters, which solves the problem of not being able to obtain specific information about each node through the link, thus improving the efficiency of fault diagnosis.
[0045] Reference Figure 3, Figure 3 This is a flowchart illustrating a second exemplary embodiment of the end-to-end monitoring method of this application. Based on the above... Figure 2 In the embodiment shown, step S220, before binding preset header parameters to the interface request using the toolkit when sending the interface request to the backend, further includes: Step S310: Obtain an interface set, the interface set including sending methods; Specifically, the interface set is used for interaction between the front-end and the back-end. In this embodiment, XMLHttpRequest is preferred, but in other embodiments, other interface sets used for front-end and back-end interaction can also be used. By using XMLHttpRequest, data can be obtained by requesting a specific URL without refreshing the page, and it can be used to obtain data of any type.
[0046] Step S320: Set the header parameters in the sending method to obtain the rewritten and encapsulated interface set; Specifically, header parameters are used to standardize data and can be set via the SDK. By overriding the Send method in XMLHttpRequest, interface requests can be intercepted to set corresponding header parameters, allowing the interface request to retrieve node data for the corresponding node based on these parameters. The header parameters are set according to specific needs. For example, in this embodiment, header parameters include, but are not limited to: TraceID for link tracing, SpanID for associating nodes and obtaining the time taken to reach the current node from the previous node, and ParentSpanID for recording the time taken between each node and its neighboring nodes.
[0047] For example, when a user initiates an API request, a SpanID and traceID are automatically assigned to the request. Then, upon moving to the next node, the previous node's SpanID becomes the default ParentSpanID for that node, and a new SpanID is generated. This process continues, generating node data for each node.
[0048] refer to Figure 4 , Figure 4This is a flowchart illustrating the interface request interception process of the end-to-end monitoring method in this application. First, the `Send` method in `XMLHttpRequest` is overridden. Then, the user initiates an interface request through the front-end page, triggering the `Send` method. Next, the corresponding header information is bound to the user-initiated request instance. Finally, the interface request is received by the back-end to obtain the corresponding node data. Specifically, the native `XMLHttpRequest` is rewritten and encapsulated, that is, the `Send` method of `XMLHttpRequest` is rewritten to generate an SDK. When the application calls the interface to request the service, the `Send` method is invoked.
[0049] Step S330: Import the rewritten and encapsulated interface set, generate the toolkit, and enable the corresponding link switch.
[0050] Specifically, by integrating the SDK through the front end and enabling the full-link tracing switch, that is, by encapsulating XMLHttpRequest, the front end can be used as the first node in the entire link to form a complete tracing chain.
[0051] This embodiment, through the above-described scheme, specifically obtains an interface set, which includes a sending method; sets the header parameters in the sending method to obtain a rewritten and encapsulated interface set; imports the rewritten and encapsulated interface set to generate the toolkit, and enables the corresponding link switch. Rewriting and encapsulating the interface set allows binding the node data corresponding to each node when an interface request reaches the backend, thereby solving the problem of not being able to obtain specific information about each node through the link and improving the efficiency of troubleshooting.
[0052] Reference Figure 5 , Figure 5 This is a flowchart illustrating a third exemplary embodiment of the end-to-end monitoring method of this application. Based on the above... Figure 3 In the illustrated embodiment, step S220, when sending the interface request to the backend, involves binding preset header parameters to the interface request using the toolkit, including: Step S510: When sending the interface request to the backend, the sending method is triggered through the interface request to bind the header parameters to the interface request.
[0053] Specifically, when a page requests an API, the sending method in the rewritten and encapsulated API set can be triggered based on the API request. Preset header parameters can be bound to the API request, enabling the backend to receive the API request and obtain the corresponding node data. (Reference) Figure 6 , Figure 6This is a flowchart illustrating the front-end access process of the end-to-end monitoring method in this application. The front-end module rewrites and encapsulates the native XMLHttpRequest method to generate a toolkit (SDK). The SDK file is included before the user's application page loads, and the end-to-end switch of the SDK is configured to monitor request instances on each page. When a request instance is intercepted and needs to be sent to the back-end service, header data is added based on the intercepted interface request data. Thus, the data sent by the front-end interface request carries the node data of the starting node of the interface request.
[0054] When the backend receives an API request, it identifies the header parameters, allowing the downstream backend service chain to be connected. This establishes the connection between the chain and the user, enabling the acquisition of node data through the entire chain. For example, information about the user initiating the API request and the API being sent can be used to statistically analyze the system's core functional modules based on API access patterns. Furthermore, user preferences for functional modules can be analyzed based on usage frequency.
[0055] This embodiment, through the above scheme, specifically generates an interface request; when sending the interface request to the backend, the sending method is triggered by the interface request to bind the header parameters to the interface request; the interface request is sent to the backend so that the backend can identify the header parameters carried in the interface request and obtain the corresponding node data based on the header parameters; and the node data is received. When the frontend initiates an interface request and obtains the corresponding request interface, by rewriting the sending method in the interface set, the interface request is intercepted to bind the corresponding header parameters. Node data of each node in the entire link can be obtained by associating user information across the entire link to obtain data analysis metrics.
[0056] Reference Figure 7 , Figure 7 This is a flowchart illustrating a fourth exemplary embodiment of the end-to-end monitoring method of this application. Based on the above... Figure 2 In the illustrated embodiment, after receiving the node data in step S240, the method further includes: Step S710: Display the node data through a preset visualization interface.
[0057] Specifically, by displaying information about each node in the link through a visual page, we can see the time consumption of each node in the entire link. Performance analysis of each node can be performed based on its time consumption, thus improving the individual performance of each node in the entire link. Through the associated user information, we can query the specific details of a user's page access and API requests, and understand the user's entire operation chain, which is very helpful for analyzing and troubleshooting problems.
[0058] refer to Figure 8 , Figure 8 This is a full-link visualization diagram of the full-link monitoring method of this application. The first node, the PC application, is the front end, and all subsequent nodes are back end. The front end takes 4279 milliseconds to complete the interface call, which is the time actually perceived by the user. However, the back end service only takes 10 milliseconds to complete the entire function. That is, most of the time is spent on network latency from the front end to the back end or on the front end's Nginx service. It should be noted that if only the back end link is analyzed, the specific reason for the slow interface request cannot be found.
[0059] Simultaneously, by leveraging the node data bound throughout the entire chain, associated user data can be queried, and the entire chain information can be viewed from the user's perspective. (Reference) Figure 9 , Figure 9 This diagram illustrates the end-to-end data query from the user's perspective using the end-to-end monitoring method described in this application. By linking user information, the specific details of a user's page access requests to APIs can be queried, providing insight into the user's entire operation chain, which greatly aids in problem analysis and troubleshooting.
[0060] This embodiment, through the above-described scheme, specifically involves generating an interface request; when sending the interface request to the backend, binding preset header parameters to the interface request using a toolkit, wherein the toolkit is obtained by rewriting and encapsulating a preset interface set; sending the interface request to the backend so that the backend can identify the header parameters carried in the interface request and obtain the corresponding node data based on the header parameters; receiving the node data; and displaying the node data through a preset visualization interface. Displaying node data through the preset visualization interface allows for an overview of the interface requests of each node in the complete link, thereby enabling performance optimization for one or more nodes.
[0061] Reference Figure 10 , Figure 10 This is a flowchart illustrating a fifth exemplary embodiment of the end-to-end monitoring method of this application. The end-to-end monitoring method is applied to the backend, which interacts with the frontend. The end-to-end monitoring method includes the following steps: Step S1010: Respond to the interface request from the front end to identify the header parameters carried in the interface request; Specifically, by intercepting user-initiated interface requests on the front end and binding header data, the back end can identify the header data when responding to interface requests and generate the corresponding node data for each node in the back end.
[0062] Step S1020: Obtain the corresponding node data based on the header parameters; Specifically, the frontend sends the interface request to the backend, and each node in the backend uploads its corresponding node data to the server. The server then stores the node information on its own server. Thus, after the entire link is reported, a complete link can be formed. In this embodiment, the PC of the first node in the entire link acts as the frontend, and all subsequent nodes act as backends.
[0063] Step S1030: Send the node data to the front end.
[0064] Specifically, the backend sends node data to the frontend, thus realizing end-to-end monitoring from the user initiating an interface request to the completion of the interface request. Then, by integrating the frontend toolkit and enabling the end-to-end tracing switch, the frontend can be used as the first node in the entire link to form a complete tracing chain. Faults can be quickly located through the node information of the link.
[0065] This embodiment, through the above-described scheme, specifically responds to the interface request from the front end to identify the header parameters carried in the interface request; obtains the corresponding node data based on the header parameters; and sends the node data to the front end. In other words, by receiving the interface request from the back end and identifying the header parameters to obtain the corresponding node data, the problem of not being able to obtain specific information about each node through the link can be solved, improving the efficiency of fault diagnosis.
[0066] Reference Figure 11 , Figure 11 This is a flowchart illustrating a sixth exemplary embodiment of the end-to-end monitoring method of this application. Based on the above... Figure 10 In the illustrated embodiment, the backend includes at least one node. Step S1010 involves responding to the interface request from the frontend to identify the header parameters carried in the interface request, including: Step S1110: Each node responds to the interface request of the front end and identifies the header parameters of the interface request based on the preset collection service.
[0067] Specifically, the data collection service is used to identify the header parameters of the interface request. In this embodiment, Spring WebFlux is preferred, but other header parameters for identifying interface requests can also be used in other embodiments. That is, when the backend receives the interface request, it identifies the header parameters carried in the interface request, so that the service chain of the downstream backend can be connected. In this way, the connection between the chain and the user is established, and node data can be obtained through the data of the entire chain, such as the information of the user who initiated the interface request and the interface sent. Thus, the core functional modules of the system can be statistically identified based on the access status of the interface, and the user's preference for functional modules can also be analyzed and statistically analyzed based on the user's usage frequency.
[0068] This embodiment, through the above-described scheme, specifically involves each node responding to the interface request from the front end and identifying the header parameters of the interface request based on a preset data collection service; obtaining the corresponding node data according to the header parameters; and sending the node data to the front end. By identifying header parameters through the data collection service to generate the corresponding node data, runtime resources can be saved and time costs reduced.
[0069] Reference Figure 12 , Figure 12 This is a flowchart illustrating a seventh exemplary embodiment of the end-to-end monitoring method of this application. Based on the above... Figure 8 In the illustrated embodiment, the header parameters include an identity identifier. Step S620 involves obtaining the corresponding node data based on the header parameters, including: Step S1210: Determine whether the identity identifier is valid; Specifically, the header parameters include an identity identifier. It should be noted that different interface requests have corresponding identity identifiers. The backend determines whether the identity identifier is valid and can generate the corresponding node data accordingly.
[0070] Step S1220: If the identity identifier is valid, then generate the node data according to the header parameters and perform asynchronous non-blocking processing.
[0071] Specifically, if the identity is valid, the corresponding node generates node data according to the header parameters and performs asynchronous non-blocking processing. In this embodiment, the data can be asynchronously pushed to Kafka and synchronized to Elasticsearch / HBase, thus saving the node data and providing data support for visualization.
[0072] Additionally, if the identity is invalid, the interface request is discarded. If an asynchronous push encounters a problem, an alarm is triggered, with alarm conditions set according to the actual situation. In this embodiment, since Flink is a relatively good solution for handling real-time data comparison, Flink alarms are preferred, and alarm policies are set according to actual needs. For example, if the interface request takes more than ten minutes to reach the node, a timeout notification is issued.
[0073] Reference Figure 13 , Figure 13 This is a flowchart illustrating the backend data processing of the end-to-end monitoring method in this application. First, the frontend sends end-to-end data to the backend, which then retrieves the data using the Spring WebFlux collection service. Next, the backend checks the validity of the key (i.e., the identifier) in the end-to-end data. If the key is valid, it is asynchronously pushed to Kafka and synchronized to Elasticsearch / HBase. If the asynchronous push fails, a Flink alert is triggered. If the key is invalid, the end-to-end data is discarded. The end-to-end data can be batch data or a single data entry.
[0074] This embodiment, through the above-described scheme, specifically determines whether the identity identifier is valid. If the identity identifier is valid, the node data is generated based on the header parameters and processed asynchronously and non-blockingly. By determining the validity of the identity identifier, the security and confidentiality of end-to-end monitoring can be improved. Through asynchronous and non-blocking front-end data acquisition services, end-to-end monitoring can be completed, node data can be saved, data support can be provided for visualization, and data analysis indicators can be provided.
[0075] Reference Figure 14 , Figure 14 This is a flowchart illustrating the eighth exemplary embodiment of the end-to-end monitoring method of this application. Figure 14 The diagram shows the full-link monitoring system, which includes the user browser, business system backend service, Beidou data storage, Beidou platform, Jianwei SDK, Jianwei server, Jianwei data storage, and Jianwei platform.
[0076] Specifically, by importing the Jianwei SDK into the user's browser, when the user initiates an interface request in the browser, the Jianwei SDK intercepts the request, attaches trace information, assembles the current node information, and reports it to the business system's backend service. This information is then reported to the Jianwei server via Webflux. The business system's backend service then stores the data in BeiDou data via the ZA21 framework, stores it in Jianwei data via the Jianwei backend SDK, and the Jianwei server stores it in Jianwei data via Kafka. Thus, data can be synchronized through BeiDou data storage and Jianwei data storage. Finally, the user can obtain the data through the BeiDou platform and / or the Jianwei platform. This embodiment, through the above scheme, obtains node data across the entire link by associating users throughout the entire process, enabling rapid fault location and the acquisition of data analysis indicators.
[0077] Furthermore, this application also proposes a full-link monitoring system, which includes: The front end is used to generate interface requests. When sending the interface request to the back end, the front end uses the toolkit to bind preset header parameters to the interface request. The toolkit is obtained by rewriting and encapsulating a preset set of interfaces. The front end sends the interface request to the back end so that the back end can identify the header parameters carried by the interface request, obtain the corresponding node data according to the header parameters, and receive the node data. The backend is used to respond to the interface request of the frontend, identify the header parameters carried by the interface request, obtain the corresponding node data according to the header parameters, and send the node data to the frontend.
[0078] The principle and implementation process of full-link monitoring in this embodiment are explained in the above embodiments and will not be repeated here.
[0079] Furthermore, this application also proposes a terminal device, which includes a memory, a processor, and a full-link monitoring program stored in the memory and executable on the processor. When the full-link monitoring program is executed by the processor, it implements the steps of the full-link monitoring method described above.
[0080] Since this end-to-end monitoring program employs all the technical solutions of all the aforementioned embodiments when executed by the processor, it possesses at least all the beneficial effects brought about by all the technical solutions of all the aforementioned embodiments, which will not be elaborated upon here.
[0081] Furthermore, embodiments of this application also propose a computer-readable storage medium storing a full-link monitoring program, which, when executed by a processor, implements the steps of the full-link monitoring method as described above.
[0082] Since this end-to-end monitoring program employs all the technical solutions of all the aforementioned embodiments when executed by the processor, it possesses at least all the beneficial effects brought about by all the technical solutions of all the aforementioned embodiments, which will not be elaborated upon here.
[0083] Compared to existing technologies, the end-to-end monitoring method, system, terminal device, and storage medium proposed in this application generate interface requests. When sending the interface request to the backend, a toolkit is used to bind preset header parameters to the interface request. The toolkit is obtained by rewriting and encapsulating a preset set of interfaces. The interface request is then sent to the backend so that the backend can identify the header parameters carried in the interface request and obtain the corresponding node data based on the header parameters. Finally, the node data is received. By intercepting interface requests and binding header parameters, the backend generates node data based on the header parameters, solving the problem of not being able to obtain specific information about each node through the link and improving the efficiency of fault diagnosis. Based on the solution of this application, starting from the patterns of needs and challenges faced by the performance monitoring and analysis of each interface in the system, the monitoring of the entire link is completed. That is, end-to-end monitoring from the user initiating an interface request to the completion of the interface request is achieved, and faults can be quickly located through the node information of the link.
[0084] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0085] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0086] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, controlled terminal, or network device, etc.) to execute the methods of each embodiment of this application.
[0087] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A full-link monitoring method, characterized in that, The end-to-end monitoring method is applied to the front end, which interacts with the back end. The front end includes a toolkit, and the end-to-end monitoring method includes the following steps: Generate an API request; Obtain an interface set, the interface set including a sending method, the interface set being XMLHttpRequest, the XMLHttpRequest requesting a specified URL and obtaining data of any type without refreshing the page; By setting the header parameters in the sending method, the rewritten and encapsulated interface set is obtained, including: The sending method in the XMLHttpRequest is rewritten to intercept interface requests. When a user initiates an interface request and triggers the sending method, header parameters are set for the interface request and added to the request header. These header parameters include TraceID, SpanID, and ParentSpanID. TraceID is used for link tracing, SpanID is used to associate nodes and obtain the time taken from the previous node to the current node, and ParentSpanID is used to record the time taken between each node and its neighboring nodes. When a new interface request is initiated, SpanID and traceID are set for the new request. Downstream nodes use the upstream SpanID as their own ParentSpan and generate a new SpanID, thereby generating node data corresponding to each node. Import the rewritten and encapsulated interface set, generate the toolkit, and import the corresponding SDK before the front-end page is fully loaded to enable the corresponding link switch; When sending the interface request to the backend, the toolkit binds preset header parameters to the interface request. The toolkit is obtained by rewriting and encapsulating a preset set of interfaces, including: The toolkit intercepts the interface requests sent by the front-end user, binds link information to the interface request, and after generating the information related to the first hop node of the entire link, adds the information passed down the entire link to the header parameters of the user request interface. The interface request is sent to the backend so that the backend can identify the header parameters carried in the interface request and obtain the corresponding node data based on the header parameters. Receive the node data; The node data is displayed through a preset visual interface. The node data includes the complete link time information from the front end initiating an interface request to the back end completing the processing, as well as the processing time information of each service node in the back end. The node data is bound to user identity information to support querying and displaying the user's complete operation link from the user's perspective. The step of binding preset header parameters to the interface request using the toolkit includes: The sending method is triggered by the interface request to bind the header parameters to the interface request.
2. A full-link monitoring method, characterized in that, The end-to-end monitoring method is applied to the backend, which interacts with the frontend. The end-to-end monitoring method includes the following steps: Responding to the interface request from the front end, the header parameters carried by the interface request are identified. The interface request is generated by rewriting the sending method in XMLHttpRequest using a front end toolkit. The toolkit intercepts the interface request initiated by the user, binds the link information and generates the first hop node information of the entire link, and writes the link transmission information into the header parameters of the interface. The header parameters include TraceID, SpanID, and ParentSpanID. TraceID is used for link tracing, SpanID is used to associate nodes and obtain the time taken from the previous node to the current node, and ParentSpanID is used to record the time taken between each node and its neighboring nodes. When a new interface is initiated, TraceID and SpanID are configured. Downstream nodes use the upstream SpanID as their own ParentSpan and generate a new SpanID, thereby generating the node data corresponding to each node. Based on the header parameters, the corresponding node data is obtained; The node data is sent to the front end so that the front end can display the node data through a preset visualization interface. The node data includes the complete link time information from the front end initiating the interface request to the back end completing the processing, as well as the processing time information of each service node in the back end. The node data is bound to user identity information to support querying and displaying the user's complete operation link from the user's perspective.
3. The end-to-end monitoring method as described in claim 2, characterized in that, The backend includes at least one node, and the step of responding to the frontend's interface request to identify the header parameters carried in the interface request includes: Each node responds to the interface request from the front end and identifies the header parameters of the interface request based on a preset collection service.
4. The end-to-end monitoring method as described in claim 3, characterized in that, The header parameters include an identity identifier, and the step of obtaining the corresponding node data based on the header parameters includes: Determine whether the identity identifier is valid; If the identity identifier is valid, then the node data is generated based on the header parameters and processed asynchronously and non-blockingly.
5. A full-link monitoring system, characterized in that, The end-to-end monitoring system includes a front-end and a back-end; The front end is used to generate interface requests and obtain an interface set, the interface set including a sending method, and the interface set is XMLHttpRequest; Setting header parameters in the sending method to obtain the rewritten and encapsulated interface set includes: rewriting the sending method in the XMLHttpRequest to intercept interface requests through the sending method, and setting header parameters for the interface request when the user initiates an interface request and triggers the sending method, adding the header parameters to the request header of the interface request; wherein, the header parameters include TraceID, SpanID, and ParentSpanID, the TraceID is used for link tracing, the SpanID is used to associate nodes and obtain the time taken from the previous node to the current node, and the ParentSpanID is used to record the time taken between each node and its adjacent nodes; importing the rewritten and encapsulated interface... The system generates a toolkit from the interface set and activates the corresponding link switch. When sending the interface request to the backend, the toolkit binds preset header parameters to the interface request. The toolkit is obtained by rewriting and encapsulating the preset interface set. The interface request is sent to the backend so that the backend can identify the header parameters carried in the interface request and obtain the corresponding node data based on the header parameters. The system then receives the node data and displays it through a preset visualization interface. The node data includes the complete link time information from the frontend initiating the interface request to the backend completing the processing, as well as the processing time information of each service node in the backend. The node data is bound to user identity information to support querying and displaying the user's complete operation link from the user's perspective. The backend is used to respond to the interface requests from the frontend to identify the header parameters carried in the interface requests. The interface requests are generated by rewriting the sending method in XMLHttpRequest using a frontend toolkit and binding header parameters when the user initiates the request. These header parameters include TraceID, SpanID, and ParentSpanID. TraceID is used for link tracing; SpanID is used to associate nodes and obtain the time taken from the previous node to the current node; and ParentSpanID is used to record the time taken between each node and its adjacent nodes. Based on the header parameters, corresponding node data is obtained and sent to the frontend so that the frontend can display the node data through a preset visualization interface. The node data includes complete link time information from the frontend initiating the interface request to the backend completing the processing, as well as the processing time information of each service node in the backend. The node data is bound to user identity information to support querying and displaying the user's complete operation link from the user's perspective.
6. A terminal device, characterized in that, The terminal device includes a memory, a processor, and a full-link monitoring program stored in the memory and executable on the processor. When the full-link monitoring program is executed by the processor, it implements the steps of the full-link monitoring method as described in any one of claims 1-4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a full-link monitoring program, which, when executed by a processor, implements the steps of the full-link monitoring method as described in any one of claims 1-4.
Citation Information
Patent Citations
Monitoring method and device, computer device and storage medium
CN109873717A
