A non-invasive monitoring method and system for Web applications

By adding a Web application gateway to the front end of the web application, it realizes intrusion-free monitoring, connects the logs of the browser and server, and forms a complete monitoring chain, solving the problem of fragmentation of information and insufficient monitoring data in the traditional monitoring system, realizing full-link and all-round monitoring, avoiding the risks brought about by code modification.

CN119383100BActive Publication Date: 2025-03-18BEIJING RONG CLOUD NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411967203.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-03-18
Estimated Expiration
2044-12-30

AI Technical Summary

Technical Problem

Traditional web application monitoring systems cannot effectively connect data from the browser and server side, resulting in fragmentation of information and hindering the positioning and resolution of network problems. At the same time, the monitoring data is not comprehensive enough, multiple monitoring services are required, and the integrated monitoring system requires code modification, which increases workload and risks.

Method used

By adding a web application gateway to the front end of the web application, it realizes intrusion-free monitoring, generates a unique identifier for http requests, puts it in the X-Request-Id request header, connects the browser and server logs to form a complete monitoring chain, and executes JavaScript monitoring scripts on the browser side, calls the browser API interface to monitor network data, and realizes full-link and all-round monitoring.

Benefits of technology

It realizes the connection between the browser and server logs, forming a complete monitoring chain, cross-end tracking and problem positioning are more effective, avoiding the potential risks introduced by monitoring, and without the need to modify the Web application code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119383100B_ABST
    Figure CN119383100B_ABST
Patent Text Reader

Abstract

The present invention discloses a non-invasive monitoring method and system for Web applications, and relates to the technical field of network data monitoring. The method comprises: a Web application gateway obtains an http request and an http response, generates a unique identifier of the http request and the http response, puts the unique identifier into an X-Request-Id request header and a response header, and injects a JavaScript script into the head tag of an HTML page; a browser renders a web page and executes a JavaScript script according to the received http response, and reports the monitored network data to the Web application gateway, and the Web application gateway records the monitored network data in the form of a log, and performs multi-dimensional statistical calculations and alarm analysis. The present invention realizes completely non-invasive monitoring of business codes, thereby ensuring the security and stability of Web applications during the monitoring process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of network data monitoring, and in particular to a non-intrusive monitoring method and system for Web applications. Background Art

[0002] With the development of Internet technology, Web application monitoring systems play an increasingly important role in ensuring service security and improving service quality. Traditional Web application monitoring systems have the following defects:

[0003] (1) Although there is a way to tell the browser server the unique identifier of the entire request by adding X-Request-Id to the response header, it is not realistic to ask customers to provide X-Request-Id when reporting problems. Customers do not know how to obtain X-Request-Id, resulting in X-Request-Id being useful but not being able to play its due value.

[0004] (2) It is impossible to connect the monitoring data on the browser side with the data on the server side, resulting in only fragmented information being obtained, which hinders the location and resolution of network problems.

[0005] (3) Monitoring data is not comprehensive enough, often requiring multiple sets of different monitoring services, and the data between multiple sets of monitoring services cannot be effectively combined and processed;

[0006] (4) Integrating a monitoring system generally requires modifying the code. If you want to achieve comprehensive monitoring, you need to integrate several sets of services, which results in a large workload and risks.

[0007] Therefore, it is necessary to develop an efficient, intelligent, comprehensive, coherent and non-invasive website monitoring system to achieve comprehensive monitoring and management of website traffic, network behavior, website content, server operation status, browser operation status, browser network information, browser code execution status, browser to server request link, etc. Summary of the invention

[0008] In view of the above defects or deficiencies in the prior art, the present invention provides a non-invasive monitoring method and system for Web applications. By connecting the information of the server and the browser client in series, a complete link monitoring system is constructed. The system not only covers various information and performance of the Web application operation, but also realizes completely non-invasive monitoring of the business code, thereby ensuring the security and stability of the Web application during the monitoring process and avoiding potential risks introduced by monitoring.

[0009] In one aspect of the present invention, a non-invasive monitoring method for Web applications is provided, comprising: a browser sends an http request to a Web application server via a Web application gateway; the Web application gateway obtains the http request, generates a unique identifier of the http request, puts the unique identifier into an X-Request-Id request header, and forwards the processed http request to the Web application server; the Web application server processes the http request and returns an http response via the Web application gateway; the Web application gateway puts the unique identifier into the X-Request-Id response header of the http response returned by the Web application server, and checks whether the http response contains html content, and if so, injects a JavaScript monitoring script into the head tag of the html page, sends the processed http response to the browser, and forwards the http request to the browser, and forwards the processed http request to the browser, and forwards the processed http request to the browser. The contents of the request and the http response are recorded as logs; the browser renders the web page and executes the JavaScript monitoring script according to the received http response, calls the browser's API interface to monitor the browser's network data, and if there is an immediate reporting instruction in the http response, the monitored network data is immediately reported to the Web application gateway, otherwise it is added to the reporting list, and when the length of the reporting list reaches or exceeds the upper limit or the time from the last report reaches or exceeds the preset value, a reporting request is initiated to the Web application gateway; after receiving the reporting request, the Web application gateway records the monitored network data in the form of a log, and performs multi-dimensional statistical calculations on the log data through the data processing and alarm module, and determines whether the alarm condition is met according to the alarm threshold of each statistical dimension. If the alarm condition is met, it is determined whether to execute the alarm based on the alarm frequency limit and / or the number of consecutive conditions reached.

[0010] In another aspect of the present invention, a non-invasive monitoring system for Web applications is provided, comprising: a browser end, for sending an http request to a Web application server via a Web application gateway; rendering a web page and executing the JavaScript monitoring script according to the received http response, calling the browser's API interface to monitor the browser's network data, and if there is an immediate report instruction in the http response, the monitored network data is immediately reported to the Web application gateway, otherwise it is added to a report list, and when the length of the report list reaches or exceeds an upper limit or the time from the last report reaches or exceeds a preset value, a report request is initiated to the Web application gateway; the Web application gateway is used to obtain the http request sent by the browser end, generate a unique identifier of the http request, put the unique identifier into the X-Request-Id request header, and convert the processed http request into Send to the Web application server; put the unique identifier in the X-Request-Id response header of the http response returned by the Web application server, and check whether the http response contains html content. If so, inject a JavaScript monitoring script into the head tag of the html page, send the processed http response to the browser, and record the content of the http request and the http response as a log; after receiving the report request from the browser, record the monitored network data in the form of a log, and perform multi-dimensional statistical calculations on the log data through the data processing and alarm module, and judge whether the alarm condition is met according to the alarm threshold of each statistical dimension. If the alarm condition is met, decide whether to execute the alarm according to the alarm frequency limit and / or the number of consecutive conditions reached; the Web application server is used to process the http request and return the http response via the Web application gateway.

[0011] The present invention provides a non-invasive monitoring method and system for Web applications, which has the following beneficial effects:

[0012] (1) By adding a unique request identifier to the request header and response header of the HTTP request, the browser events are associated with the server logs to form a complete monitoring chain, realize cross-end tracking and problem location;

[0013] (2) The unique device ID generated by device registration can tell which browser the request in the web server log was sent from, and can associate the request with the data reported by the browser;

[0014] (3) Ability to obtain detailed network data for each request from the browser, calculate network status from various dimensions based on the browser's network information, and issue alarm prompts;

[0015] (4) Monitor all requests through the proxy service thread and obtain the availability of third-party requests in real time. By monitoring which third-party domain names and URLs the requests are sent to, the security of the browser can be detected.

[0016] (5) By adding a web application gateway to the original web application front end, the web application can achieve full-link, all-round monitoring without making any code changes, testing operations, or publishing operations (i.e., non-invasive), eliminating any risks caused by modifying the web application code.

[0017] (6) The JavaScript monitoring script in the browser runs in the proxy service thread and does not occupy the main thread; the Web application gateway relies on the original request log to process business requests, which does not add any burden to the gateway; the gateway accepts browser reports and stores them directly in the form of logs, with minimal performance consumption; the Web application server relies on the original logs and does not add any burden to the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0019] Figure 1 It is a logical structure diagram of a non-intrusive monitoring system for Web applications provided by an embodiment of the present application;

[0020] Figure 2 is a flow chart of a non-invasive monitoring method for a Web application provided by an embodiment of the present application;

[0021] Figure 3 This is a schematic diagram of the logical processing flow of a Web application gateway provided by an embodiment of the present application;

[0022] Figure 4 It is a flowchart of browser monitoring and reporting provided by an embodiment of the present application. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0024] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention are also intended to include plural forms, unless the context clearly indicates other meanings.

[0025] It should be understood that although the terms first, second, third, etc. may be used to describe the acquisition modules in the embodiments of the present invention, the acquisition modules should not be limited to these terms. These terms are only used to distinguish the acquisition modules from each other.

[0026] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.

[0027] It should be noted that the directional words such as "upper", "lower", "left", and "right" described in the embodiments of the present invention are described at the angles shown in the drawings and should not be understood as limiting the embodiments of the present invention. In addition, in the context, it should also be understood that when it is mentioned that an element is formed "on" or "under" another element, it can not only be formed directly "on" or "under" another element, but also be formed "on" or "under" another element indirectly through an intermediate element.

[0028] This application provides a non-intrusive monitoring method and system for Web applications, which can achieve complete code-free intrusion, comprehensive monitoring capabilities, and connect browser and server logs in series to form a complete monitoring chain. This application is applicable to various types of Web applications, such as: various websites, online service platforms, e-commerce websites, social entertainment websites, online education websites, etc., through all-round and full-link monitoring to ensure the stability and security of services and improve user experience.

[0029] See also Figure 1 An embodiment of the present application provides a non-intrusive monitoring system 100 for Web applications, including a browser 101 , a Web application gateway 102 , and a Web application server 103 .

[0030] The browser 101 is used to send an http request to the web application server 103 via the web application gateway 102; according to the received http response, the web page is rendered and the JavaScript monitoring script is executed, and the browser's API interface is called to monitor the browser's network data. If there is an immediate report instruction in the http response, the monitored network data is immediately reported to the web application gateway, otherwise it is added to the report list. When the length of the report list reaches the upper limit or the time from the last report reaches or exceeds the preset value, a report request is initiated to the web application gateway;

[0031] The Web application gateway 102 is used to obtain the http request sent by the browser, generate a unique identifier for the http request, put the unique identifier into the X-Request-Id request header, and forward the processed http request to the Web application server 103; put the unique identifier into the X-Request-Id response header of the http response returned by the Web application server 103, and check whether the http response contains html content. If so, inject a JavaScript monitoring script into the head tag of the html page, send the processed http response to the browser, and record the contents of the http request and the http response as a log; after receiving the report request from the browser, record the monitored network data in the form of a log, and perform multi-dimensional statistical calculations on the log data through the data processing and alarm module, and judge whether the alarm condition is met according to the alarm threshold of each statistical dimension. If the alarm condition is met, decide whether to execute the alarm according to the alarm frequency limit and / or the number of consecutive conditions reached;

[0032] The Web application server 103 is used to process http requests and return http responses through the Web application gateway.

[0033] This embodiment adds a Web application gateway to the original Web application front end, so that the Web application can achieve full-link and all-round monitoring without any code changes, eliminating any risks caused by modifying the Web application code. In addition, by adding a unique request identifier to the request header of the http request, the browser event is associated with the server log to form a complete monitoring chain, achieving cross-end tracking and problem location.

[0034] Furthermore, the Web application gateway 102 is also used to push http request logs, http response logs and browser monitoring data to the stream data processing platform. The stream data processing platform is used to clean the data pushed by the Web application gateway into a predetermined data format, save the cleaned data to a dedicated data storage platform, and return it to the Web application gateway 102.

[0035] Furthermore, the browser end 101 is also used to check whether the browser has completed device registration in the Web application gateway through a JavaScript monitoring script. If the browser has not completed device registration in the Web application gateway, the browser's API interface is called to obtain browser information and network connection information, and the browser information and network connection information are sent to the Web application gateway to request browser registration; the device ID generated by the Web application gateway is stored in the browser's Cookie; the Web application gateway 102 is also used to receive a device registration request from the browser, generate a device ID, and send the device ID to the browser end 101. This embodiment can know which requests in the server log come from which browser through the browser's device registration, thereby forming an association with the data reported by the corresponding browser, and the browser device ID is used as a unique identifier to associate data of different Web applications, so that various monitoring data can be shared.

[0036] Furthermore, the browser end 101 is also used to register a proxy service thread with a scope of the website root directory through a JavaScript monitoring script, monitor the http response through the proxy service thread, and determine whether there is an immediate report instruction in the response header of the http response. Among them, the proxy service thread is an independent thread different from the main thread, and acts as a proxy server between the browser and the network in this embodiment. The JavaScript monitoring script mainly runs in the proxy service thread and does not occupy the main thread, so it will not affect the system performance.

[0037] Furthermore, the browser end 101 is also used to: obtain network data that needs to be reported immediately from the browser's API interface through a proxy service thread and send it to the browser main thread, and send the data that needs to be reported immediately to the Web application gateway 102 through the browser main thread.

[0038] Another embodiment of the present application further provides a non-invasive monitoring method for a Web application. The non-invasive monitoring system 100 for a Web application can be clearly understood through the execution process of the method.

[0039] See also Figure 2 ,The non-intrusive monitoring method for Web applications includes the following steps:

[0040] Step S101: The browser sends an http request to the Web application server via the Web application gateway.

[0041] Specifically, by adding a Web application gateway to the original Web application front end, the Web application can achieve full-link, all-round monitoring without making any code changes, testing operations, and publishing operations (i.e., non-invasive), eliminating any risks caused by modifying the Web application code.

[0042] Step S102, the Web application gateway obtains the http request, generates a unique identifier for the http request, puts the unique identifier into the X-Request-Id request header, and forwards the processed http request to the Web application server.

[0043] See also Figure 3 , the http request reaches the Web application gateway after being accelerated by the outer CDN (or not accelerated by the CDN). The Web application gateway reads the information in the http request header and preferably performs a series of tests. For example, first check whether the browser has completed device registration. If not, add the instruction to complete device registration in the response header of the http response, such as setting the value of the key Cookie_device_registry to 0. If the browser has completed device registration, check whether the http request is a key business request. If it is, directly add an immediate report instruction in the corresponding http response header, such as setting the value of the response header REPORT_METHOD to now. After the detection is completed, the Web application gateway generates a unique identifier for the http request and puts it into the X-Request-Id request header, forwards the processed http request to the Web application server, and the Web application server handles the specific business. This step associates the browser event with the server log by adding the request unique identifier to the request header X-Request-Id of the http request, forming a complete monitoring chain, realizing cross-end tracking and problem location.

[0044] Step S103: The Web application server processes the http request and returns an http response via the Web application gateway.

[0045] Step S104, the Web application gateway puts the unique identifier in the X-Request-Id response header of the http response returned by the Web application server, and checks whether the http response contains html content. If so, a JavaScript monitoring script is injected into the head tag of the html page, the processed http response is sent to the browser, and the content of the http request and http response is recorded as a log.

[0046] Specifically, after the processing of the Web application (i.e., Web application program, located on the Web application server) is completed, it is handed over to the Web application gateway to handle subsequent tasks. The Web application gateway puts the unique identifier into the X-Request-Id response header and checks whether the http response of the Web application is html content. If it is, the JavaScript code is injected into the head tag of the html page, and then the processed http response is sent to the browser. The Web application gateway records the detailed information of the request and response in the form of a log. This step associates the browser event with the server log by adding the unique identifier of the request to the response header X-Request-Id of the http response, forming a complete monitoring chain, realizing cross-end tracking and problem location. At the same time, by injecting JavaScript script code into the page, preparations are made for monitoring the browser's network data.

[0047] Step S105, the browser renders the web page and executes the JavaScript monitoring script according to the received http response, calls the browser's API interface to monitor the browser's network data, and if there is an immediate report instruction in the http response, the monitored network data is immediately reported to the Web application gateway, otherwise it is added to the reporting list, and when the length of the reporting list reaches or exceeds the upper limit or the time from the last report reaches or exceeds the preset value, a reporting request is initiated to the Web application gateway.

[0048] See also Figure 4, the browser starts to render the page after receiving the http response, and the injected JavaScript monitoring script starts working at the same time. First, the JavaScript monitoring script checks whether the browser has completed device registration in the Web application gateway. For example, it can check whether the value of Cookie_device_registry is 0. If it is, it means that the browser registration is not completed. If the browser has not completed device registration in the Web application gateway, it calls the Navigator API to obtain browser information, calls the Network Information API to obtain the browser's network information, and sends the browser information and network information to the Web application gateway to request the browser registration. After receiving the registration request, the Web application gateway sets the value of Cookie_device_registry to 1, generates a device ID and sends the device ID to the browser. The browser stores the device ID generated by the Web application gateway in the browser's Cookie. In this step, through the browser's device registration, it can know which requests in the server log come from which browser, thereby forming an association with the data reported by the corresponding browser, and uses the browser device ID as a unique identifier to associate the data of different Web applications, so that various monitoring data can be shared.

[0049] After the browser is registered, the browser's API interface is called to monitor the browser's network data, for example: calling the Performance API, Navigation Timing API, Resource Timing API and other browser APIs to complete various tests on website performance. After the processing is completed, the key time nodes such as the page start loading time, the page DOM parsing completion time, the page resource loading completion time, the number of page redirections, the DNS parsing time, the TCP connection time and other network-related data are reported to the Web application gateway.

[0050] When the network monitoring data is reported, if there is an immediate report instruction in the http response, the monitored network data will be immediately reported to the Web application gateway, otherwise it will be added to the report list. When the length of the report list reaches or exceeds the upper limit or the time from the last report reaches or exceeds the preset value, a report request will be initiated to the Web application gateway. Preferably, a proxy service thread with a scope of the root directory of the website is registered in the browser through a JavaScript monitoring script, such as Service Worker, and the http response is monitored through the proxy service thread, and it is determined whether there is an immediate report instruction in the response header of the http response. If the value of the response header REPORT-METHOD is now, it indicates that there is an immediate report instruction. The proxy service thread obtains the network data that needs to be reported immediately through the browser's API interface and sends it to the browser main thread. The browser main thread sends the data that needs to be reported immediately to the Web application gateway. If there is no immediate report instruction, the network monitoring data is added to the report list. When the length of the report list reaches or exceeds the upper limit or the time from the last report reaches or exceeds the preset value, a report request will be initiated to the Web application gateway. This step monitors http requests through the proxy service thread, and can obtain the availability of third-party requests in real time. By monitoring which third-party domain names and URLs the requests are sent to, the security of the browser can be detected. At the same time, the JavaScript monitoring script in the browser runs in the proxy service thread, which does not occupy the main thread, reducing the burden on the system.

[0051] Step S106: After receiving the reporting request, the Web application gateway records the monitored network data in the form of a log, and performs multi-dimensional statistical calculations on the log data through the data processing and alarm module, and determines whether the alarm condition is met according to the alarm threshold of each statistical dimension. If the alarm condition is met, it is determined whether to execute the alarm based on the alarm frequency limit and / or the number of consecutive times the condition is met.

[0052] Specifically, the Web application gateway stores the reported network monitoring data in the form of logs, generates X-Request-Id and upload_log (value is 1) and puts them into the response header, and sets the http status code to 200. Then, the Web application gateway pushes the http request log, http response log and browser monitoring data to the stream data processing platform Kafka through tools such as Filebeat. The stream data processing platform Kafka cleans the data into a predetermined data format, saves the cleaned data to a dedicated data storage platform, and returns it to the data processing and alarm module of the Web application gateway. The data processing and alarm module performs multi-dimensional statistical calculations on the log data, and determines whether the alarm condition is met according to the alarm threshold of each statistical dimension. If the alarm condition is met, it determines whether to execute the alarm according to the alarm frequency limit and / or the number of consecutive conditions. This step realizes the alarm analysis of the Web application network monitoring log data and gives a service status warning based on the long-term running data.

[0053] Furthermore, network monitoring data is displayed. For example, network request-related content is displayed through multi-dimensional statistical charts, including geographic location, DNS time, request time, TCP connection establishment time, SSL handshake time, data sending time, waiting for server-side processing time, response content download time, network connection type, browser speed, etc. For another example, browser execution-related content is displayed through multi-dimensional statistical charts, including page loading time, DOM parsing time, page resource loading time, JS execution efficiency, etc. For another example, server performance and stability are displayed through multi-dimensional statistical charts, including average request response time per unit time, maximum response time, 95% percentile response time, 99% percentile response time, error rate, response timeout rate, etc.

[0054] The above description is only a preferred embodiment of the present invention. Those skilled in the art should understand that the scope of disclosure involved in the present invention is not limited to the technical solution formed by a specific combination of the above technical features, but also should cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present invention (but not limited to) to form a technical solution.

Claims

1. A non-invasive monitoring method for Web applications, characterized in that include: The browser sends an http request to the Web application server via the Web application gateway; The Web application gateway obtains the http request, generates a unique identifier for the http request, puts the unique identifier into the X-Request-Id request header, and forwards the processed http request to the Web application server; The Web application server processes the http request and returns the http response via the Web application gateway; The web application gateway puts the unique identifier in the X-Request-Id response header of the http response returned by the web application server, and checks whether the http response contains html content. If so, it injects a JavaScript monitoring script into the head tag of the html page, sends the processed http response to the browser, and records the content of the http request and http response as a log; The browser renders the web page and executes the JavaScript monitoring script according to the received http response, calls the browser's API interface to monitor the browser's network data, and if there is an immediate report instruction in the http response, the monitored network data is immediately reported to the Web application gateway, otherwise it is added to the reporting list, and when the length of the reporting list reaches or exceeds the upper limit or the time from the last report reaches or exceeds the preset value, a reporting request is initiated to the Web application gateway; After receiving the reporting request, the Web application gateway records the monitored network data in the form of logs, and performs multi-dimensional statistical calculations on the log data through the data processing and alarm modules. It determines whether the alarm condition is met according to the alarm threshold of each statistical dimension. If the alarm condition is met, it determines whether to execute the alarm based on the alarm frequency limit and / or the number of consecutive times the condition is met.

2. A non-invasive monitoring method for Web applications according to claim 1, characterized in that: Before the Web application gateway performs multi-dimensional statistical calculations on log data, it also includes: The Web application gateway pushes http request logs, http response logs, and browser monitoring data to the stream data processing platform; The stream data processing platform cleans the data into a predetermined data format, saves the cleaned data to a dedicated data storage platform, and returns it to the Web application gateway.

3. The non-invasive monitoring method for a Web application according to claim 1, characterized in that: Also includes: Use JavaScript monitoring scripts to check whether the browser has completed device registration in the Web Application Gateway. If the browser has not completed device registration in the Web application gateway, the browser's API interface is called to obtain browser information and network connection information, and the browser information and network connection information are sent to the Web application gateway to request browser registration; The web application gateway receives the device registration request from the browser, generates a device ID and sends the device ID to the browser; The browser stores the device ID in the browser's cookies.

4. The non-invasive monitoring method of a Web application according to claim 1, characterized in that: Also includes: A proxy service thread with a scope of the website root directory is registered in the browser through a JavaScript monitoring script, and the http response is monitored through the proxy service thread, and it is determined whether there is an immediate reporting instruction in the response header of the http response.

5. A non-invasive monitoring method for Web applications according to claim 4, characterized in that: Immediately reporting the monitored network data to the Web application gateway includes: The proxy service thread obtains the network data that needs to be reported immediately through the browser's API interface and sends it to the browser main thread, and the browser main thread sends the data that needs to be reported immediately to the Web application gateway.

6. A non-intrusive monitoring system for Web applications, characterized in that include: The browser side is used to send http requests to the Web application server via the Web application gateway; According to the received http response, the web page is rendered and the JavaScript monitoring script is executed, and the browser's API interface is called to monitor the browser's network data. If there is an immediate report instruction in the http response, the monitored network data will be immediately reported to the Web application gateway, otherwise it will be added to the report list. When the length of the report list reaches or exceeds the upper limit or the time from the last report reaches or exceeds the preset value, a report request is initiated to the Web application gateway; The Web application gateway is used to obtain the http request sent by the browser, generate a unique identifier for the http request, put the unique identifier into the X-Request-Id request header, and forward the processed http request to the Web application server; The unique identifier is placed in the X-Request-Id response header of the http response returned by the Web application server, and the http response is checked to see if it contains html content. If so, a JavaScript monitoring script is injected into the head tag of the html page, and the processed http response is sent to the browser, and the contents of the http request and the http response are recorded as logs; after receiving the report request from the browser, the monitored network data is recorded in the form of logs, and multi-dimensional statistical calculations are performed on the log data through the data processing and alarm modules, and it is determined whether the alarm condition is met according to the alarm threshold of each statistical dimension. If the alarm condition is met, it is determined whether to execute the alarm according to the alarm frequency limit and / or the number of consecutive conditions reached; The Web application server is used to process http requests and return http responses via the Web application gateway.

7. A non-invasive monitoring system for Web applications according to claim 6, characterized in that: The Web application gateway is also used to push http request logs, http response logs and browser monitoring data to the stream data processing platform, and the stream data processing platform is used to clean the data pushed by the Web application gateway into a predetermined data format, save the cleaned data and return it to the Web application gateway.

8. The non-invasive monitoring system for Web applications according to claim 6, characterized in that: The browser side is also used to check whether the browser has completed device registration in the Web application gateway through a JavaScript monitoring script. If the browser has not completed device registration in the Web application gateway, the browser's API interface is called to obtain browser information and network connection information, and the browser information and network connection information are sent to the Web application gateway to request browser registration; the device ID generated by the Web application gateway is stored in the browser's cookie; The web application gateway is also used to receive device registration requests from the browser, generate a device ID and send the device ID to the browser.

9. The non-invasive monitoring system for Web applications according to claim 6, characterized in that: The browser is also used to: A proxy service thread with a scope of the website root directory is registered through a JavaScript monitoring script, the http response is monitored through the proxy service thread, and it is determined whether there is an immediate reporting instruction in the response header of the http response.

10. A non-invasive monitoring system for Web applications according to claim 9, characterized in that: The browser is also used to: The proxy service thread obtains the network data that needs to be reported immediately from the browser's API interface and sends it to the browser main thread, and the browser main thread sends the data that needs to be reported immediately to the Web application gateway.

Citation Information

Patent Citations

  • Multi-element streaming media data acquisition method

    CN116915756A

  • Link monitoring method, device, equipment and medium

    CN118473983A