Front-end monitoring method, device, electronic device and readable storage medium

By deploying multiple monitoring modules and listeners in front-end devices, multi-dimensional monitoring data is generated, which solves the problem of single monitoring dimensions and difficult to trace the root cause of the problem in the existing technology, and realizes multi-dimensional monitoring and accurate problem positioning of interfaces, pages and services.

CN119759682APending Publication Date: 2025-04-04CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411782315.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

When monitoring front-end data in the prior art, there is a problem that the monitoring dimension is single and difficult to trace back to the root of the problem.

Method used

Deploy interface monitoring modules, page monitoring modules, business monitoring modules and general modules in front-end devices, including interface listeners and routing listeners. Through these modules and listeners, route change information, interface call request and response information are obtained, and multi-dimensional monitoring data is generated.

Benefits of technology

It realizes multi-dimensional monitoring of interfaces, pages and services by front-end devices, and can associate routing jump behavior and interface call behavior with specific services, improving the accuracy and efficiency of problem positioning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759682A_ABST
    Figure CN119759682A_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a front-end monitoring method, device, electronic device and readable storage medium, the method comprising: deploying an interface monitoring module, a page monitoring module, a business monitoring module and a general module in a front-end device; in the case of a route jump, the page monitoring module calls a route listener to obtain route change information; when the interface monitoring module monitors that the request interceptor of the front-end device intercepts an interface call request, the interface monitoring module calls the interface listener to obtain request information and response information corresponding to the interface call request; the interface monitoring module generates interface monitoring data; the page monitoring module generates page monitoring data; and the business monitoring module generates business monitoring data. The embodiment of the present invention realizes multi-dimensional monitoring of interfaces, pages and businesses, and associates route jump behavior and interface call behavior with business, which is conducive to tracing the root cause of the problem.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer technology, and in particular relates to a front-end monitoring method, device, electronic equipment and readable storage medium. Background Art

[0002] Micro Frontends is a new front-end architecture style. It draws on the idea of ​​back-end microservices architecture and splits the front-end application into multiple small applications. Each application can be deployed, developed and run independently. However, with the increase in the number of applications, troubleshooting and problem location of pages and business systems become difficult.

[0003] The page tracking method can capture the user's behavior on the browser front end and report it; however, the page tracking method can often only monitor the user's page behavior and interface calls, ignoring the interaction and dependency between various applications in the front end. The monitoring dimension is single, and it is difficult to trace the root cause of the problem. Summary of the invention

[0004] The embodiments of the present invention provide a front-end monitoring method, device, electronic device and readable storage medium, which can solve the problem that in the process of monitoring front-end data in the related technology, the monitoring dimension is single and it is difficult to trace the root cause of the problem.

[0005] In order to solve the above problems, an embodiment of the present invention discloses a front-end monitoring method, which is applied to a front-end device. The method includes:

[0006] An interface monitoring module, a page monitoring module, a service monitoring module and a general module are deployed in the front-end device; the general module includes an interface listener and a routing listener;

[0007] In the case where a route jump occurs in the front-end device, the page monitoring module calls the route listener to obtain route change information; the route change information includes the first route information after the route jump;

[0008] The interface monitoring module, when monitoring that the request interceptor of the front-end device intercepts the interface call request, calls the interface listener to obtain the request information and response information corresponding to the interface call request;

[0009] The interface monitoring module generates interface monitoring data according to the request information, the response information and the first routing information;

[0010] The page monitoring module generates page monitoring data according to the route change information and the request information;

[0011] The service monitoring module generates service monitoring data according to the first routing information, the request information and the response information.

[0012] On the other hand, an embodiment of the present invention discloses a front-end monitoring device, which is applied to a front-end device. The device includes:

[0013] A deployment module, used to deploy an interface monitoring module, a page monitoring module, a service monitoring module and a general module in the front-end device; the general module includes an interface listener and a routing listener;

[0014] The page monitoring module is used to call the route listener to obtain route change information when a route jump occurs in the front-end device; the route change information includes the first route information after the route jump;

[0015] The interface monitoring module is used to call the interface listener to obtain request information and response information corresponding to the interface call request when monitoring that the request interceptor of the front-end device intercepts the interface call request;

[0016] The interface monitoring module is further used to generate interface monitoring data according to the request information, the response information and the first routing information;

[0017] The page monitoring module is further used to generate page monitoring data according to the route change information and the request information;

[0018] The service monitoring module is used to generate service monitoring data according to the first routing information, the request information and the response information.

[0019] On the other hand, an embodiment of the present invention further discloses an electronic device, which includes a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store executable instructions, and the executable instructions enable the processor to execute the aforementioned front-end monitoring method.

[0020] The embodiment of the present invention further discloses a readable storage medium. When instructions in the readable storage medium are executed by a processor of an electronic device, the electronic device can execute the aforementioned front-end monitoring method.

[0021] The embodiments of the present invention include the following advantages:

[0022] The embodiment of the present invention provides a front-end monitoring method. In the process of monitoring the front-end by the front-end device, the interface monitoring module, the page monitoring module, the business monitoring module and the general module including the interface listener and the route listener are first deployed in the front-end device. When a route jump occurs in the front-end device, the route listener is called by the page monitoring module to obtain route change information. When the interface monitoring module monitors that the request interceptor of the front-end device intercepts the interface call request, the interface listener is called to obtain request information and response information corresponding to the interface call request, so that the interface monitoring module can generate interface monitoring data according to the request information, the response information and the first route information after the route jump; the page monitoring module can generate page monitoring data according to the route change information and the request information; the business monitoring module can generate business monitoring data according to the first route information, the request information and the response information after the route jump, which not only realizes the multi-dimensional monitoring of the interface, page and business by the front-end device, but also can associate the route jump behavior and the interface call behavior in the front-end device with the specific business, which is conducive to accurately locating the business process corresponding to the route jump behavior and the interface call behavior. When an exception occurs, the root cause of the problem can be accurately traced. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 is a flowchart of the steps of a front-end monitoring method provided by an embodiment of the present invention;

[0024] Figure 2 It is a flowchart of a method for generating business monitoring data provided by an embodiment of the present invention;

[0025] Figure 3 is a flowchart of another front-end monitoring method provided by an embodiment of the present invention;

[0026] Figure 4 It is a logic block diagram of a front-end monitoring device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0027] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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.

[0028] Method Embodiment

[0029] Reference Figure 1 , shows a flow chart of the steps of a front-end monitoring method provided by an embodiment of the present invention, and the method may specifically include the following steps:

[0030] Step S101: deploy an interface monitoring module, a page monitoring module, a business monitoring module and a general module in the front-end device; the general module includes an interface listener and a routing listener.

[0031] Step S102: When a route jump occurs in the front-end device, the page monitoring module calls the route listener to obtain route change information; the route change information includes the first route information after the route jump.

[0032] Step S103: When the interface monitoring module monitors that the request interceptor of the front-end device intercepts the interface call request, the interface monitoring module calls the interface listener to obtain request information and response information corresponding to the interface call request.

[0033] Step S104: The interface monitoring module generates interface monitoring data according to the request information, the response information and the first routing information.

[0034] Step S105: The page monitoring module generates page monitoring data according to the route change information and the request information.

[0035] Step S106: The service monitoring module generates service monitoring data according to the first routing information, the request information and the response information.

[0036] The front-end monitoring method provided in the embodiment of the present invention can be applied to the front-end device, which refers to a device that can directly interact with the user. The front-end device is responsible for presenting information to the user and receiving information input by the user. The front-end device may include but is not limited to: a personal computer, a laptop, a tablet computer, a smart phone, etc. Among them, the application installed in the front-end device, such as a browser, a mobile application (APP), etc., provides an interface for the user to interact with the back-end device.

[0037] In some embodiments, the front-end device may be a front-end device in a front-end microservice architecture. The front-end microservice architecture also includes a back-end device that interacts with the front-end device; wherein the back-end device refers to a device or system that provides services and data to the front-end device. It is understandable that the back-end device is usually not directly facing the user, but communicates with the front-end device through the network. The back-end device may include: 1) a server, such as a Web server, an application server, a database server, etc. The server is responsible for processing the interface call request of the front-end device, executing the corresponding business logic, and returning the result; 2) a storage device; 3) a database.

[0038] Among them, the front-end device and the back-end device usually communicate through a network, such as the Internet, a local area network, and the communication protocol between the front-end device and the back-end device may include but is not limited to: HTTP, HTTPS, WebSocket, etc.

[0039] In an embodiment of the present invention, when the front-end device is monitoring the front-end, step S101 is first executed to deploy an interface (cgi) monitoring module, a page (page) monitoring module, a business (business) monitoring module and a common module including an interface listener and a routing listener in the front-end device.

[0040] Among them, the interface monitoring module is used to provide a specific interface monitoring method, including the callback of interface call success or failure, the Uniform Resource Locator (URL) of the interface call request, the initiation time of the interface call request, the response time of the interface call request, the response status of the interface call request, the response error of the interface call request, and other interface monitoring data acquisition, recording and reporting.

[0041] The page monitoring module is used to provide specific page monitoring methods, including the acquisition, recording and reporting of page monitoring data such as page loading information, page interface calls, and static resource loading information.

[0042] The service monitoring module is used to provide a specific service monitoring method, generate and report service monitoring data according to the first routing information, request information and response information.

[0043] The general module is used to provide methods such as definition, addition, caching, and execution of common listeners for the interface monitoring module, page monitoring module, and business monitoring module, provide maintenance of the listening list, and provide a common cache for the interface monitoring module, page monitoring module, and business monitoring module. The common cache can cache the common data required for interface monitoring, page monitoring, and business monitoring; wherein the common data required for interface monitoring, page monitoring, and business monitoring may include the first routing information after the routing jump and the request information corresponding to the interface call request.

[0044] It should be noted that both the interface listener and the route listener are logical codes registered in the listening list in the general module; wherein, when the interface listener is called and executed, it is used to obtain the request information and response information of the interface call request from the request interceptor of the front-end device; when the route listener is called and executed, it is used to obtain the route change information from the route creation of the front-end device when a route jump occurs in the front-end device, or to obtain the first route information after the route jump from the route creation of the front-end device.

[0045] In the embodiment of the present invention, the route listener includes a global front-end route guard set for the route object. During the process of the route listener being called and executed, the route listener can sequentially obtain route change information through the global front-end route guard.

[0046] There is no data interaction between the interface monitoring module, the page monitoring module and the business monitoring module. The common module serves as a common module among the interface monitoring module, the page monitoring module and the business monitoring module. The interface monitoring module, the page monitoring module and the business monitoring module can all access the common module and call the interface listener and / or route listener from the listening list of the common module to obtain the cache content from the public cache area provided by the common module.

[0047] In an embodiment of the present invention, when a route jump occurs in the front-end device, the page monitoring module can call the route listener from the general module, and use the route listener to obtain the route change information corresponding to the route jump operation; wherein the route change information at least includes the second route information before the route jump and the first route information after the route jump. The route information may include, but is not limited to: destination address, mask, next address, outbound interface, protocol type (Proto), route priority (Pre), route cost (Cost / Metric), route path, route parameters, route guard and route meta information, etc.

[0048] In addition, the routing change information may also include: routing path, query parameters and timestamp, etc., wherein the routing path refers to the path (path) or name (name) of the current routing jump; the query parameter refers to the parameter passed through the query, which usually appears in the query string part of the URL; the timestamp refers to the time point when the routing change occurs, which is used for the subsequent calculation of the jump time.

[0049] In an embodiment of the present invention, a request interceptor is also provided in the front-end device, and the request interceptor includes a request sending interceptor and a request response interceptor; wherein, the request sending interceptor is used to intercept the interface call request sent by the front-end device to the back-end device, and the request response interceptor is used to intercept the response signal for the interface call request returned by the back-end device to the front-end device.

[0050] The interface listener includes a before-request listener (Beforesend) and a after-request listener (Aftersend); when the before-request listener is called and executed, it is used to obtain the request information corresponding to the interface call request from the request sending interceptor; when the after-request listener is called and executed, it is used to obtain the response information corresponding to the interface call request from the request response interceptor.

[0051] Specifically, when the front-end device is executing step S103: first, when the interface monitoring module monitors that the request sending interceptor intercepts the interface call request sent by the front-end device to the back-end device, the interface monitoring module calls the pre-request listener to obtain the request information corresponding to the interface call request; then, when the interface monitoring module monitors that the request response interceptor intercepts the response signal corresponding to the interface call request returned by the back-end device to the front-end device, the interface monitoring module calls the post-request listener to obtain the response information corresponding to the interface call request, thereby enabling the interface monitoring module to call the interface listener to obtain the request information and response information corresponding to the interface call request when it monitors that the request interceptor of the front-end device intercepts the interface call request.

[0052] The request information may include but is not limited to: the request method of the interface call request, the uniform resource locator (URL) of the interface call request, the request protocol of the interface call request, the request header (Request Header), the request body (Request Body), the response time, the common request parameters and the interface address, etc.

[0053] The response information may include, but is not limited to, a status line, a response header, a response body, paging information, and error information.

[0054] In an optional embodiment of the present invention, the post-request listener includes a response success listener (afterSuccess) and a response failure listener (afterError); when the interface monitoring module monitors that the request response interceptor intercepts the response signal corresponding to the interface call request returned by the back-end device to the front-end device, the post-request listener is called to obtain the response information corresponding to the interface call request, including: when the interface monitoring module monitors that the response signal corresponding to the interface call request intercepted by the request response interceptor indicates that the interface call request response is successful, the response success listener is called to obtain the response information corresponding to the interface call request; when the interface monitoring module monitors that the response signal corresponding to the interface call request intercepted by the request response interceptor indicates that the interface call request response fails, the response failure listener is called to obtain the response information corresponding to the interface call request.

[0055] In an embodiment of the present invention, since there is no data interaction among the interface monitoring module, the page monitoring module and the business monitoring module, before generating the interface monitoring data according to the request information, the response information and the first routing information in step S104, the interface monitoring module can call the routing listener to obtain the first routing information after the routing jump occurs in the front-end device; after calling the routing listener to obtain the first routing information, the interface monitoring module can continue to execute step S104 according to the request information and response information obtained in step S103, and the first routing information.

[0056] The interface monitoring data is data used to reflect the operating status of the interface of the front-end device. In step S104, the interface monitoring module can determine the request information, the response information and the first routing information as the interface monitoring data.

[0057] In an embodiment of the present invention, since there is no data interaction among the interface monitoring module, the page monitoring module and the business monitoring module, before generating the page monitoring data according to the route change information and the request information in step S105, the page monitoring module can call the interface listener to obtain the request information corresponding to the interface call request; after calling the interface listener to obtain the request information corresponding to the interface call request, the page monitoring module can continue to execute step S105 according to the route change information obtained in step S101 and the request information.

[0058] The page monitoring data is data used to reflect the running status of the front-end device page. In step S105, the page monitoring module can determine the route change information and the request information as the page monitoring data.

[0059] In an embodiment of the present invention, since there is no data interaction among the interface monitoring module, the page monitoring module and the business monitoring module, before the first routing information, request information and response information in step S106 generate business monitoring data, the business monitoring module can call the interface listener to obtain the request information and response information corresponding to the interface call request, and call the routing listener to obtain the first routing information after the front-end device has a routing jump; after obtaining the request information and response information corresponding to the interface call request, and the first routing information, the business monitoring module can execute step S106 according to the first routing information, request information and response information.

[0060] The service monitoring data is data used to reflect the running status of the service process of the front-end device. In step S106, the service monitoring module can determine the first routing information, the request information and the response information as the service monitoring data.

[0061] In an optional embodiment of the present invention, after generating the interface monitoring data, the interface monitoring module may package the interface monitoring data into a first data packet of a preset format, and report the first data packet to the data center, so that the data center analyzes the interface monitoring data in the first data packet; wherein the first data packet has an interface (cgi) identifier. After generating the page monitoring data, the page monitoring module may package the page monitoring data into a second data packet of a preset format, and report the second data packet to the data center, so that the data center analyzes the page monitoring data in the second data packet; wherein the second data packet has a page (page) identifier. After generating the business monitoring data, the business monitoring module may package the business monitoring data into a third data packet of a preset format, and report the third data packet to the data center, so that the data center analyzes the business monitoring data in the third data packet; wherein the third data packet has a business (business) identifier.

[0062] Among them, the data middle platform is a third-party data monitoring platform independent of the front-end equipment and the back-end equipment. It is used to analyze the interface monitoring data, page monitoring data and business monitoring data to determine whether any abnormalities have occurred, and to perform operation and maintenance inspections on issues reported by users based on the interface monitoring data, page monitoring data and business monitoring data to accurately trace the root cause of the problem.

[0063] It should be noted that the preset formats of the first data packet, the second data packet and the third data packet are file formats that can be recognized by the data center, and the embodiment of the present invention does not specifically limit this.

[0064] As an example, the common modules deployed by the front-end device in step S101 are as follows:

[0065] / **@type{Object}Interface call information list* /

[0066] const cgiStore = {};

[0067] / **@type{Object}Listener list* /

[0068] const observeStore = {

[0069] performance:[],

[0070] route:{page:[],app:[]},

[0071] cgi:{beforeSend:[],afterSuccess:[],afterError:[]},

[0072] };

[0073] / **@type{Object} routing information* /

[0074] const routeInfo = {};

[0075] / **@type{Array}User browsing route records* /

[0076] const routeRecords = [];

[0077] / **@type{Object} server request interface* /

[0078] const servercgiInfo = {};

[0079] *Module initialization

[0080] * /

[0081] function init(){

[0082] addRouteObserver('page',logRoute);

[0083] addcgiObserver('beforeSend',beforeSend);

[0084] addcgiObserver('afterSuccess',afterSend);

[0085] addcgiObserver('afterError',afterSend);

[0086] }

[0087] **@type{Object} tool method collection* /

[0088] const utils = {

[0089] canIUse,

[0090] throttle,

[0091] valInside,

[0092] areaInside,

[0093] getFileName,

[0094] isPageComp,

[0095] getRouteType,

[0096] getRouteInfo,

[0097] getCgiInfo,

[0098] };

[0099] / **@type{Object} monitoring method collection* /

[0100] const observers = {

[0101] addPerformance:addPerformanceObserver,

[0102] execPerformance:execPerformanceObserver,

[0103] addRoute:addRouteObserver,

[0104] execRoute:execRouteObserver,

[0105] addCgi:addcgiobserver,

[0106] execCgi:execCgiobserver,

[0107] };

[0108] export{

[0109] utils,

[0110] observers,

[0111] Init,

[0112] };

[0113] In an optional embodiment of the present invention, a monitoring data reporting module (report) is also deployed in the front-end device; specifically, after generating the interface monitoring data, the interface monitoring module can send the interface monitoring data to the monitoring data reporting module; after generating the page monitoring data, the page monitoring module can send the page monitoring data to the monitoring data reporting module; after generating the business monitoring data, the business monitoring module can send the business monitoring data to the monitoring data reporting module.

[0114] After receiving the interface monitoring data, the monitoring data reporting module packages the interface monitoring data into a first data packet in a preset format, and reports the first data packet to the data middle station; after receiving the page monitoring data, the monitoring data reporting module packages the page monitoring data into a second data packet in a preset format, and reports the second data packet to the data middle station; after receiving the business monitoring data, the monitoring data reporting module packages the business monitoring data into a third data packet in a preset format, and reports the third data packet to the data middle station.

[0115] As an example, the monitoring data reporting module deployed by the front-end device in step S101 is as follows:

[0116]

[0117] In the related art, the user's behavior on the front end of the browser is captured and reported by the page embedding method, which can only monitor the user's page behavior and interface call situation. It not only ignores the interaction and dependency between various applications in the front end, but also has a single monitoring dimension and is difficult to trace the root cause of the problem. Moreover, the page embedding method is not a targeted monitoring method, which will generate a large amount of invalid monitoring data and increase the operating and storage pressure of the monitoring system; in addition, the page embedding method is highly dependent on the application program, and it is impossible to extract the application program for unified configuration and analysis. The front-end monitoring method provided by the embodiment of the present invention realizes the multi-dimensional monitoring of interfaces, pages and services by the front-end device, and can associate the routing jump behavior and interface call behavior in the front-end device with specific services, which is conducive to accurately locating the business process corresponding to the routing jump behavior and interface call behavior. When an exception occurs, the root cause of the problem can be accurately traced; further, the front-end monitoring method provided by the embodiment of the present invention is loosely coupled with the front-end application program, does not depend on the specific application program, and can be extracted from the specific application program for unified configuration and analysis.

[0118] In addition, the front-end monitoring method provided by the embodiment of the present invention can also be introduced into the front-end project as a plug-in, with richer basic functions and good accessibility and maintainability.

[0119] Optionally, in step S104, the interface monitoring module generates interface monitoring data according to the request information, the response information and the first routing information, including:

[0120] Step S1041: The interface monitoring module calculates the interface performance parameters corresponding to the interface call request according to the first routing information, the request information and the response information.

[0121] Step S1042: The interface monitoring module generates interface monitoring data according to the request information, the response information, the interface performance parameters and the first routing information.

[0122] In an embodiment of the present invention, the general module also includes an interface performance listener, that is, the logic code for registering the interface performance listener in the listening list maintained by the general module; when the interface performance listener is called and executed, it is used to calculate the interface performance parameters corresponding to the interface call request based on the first routing information, request information and response information.

[0123] During the execution of step S104, the interface monitoring module first calls the interface performance listener to execute step S1041 to calculate the interface performance parameters corresponding to the interface call request based on the first routing information, request information and response information; then, executes step S1042 to generate interface monitoring data based on the request information, response information, interface performance parameters and the first routing information.

[0124] The interface performance parameters may include, but are not limited to, response time, throughput, concurrent users, error rate, and latency.

[0125] The response time refers to the time consumed from the first moment when the front-end device sends an interface call request to the second moment when the front-end device receives the response signal corresponding to the last byte data returned by the back-end device. Specifically, the interface monitoring module can call the interface performance listener to obtain the response time field from the response information, or obtain the response time by calculating the difference between the first moment when the interface call request is sent and the second moment when the response signal corresponding to the last byte data is received.

[0126] Throughput refers to the amount of data transmitted on the network per unit time, reflecting the load capacity of the front-end microservice architecture system. Specifically, the interface monitoring module can call the interface performance listener to determine the total amount of data called by the interface within a period of time according to the request information, and then divide it by the time period to obtain the throughput.

[0127] The concurrency number refers to the number of requests and / or transactions processed simultaneously by the front-end microservice architecture system. Specifically, the interface monitoring module can call the interface performance listener to monitor the network traffic and the performance of the back-end device according to the first routing information to evaluate the concurrency number. Exemplarily, the interface performance listener determines the number of interface call requests passing through the router within a specific time period according to the first routing information.

[0128] The error rate refers to the ratio of the number of interface call requests that failed to respond to the total number of interface call requests. Specifically, the interface monitoring module can call the interface performance listener to determine the total number of interface call requests based on the request information, and determine the number of interface call requests that failed to respond based on the response information, and finally calculate the ratio of the number of interface call requests that failed to respond to the total number of interface call requests to determine the error rate.

[0129] Delay refers to the time delay between the first moment when the interface call request is sent and the second moment when the front-end device receives the response signal corresponding to the interface call request. The calculation method of delay is similar to that of response time, which will not be repeated here.

[0130] After obtaining the interface performance parameters in step S1041, the interface monitoring module may determine the request information, the response information, the interface performance parameters and the first routing information as the interface monitoring data.

[0131] In an optional embodiment of the present invention, after obtaining the first routing information and the request information, the interface monitoring module may first store the first routing information and the request information in the public cache provided by the general module, and after obtaining the response information, store the response information in the public cache; when it is necessary to report the interface monitoring data, the interface monitoring module performs operations corresponding to step S1041 and step S1042 according to the first routing information, the request information and the response information in the public cache. The area in the public cache used to store the interface monitoring module related data (e.g., the first routing information, the request information and the response information, etc.) may be defined as cgiStore.

[0132] As an example, the interface monitoring module deployed by the front-end device in step S101 is as follows:

[0133] / **

[0134] *Module initialization

[0135] * /

[0136] function init(){

[0137] addRouteObserver('page',logRoute);

[0138] addcgiObserver('beforeSend',beforeSend);

[0139] addcgiObserver('afterSuccess',afterSend);

[0140] addcgiObserver('afterError', afterSend);

[0141] }

[0142] / ** @type {object} Tool method collection * /

[0143] const utils = {

[0144] canIUse,

[0145] throttle,

[0146] valInside,

[0147] areaInside,

[0148] getFileName,

[0149] isPageComp,

[0150] getRouteType,

[0151] getRouteInfo,

[0152] getCgiInfo,

[0153] };

[0154] / ** @type {object} Listener method collection * /

[0155] const observers = {

[0156] addPerformance: addPerformanceObserver,

[0157] execPerformance: execPerformanceObserver,

[0158] addRoute: addRouteObserver,

[0159] execRoute: execRouteObserver,

[0160] addCgi: addcgiobserver,

[0161] execCgi: execCgiobserver,

[0162] };

[0163] export{

[0164] utils,

[0165] observers,

[0166] init,

[0167] }

[0168] The front-end monitoring method provided by the embodiment of the present invention improves the integrity and reliability of the embodiment of the present invention in interface monitoring, while alleviating the data processing pressure of the data middle station.

[0169] Optionally, in step S105, the page monitoring module generates page monitoring data according to the route change information and the request information, including:

[0170] Step S1051: The page monitoring module obtains page information according to the routing change information.

[0171] Step S1052: The page monitoring module calculates page performance parameters during the route jump process according to the route change information, the page information and the request information.

[0172] Step S1053: The page monitoring module generates page monitoring data according to the route change information, the page information, the request information and the page performance parameters.

[0173] In the embodiment of the present invention, after the page monitoring module obtains the route change information through step S102, the route change information can be stored in the public cache. After obtaining the request information corresponding to the interface call request, the request information is also stored in the public cache. When it is necessary to report the page monitoring data, the interface monitoring module performs the operations corresponding to steps S1051 to S1052 according to the route change information and request information in the public cache. Among them, the area in the public cache used to store data related to the page monitoring module (for example, route change information and request information, etc.) can be defined as pageStore.

[0174] Specifically, in the process of generating page monitoring data according to route change information and request information, the page monitoring module:

[0175] First, page information is obtained from the browser of the front-end device according to the route change information; wherein the page information is the status information of the page of the front-end device after the route jump. In an embodiment of the present invention, the page information may include but is not limited to: the traceId of the page, the browser version and the page loading time, etc. According to the page information, the front-end device corresponding to the page information can be located.

[0176] Then, according to the route change information, the page information and the request information, the page performance parameters in the route jump process are calculated, and according to the route change information, the page information, the request information and the page performance parameters, the page monitoring data is generated. In the embodiment of the present invention, the general module also includes a page performance listener, that is, the logic code of registering the page performance listener in the listening list maintained by the general module; when the page performance listener is called and executed, it is used to calculate the page performance parameters in the route jump process according to the route change information, the page information and the request information.

[0177] The page performance parameters may include, but are not limited to: page loading time, page response time, first content painting time (FCP), first significant painting time (FMP), total page jump time, etc.

[0178] Specifically, the page monitoring module calls the page performance listener to calculate the total page jump time, page loading time, and page response time based on the timestamp in the route change information; the page monitoring module calls the page performance listener to calculate the time from the beginning of page loading to the time when any part of the page content is rendered on the display of the front-end device based on the page information and request information, and obtains the first content drawing time; the page monitoring module calls the page performance listener to calculate the time when the main content of the page is presented on the page based on the page information and request information, and obtains the first effective drawing time.

[0179] After obtaining the page performance parameters in step S1052 , the page monitoring module may determine the route change information, the page information, the request information and the page performance parameters as the page monitoring data.

[0180] As an example, the page monitoring module deployed by the front-end device in step S101 is as follows:

[0181]

[0182]

[0183] The front-end monitoring method provided by the embodiment of the present invention improves the integrity and reliability of the embodiment of the present invention in performing page monitoring, while alleviating the data processing pressure of the data middle station.

[0184] Optionally, the general module further includes an interface call return listener and a business listener; the interface call return listener is used to monitor the response information corresponding to the interface call request in the order in which the front end initiates the interface call request; the method further includes:

[0185] Step A11: The service monitoring module calls the service listener to obtain the response information from the interface call return listener.

[0186] In the embodiment of the present invention, the general module also includes an interface call return listener and a business listener, that is, the logic code of the interface call return listener and the logic code of the business listener are registered in the monitoring list maintained by the general module. When the interface call return listener is called and executed, it is used to monitor the corresponding response information of the interface call request in the order of the interface call request initiated by the front end; when the business listener is called and executed, it is used to obtain the response information corresponding to the interface call request from the interface call return listener.

[0187] Specifically, before executing step S106 to generate page monitoring data according to the route change information and the request information, the service monitoring module may execute step A11 to obtain the response information from the interface call return listener using the service listener.

[0188] It should be noted that the interface call return listener can string together the process and sequence of interface calls initiated by the front-end device to the back-end device, and store or perform some corresponding processing on the corresponding response information of the interface call information, thereby treating the entire process of interface calls initiated by the front-end device to the back-end device as a business object that can be monitored; and the logic code of the business listener is registered in the monitoring list maintained by the general module, so that the business monitoring module can call the business listener to obtain the response information corresponding to the interface call request from the interface call return listener when it is necessary to generate business monitoring data.

[0189] In the front-end monitoring method provided in the embodiment of the present invention, the flexibility and feasibility of the service monitoring performed by the service monitoring module in the embodiment of the present invention are improved.

[0190] Optionally, the service monitoring module in step S106 generates service monitoring data according to the first routing information, the request information and the response information, including:

[0191] Step S1061: The service monitoring module searches for a service data dictionary according to the first routing information; the service dictionary is used to store at least one service domain in a monitored state and service objects under the service domain.

[0192] Step S1062: When the target business domain corresponding to the first routing information exists in the business data dictionary, the business monitoring module determines the execution phase corresponding to the interface call request from the target business domain according to the request information.

[0193] Step S1063: The business monitoring module generates business monitoring data according to the execution stage, the request information and the response information.

[0194] In the embodiment of the present invention, a business data dictionary is stored in the general module. The business data dictionary is used to store at least one business domain in a monitoring state and business objects under the business domain in the embodiment of the present invention.

[0195] As an example, Table 1 shows a structure information table of a service data dictionary provided by an embodiment of the present invention.

[0196] Table 1

[0197]

[0198] Specifically, in the process of generating the service monitoring data according to the first routing information, the request information and the response information, the service monitoring module:

[0199] First, the business monitoring module executes step S1061 to obtain the routing name field from the first routing information, and matches the routing name field with the name (realname) of the business domain in the business data dictionary; when there is a realname that matches the routing name field in the business data dictionary, it indicates that the target business domain corresponding to the first routing information exists in the business data dictionary, and the operations corresponding to steps S1062 to S1063 continue to be executed; when there is no realname that matches the routing name field in the business data dictionary, it indicates that the target business domain corresponding to the first routing information does not exist in the business data dictionary, that is, the routing jump operation currently occurring in the front-end device is not within the scope of business monitoring, and the operations corresponding to steps S1062 to S1063 are not executed.

[0200] Then, in the case where the first routing information corresponds to the target business domain, the business monitoring module executes step S1062 to determine the execution phase corresponding to the interface call request from the target business domain according to the uniform resource locator (URL) of the interface call request in the request information.

[0201] Specifically, the business monitoring module can perform a structural analysis on the URL of the interface call request, and determine the execution phase corresponding to the interface call request according to the path or parameters in the URL. When the URL of the interface call request includes a path or parameter for indicating a start or initialization operation, the execution phase corresponding to the interface call request is determined to be the start phase; illustratively, when the URL of the interface call request is / api / v1 / tasks / start, / api / v1 / processes / initialize, or / service / orders / begin, the execution phase corresponding to the interface call request can be determined to be the start phase.

[0202] When the URL of the interface call request includes a path or parameter used to represent an intermediate processing or progress update operation, the execution stage corresponding to the interface call request is determined to be the intermediate stage; exemplarily, when the URL of the interface call request is / api / v1 / tasks / {taskId} / update, / api / v1 / processes / {processId} / step, or / service / orders / {orderId} / progress, it can be determined that the execution stage corresponding to the interface call request is the intermediate stage.

[0203] When the URL of the interface call request includes a path or parameter used to indicate completion, confirmation or termination of the operation, the execution phase corresponding to the interface call request is determined to be the end phase; exemplarily, when the URL of the interface call request is / api / v1 / tasks / {taskId} / complete, / api / v1 / processes / {processId} / finish, or / service / orders / {orderId} / confirm, the execution phase corresponding to the interface call request can be determined to be the end phase.

[0204] In the embodiment of the present invention, when the service monitoring module determines the execution phase corresponding to the interface call request from the target service domain in step S1062, it can generate service monitoring data according to the execution phase, request information and response information.

[0205] Optionally, the execution stage includes a start stage, an intermediate stage and an end stage; in step S1063, the business monitoring module generates business monitoring data according to the execution stage, the request information and the response information, including:

[0206] Step S10631: At the start stage, the business monitoring module creates a target business object corresponding to the interface call request under the target business domain according to the request information.

[0207] Step S10632: The business monitoring module generates business information of the target business object according to the request information and the response information, and stores the business information in a first preset cache area.

[0208] Step S10633: In the intermediate stage or the end stage, the business monitoring module updates the business information of the target business object corresponding to the interface call request in the first preset cache area according to the request information and the response information.

[0209] Step S10634: The business monitoring module generates business monitoring data based on the business information of the target business object in the first preset cache area.

[0210] In an embodiment of the present invention, the execution stage includes a start stage, an intermediate stage and an end stage; in the process of generating business monitoring data according to the execution stage, request information and response information, when the business monitoring module determines through step S1062 that the execution stage corresponding to the interface call request is the start stage, step S10631 is executed to create a target business object corresponding to the interface call request under the target business domain, and step S10632 is executed to store the business information of the target business object into the first preset cache area; when it is determined through step S1062 that the execution stage corresponding to the interface call request is the intermediate stage or the end stage, step S10633 is executed to update the business information of the target business object; when it is necessary to report business monitoring data, the business monitoring module executes step S10634 to generate business monitoring data based on the business information of the target business object in the first preset cache area.

[0211] The first preset cache area may be a cache area in the public cache of the general module for storing business information. For example, the first preset cache area may be defined as businessStore.

[0212] Specifically, at the start stage, the business monitoring module creates a target business object corresponding to the interface call request under the target business domain according to the request information corresponding to the interface call request, and generates a business identifier (businessId) of the target business object; wherein, creating a target business object corresponding to the interface call request under the target business domain can specifically be: adding a business-related Json object under the target business domain as the target business object corresponding to the interface call request.

[0213] In the case of creating a target business object corresponding to an interface call request, the business monitoring module can generate business information of the target business object based on the request information and the response information, and store the business information in a first preset cache area; wherein, generating the business information of the target business object based on the request information and the response information is specifically as follows: determining the interface call status corresponding to the interface call request in the starting phase according to the response information (for example, interface call success, interface call failure), determining the start time of the target business object according to the request information and the response information, and determining the interface call status, the start time of the target business object, the business identifier of the target business object, the error information of the target business object during the execution of the starting phase, and the execution phase (starting phase) corresponding to the interface call request as the business information of the target business object, and storing the business information of the target business object in the first preset cache area.

[0214] In an embodiment of the present invention, in the intermediate stage or the end stage, the business monitoring module can update the business information of the target business object corresponding to the interface call request in the first preset cache area according to the request information and the response information; specifically, when the execution stage is the intermediate stage, the business monitoring module adds the intermediate stage to the business information, and records the interface call status corresponding to the intermediate stage, the error information of the target business object during the execution of the intermediate stage, etc.; when the execution stage is the end stage, the business monitoring module adds the end stage to the business information, and records the interface call status corresponding to the end stage, the error information of the target business object during the execution of the end stage, and the end time of the target business object, etc.

[0215] In the case where the business monitoring data needs to be reported, the business monitoring module executes step S10634 to determine the business information of the target business object in the first preset cache area as the business monitoring data. It can be understood that in step S10634, the business information of the target business object in the first preset cache area can be the business information stored in the first preset cache area by the business monitoring module in step S10632, or can be the business information updated by the business monitoring module in step S10633.

[0216] Among them, the situations in which business monitoring data needs to be reported may include but are not limited to: situations in which business information in the first preset cache changes, for example, the business monitoring module stores the business information in the first preset cache area so that the business information in the first preset cache changes, and / or the business monitoring module updates the business information of the target business object in the first preset cache area so that the business information in the first preset cache changes.

[0217] As an example, the service monitoring module deployed by the front-end device in step S101 is as follows:

[0218] import dictionary from ". / dictionary";

[0219] const rdictionary=dictionary[terminal];

[0220] / **@type{Object}Business information data list* /

[0221] const businessStore = {…

[0222] };

[0223] / **@type{Object}Business information cache* /

[0224] const cache = {…

[0225] };

[0226] / **…

[0227] const getReasonType=(reason)=>{…

[0228] }

[0229] / **

[0230] *@description: Build businessId

[0231] *@return{String}

[0232] * /

[0233] const buildbusinessId=async()=>{…

[0234] }

[0235] / **

[0236] *@description: Clear cache

[0237] *@return{*}

[0238] * /

[0239] const clearCache=()=>{…

[0240] }

[0241] / **

[0242] *@description: Generate business data

[0243] *@param{Object}dataInterface call information

[0244] *@return{*}

[0245] * /

[0246] const getBusinessData=async(data={})=>{…

[0247] }

[0248] / **

[0249] *@description: Is there a business cache

[0250] *@return{*}

[0251] * /

[0252] const isCache=()=>{…

[0253] }

[0254] / **

[0255] *@description: Is there any service in the cache?

[0256] *@param{String}pageId route name

[0257] *@return{Boolean}

[0258] * /

[0259] const isCacheBusiness=(pageId)=>{…

[0260] }

[0261] *@description: Whether it is the interface for starting the business and whether it is successful

[0262] *@param{Object]data interface call information

[0263] *@return{Boolean}

[0264] As another example, refer to Figure 2 , shows a flowchart of a method for generating business monitoring data provided by an embodiment of the present invention, the method may include the following steps:

[0265] Step S201: The business monitoring module obtains request information corresponding to the interface call request.

[0266] Step S202: The service monitoring module obtains first routing information.

[0267] Step S203: The business monitoring module obtains corresponding information corresponding to the interface call request.

[0268] Step S204: The service monitoring module searches the service data dictionary according to the first routing information to determine whether the target service domain corresponding to the first routing information exists in the service data dictionary.

[0269] Specifically, when the target business domain corresponding to the first routing information exists in the business data dictionary, the business monitoring module executes step S205; when the target business domain corresponding to the first routing information does not exist in the business data dictionary, there is no need to monitor the current first routing information, request information and response information in the business dimension, and the business monitoring module executes step S211.

[0270] Step S205: The business monitoring module determines whether the execution phase corresponding to the interface call request is the start phase.

[0271] Specifically, when there is a target business domain corresponding to the first routing information in the business data dictionary, the business monitoring module determines the execution phase corresponding to the interface call request from the target business domain according to the request information, and the execution phase includes a start phase, an intermediate phase and an end phase.

[0272] Wherein, when the execution phase is the starting phase, the service monitoring module executes step S206; when the execution phase is not the starting phase, the service monitoring module executes step S207.

[0273] Step S206: The business monitoring module creates a target business object, caches business information of the target business object, and reports business monitoring data.

[0274] Specifically, at the beginning stage, the business monitoring module first creates a target business object corresponding to the interface call request under the target business domain according to the request information; then, based on the request information and the response information, it generates business information of the target business object, and stores the business information in the first preset cache area; finally, based on the business information of the target business object in the first preset cache area, it generates business monitoring data, and reports the business monitoring data to the data middle station or the monitoring data reporting module.

[0275] Step S207: The business monitoring module determines whether the execution phase corresponding to the interface call request is an intermediate phase.

[0276] Specifically, the business monitoring module determines the execution phase corresponding to the interface call request from the target business domain according to the request information; when the execution phase is neither the start phase nor the middle phase, the business monitoring module executes step S209; when the execution phase is neither the start phase nor the middle phase, the business monitoring module executes step S208.

[0277] Step S208: The business monitoring module updates the business information of the target business object and reports the business monitoring data.

[0278] Specifically, in the intermediate stage, the business monitoring module first updates the business information of the target business object corresponding to the interface call request in the first preset cache area according to the request information and the response information; then, generates business monitoring data based on the business information of the target business object in the first preset cache area; finally, reports the business monitoring data to the data middle station or the monitoring data reporting module.

[0279] Step S209: The business monitoring module determines whether the execution phase corresponding to the interface call request is the end phase.

[0280] Specifically, the business monitoring module determines the execution phase corresponding to the interface call request from the target business domain based on the request information; when the execution phase is not the start phase, the middle phase, or the end phase, the business monitoring module executes step S211; when the execution phase is the end phase, the business monitoring module executes step S210.

[0281] Step S210: The business monitoring module updates the business information of the target business object, reports the business monitoring data, and clears the cache.

[0282] Specifically, in the ending stage, the business monitoring module first updates the business information of the target business object corresponding to the interface call request in the first preset cache area according to the request information and the response information; then, generates business monitoring data based on the business information of the target business object in the first preset cache area; finally, reports the business monitoring data to the data center or the monitoring data reporting module. It should be noted that in the ending stage, after the business monitoring module reports the business monitoring data, it can clear the business information of the target business object in the first preset cache area, and release the cache space of the first preset cache area, so as to store the business information of subsequent business objects.

[0283] Step S211, end.

[0284] The front-end monitoring method provided by the embodiment of the present invention improves the integrity and reliability of the embodiment of the present invention in business monitoring, associates the routing jump behavior and interface call behavior in the front-end device with the specific business, and is conducive to accurately locating the business process corresponding to the routing jump behavior and interface call behavior. In the event of an abnormality in the monitoring data, the root cause of the problem can be accurately traced.

[0285] Optionally, the front-end monitoring method provided by the embodiment of the present invention may further include:

[0286] Step B11: The page monitoring module stores the first routing information into a second preset cache area.

[0287] Step B12: The interface monitoring module stores the request information into the second preset cache area.

[0288] Step B13: The interface monitoring module obtains the first routing information from the second preset cache area.

[0289] Step B14: The page monitoring module obtains the request information from the second preset cache area.

[0290] Step B15: The service monitoring module obtains the request information and the first routing information from the second preset cache area.

[0291] In an embodiment of the present invention, after the page monitoring module obtains the route change information through step S102, the first route information in the route change information can be stored in the second preset cache area; after the interface monitoring module obtains the request information corresponding to the interface call request through step S103, the request information can be stored in the second preset cache area.

[0292] Among them, the second preset cache area is a cache area in the public cache of the general module for storing common data between the page monitoring module, the interface monitoring module and the business monitoring module; the first routing information stored in the second preset cache area by the page monitoring module through step B11 and the request information stored in the second preset cache area by the interface monitoring module through step B12 are used as common data between the page monitoring module, the interface monitoring module and the business monitoring module, so that before executing step S104 to generate interface monitoring data according to request information, response information and first routing information, the interface monitoring module can execute step B13 to obtain the first routing information from the second preset cache area; before executing step S105 to generate page monitoring data according to routing change information and request information, the page monitoring module can execute step B14 to obtain request information from the second preset cache area; before executing step S106 to generate business monitoring data according to the first routing information, request information and response information, the business monitoring module can execute step B15 to obtain request information and first routing information from the second preset cache area, thereby improving the efficiency of the interface monitoring module obtaining the first routing information, the page monitoring module obtaining the request information, and the business monitoring module obtaining the first routing information and request information.

[0293] As an example, referring to Table 2, there is shown a schematic diagram of execution logic of an interface monitoring module provided by an embodiment of the present invention during an interface monitoring process.

[0294] Table 2

[0295]

[0296] As an example, see Figure 3, shows a flowchart of another front-end monitoring method provided by an embodiment of the present invention, the method comprising steps S301 to S305:

[0297] Step S301, before sending an interface call request.

[0298] Specifically, before the interface call request is sent, that is, the front-end device initiates the interface call request, the interface monitoring module monitors that the request sending interceptor of the front-end device intercepts the interface call request, and then calls the pre-request listener to obtain the request information corresponding to the interface call request.

[0299] Step S302: After the interface call request is responded.

[0300] Specifically, after the interface call request is sent, that is, when the back-end device returns a response signal corresponding to the interface call request to the front-end device, the interface monitoring module calls the response success listener to obtain the response information corresponding to the interface call request when it monitors that the response signal corresponding to the interface call request intercepted by the request response interceptor indicates that the interface call request response is successful; the interface monitoring module calls the response failure listener to obtain the response information corresponding to the interface call request when it monitors that the response signal corresponding to the interface call request intercepted by the request response interceptor indicates that the interface call request response fails.

[0301] When the interface monitoring module obtains the request information and response information corresponding to the interface call request, the request information and response information can be stored in the cgiStore of the general module.

[0302] Step S303: route jump.

[0303] Specifically, when a route jump occurs in the front-end device, the page monitoring module calls the route listener to obtain route change information; wherein the route change information includes the first route information after the route jump.

[0304] Step S304: Process the original monitoring information according to the monitoring dimension to generate monitoring data.

[0305] The original monitoring information includes request information, response information and route change information.

[0306] Specifically, the front-end device processes the original monitoring information according to the monitoring dimension and generates monitoring data, which is as follows:

[0307] The interface monitoring module generates interface monitoring data according to the first routing information in the request information, response information and routing change information; the page monitoring module generates page monitoring data according to the routing change information and request information; the business monitoring module generates business monitoring data according to the first routing information, request information and response information in the routing change information.

[0308] Step S305: reporting monitoring data.

[0309] Specifically, the interface monitoring module can report the interface monitoring data to the monitoring data reporting module in the front-end device, or report the interface monitoring data to the data middle station; the page monitoring module can report the page monitoring data to the monitoring data reporting module in the front-end device, or report the page monitoring data to the data middle station; the business monitoring module can report the business monitoring data to the monitoring data reporting module in the front-end device, or report the business monitoring data to the data middle station.

[0310] As an example, the logic code for the interface monitoring module to generate interface monitoring data is as follows: const history = createWebHistory (process.env.BASE_URL);

[0311] const router=createRouter({

[0312] history,

[0313] routes,

[0314] });

[0315] router.beforeEach(handleBeforeEach);

[0316] router.afterEach(handleAfterEach);

[0317] $utils.performance.observerPage(router);

[0318] / **

[0319] *Monitoring page life cycle

[0320] *{Object}target monitoring object

[0321] * /

[0322] function logRoute(target){

[0323] target.beforeEach((to, from, next) => {

[0324] pageId = to.fullPath

[0325] const routeType = utils.getRouteType(to, from);

[0326] const { pageName, pageQuery, current, routeName} = utils.getRouteInfo();

[0327] setPageInfo(to.fullPath, {

[0328] beforeEach: Date.now(),

[0329] routeType,

[0330] pageUrl: current,

[0331] pageName,

[0332] routeName,

[0333] pageQuery,

[0334] cgiList:[],

[0335] });

[0336]

[0337]

[0338]

[0339] businessStore.bStartTime = endTime;

[0340] await buildbusinessId();

[0341] })

[0342] / / Whether it is a failure of the process

[0343] if (isProcessAndFail(url, success)) {

[0344] businessstore.bEndTime = endTime;

[0345] businessStore.bStatus='fail';

[0346] businessstore.reasonType=getReasonType(reason);

[0347] }

[0348] }

[0349] / / Is the business ended?

[0350] if (isEnd(url)) {

[0351] businessStore.bEndTime=endTime;

[0352] businessStore.bStatus=success? 'success':'fail';

[0353] businessStore.reasonType=success? ”:getReasonType(reason);

[0354] clearCache(); / / Clear cache service

[0355] }

[0356] In summary, the front-end monitoring method provided by the embodiment of the present invention not only realizes multi-dimensional monitoring of interfaces, pages and services by the front-end device, but also can associate the routing jump behavior and interface call behavior in the front-end device with specific services, which is conducive to accurately locating the business processes corresponding to the routing jump behavior and interface call behavior. When an exception occurs, the root cause of the problem can be accurately traced.

[0357] Device Embodiment

[0358] Figure 4 This is a logic block diagram of a front-end monitoring device provided by an embodiment of the present invention, which is applied to a front-end device. The device may include:

[0359] A deployment module 401 is used to deploy an interface monitoring module, a page monitoring module, a service monitoring module and a general module in the front-end device; the general module includes an interface listener and a routing listener;

[0360] The page monitoring module 402 is used to call the route listener to obtain route change information when a route jump occurs in the front-end device; the route change information includes the first route information after the route jump;

[0361] The interface monitoring module 403 is used to call the interface listener to obtain the request information and response information corresponding to the interface call request when monitoring that the request interceptor of the front-end device intercepts the interface call request;

[0362] The interface monitoring module 403 is further used to generate interface monitoring data according to the request information, the response information and the first routing information;

[0363] The page monitoring module 402 is further used to generate page monitoring data according to the route change information and the request information;

[0364] The service monitoring module 404 is used to generate service monitoring data according to the first routing information, the request information and the response information.

[0365] Optionally, the interface monitoring module is specifically used to:

[0366] Calculating an interface performance parameter corresponding to the interface call request according to the first routing information, the request information and the response information;

[0367] Interface monitoring data is generated according to the request information, the response information, the interface performance parameter and the first routing information.

[0368] Optionally, the page monitoring module is specifically used to:

[0369] Acquire page information according to the routing change information;

[0370] Calculating page performance parameters during the route jump process according to the route change information, the page information and the request information;

[0371] Page monitoring data is generated according to the routing change information, the page information, the request information and the page performance parameters.

[0372] Optionally, the general module further includes an interface call return listener and a business listener; the interface call return listener is used to monitor the response information corresponding to the interface call request in the order in which the front end initiates the interface call request; the business monitoring module is also used to:

[0373] The service listener is called to obtain the response information from the interface call return listener.

[0374] Optionally, the business monitoring is specifically used for:

[0375] According to the first routing information, searching a business data dictionary; the business dictionary is used to store at least one business domain in a monitoring state and business objects under the business domain;

[0376] In a case where the target service domain corresponding to the first routing information exists in the service data dictionary, determining the execution phase corresponding to the interface call request from the target service domain according to the request information;

[0377] Business monitoring data is generated according to the execution stage, the request information and the response information.

[0378] Optionally, the execution phase includes a start phase, an intermediate phase and an end phase; the business monitoring module is specifically used to:

[0379] In the starting stage, a target business object corresponding to the interface call request is created under the target business domain according to the request information;

[0380] Generate business information of the target business object according to the request information and the response information, and store the business information in a first preset cache area;

[0381] In the intermediate stage or the end stage, updating the business information of the target business object corresponding to the interface call request in the first preset cache area according to the request information and the response information;

[0382] Generate business monitoring data based on the business information of the target business object in the first preset cache area.

[0383] Optionally, the page monitoring module is further used to store the first routing information into a second preset cache area;

[0384] The interface monitoring module is further used to store the request information into the second preset cache area;

[0385] The interface monitoring module is further used to obtain the first routing information from the second preset cache area;

[0386] The page monitoring module is further used to obtain the request information from the second preset cache area;

[0387] The service monitoring module is further used to obtain the request information and the first routing information from the second preset cache area.

[0388] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0389] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0390] An embodiment of the present invention also provides an electronic device, which includes: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store executable instructions, and the executable instructions enable the processor to execute the front-end monitoring method of the aforementioned embodiment.

[0391] The embodiment of the present invention also provides a non-temporary computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device (server or terminal), the processor is able to execute Figure 1 The front-end monitoring method shown.

[0392] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0393] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0394] The front-end monitoring method, device, electronic device and readable storage medium provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A front-end monitoring method, characterized in that: Applied to a front-end device, the method comprises: An interface monitoring module, a page monitoring module, a service monitoring module and a general module are deployed in the front-end device; the general module includes an interface listener and a routing listener; In the case where a route jump occurs in the front-end device, the page monitoring module calls the route listener to obtain route change information; the route change information includes the first route information after the route jump; The interface monitoring module, when monitoring that the request interceptor of the front-end device intercepts the interface call request, calls the interface listener to obtain the request information and response information corresponding to the interface call request; The interface monitoring module generates interface monitoring data according to the request information, the response information and the first routing information; The page monitoring module generates page monitoring data according to the route change information and the request information; The service monitoring module generates service monitoring data according to the first routing information, the request information and the response information.

2. The method according to claim 1, characterized in that The interface monitoring module generates interface monitoring data according to the request information, the response information and the first routing information, including: The interface monitoring module calculates the interface performance parameter corresponding to the interface call request according to the first routing information, the request information and the response information; The interface monitoring module generates interface monitoring data according to the request information, the response information, the interface performance parameters and the first routing information.

3. The method according to claim 1, characterized in that The page monitoring module generates page monitoring data according to the route change information and the request information, including: The page monitoring module obtains page information according to the route change information; The page monitoring module calculates page performance parameters during the route jump process according to the route change information, the page information and the request information; The page monitoring module generates page monitoring data according to the route change information, the page information, the request information and the page performance parameters.

4. The method according to claim 1, characterized in that: The general module also includes an interface call return listener and a business listener; the interface call return listener is used to monitor the response information corresponding to the interface call request in the order in which the front end initiates the interface call request; the method also includes: The business monitoring module calls the business listener to obtain the response information from the interface call return listener.

5. The method according to claim 1, characterized in that The service monitoring module generates service monitoring data according to the first routing information, the request information and the response information, including: The business monitoring module searches for a business data dictionary according to the first routing information; the business dictionary is used to store at least one business domain in a monitoring state and business objects under the business domain; The service monitoring module determines, according to the request information, the execution phase corresponding to the interface call request from the target service domain when the target service domain corresponding to the first routing information exists in the service data dictionary; The business monitoring module generates business monitoring data according to the execution stage, the request information and the response information.

6. The method according to claim 5, characterized in that The execution phase includes a start phase, an intermediate phase and an end phase; The business monitoring module generates business monitoring data according to the execution stage, the request information and the response information, including: In the initial stage, the business monitoring module creates a target business object corresponding to the interface call request under the target business domain according to the request information; The business monitoring module generates business information of the target business object according to the request information and the response information, and stores the business information in a first preset cache area; The business monitoring module updates the business information of the target business object corresponding to the interface call request in the first preset cache area according to the request information and the response information in the intermediate stage or the end stage; The service monitoring module generates service monitoring data based on the service information of the target service object in the first preset cache area.

7. The method according to claim 1, characterized in that The method further comprises: The page monitoring module stores the first routing information into a second preset cache area; The interface monitoring module stores the request information into the second preset cache area; The interface monitoring module obtains the first routing information from the second preset cache area; The page monitoring module obtains the request information from the second preset cache area; The service monitoring module obtains the request information and the first routing information from the second preset cache area.

8. A front-end monitoring device, characterized in that: Applied to front-end equipment, the device comprises: A deployment module, used to deploy an interface monitoring module, a page monitoring module, a service monitoring module and a general module in the front-end device; the general module includes an interface listener and a routing listener; The page monitoring module is used to call the route listener to obtain route change information when a route jump occurs in the front-end device; the route change information includes the first route information after the route jump; The interface monitoring module is used to call the interface listener to obtain request information and response information corresponding to the interface call request when monitoring that the request interceptor of the front-end device intercepts the interface call request; The interface monitoring module is further used to generate interface monitoring data according to the request information, the response information and the first routing information; The page monitoring module is further used to generate page monitoring data according to the route change information and the request information; The service monitoring module is used to generate service monitoring data according to the first routing information, the request information and the response information.

9. An electronic device, characterized in that: The electronic device comprises a processor, a memory, a communication interface and a communication bus, and the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store executable instructions, and the executable instructions enable the processor to execute the front-end monitoring method according to any one of claims 1 to 7.

10. A readable storage medium, characterized in that: When the instructions in the readable storage medium are executed by a processor of an electronic device, the processor is enabled to execute the front-end monitoring method as described in any one of claims 1 to 7.

Citation Information

Cited By

  • A request interceptor-based user behavior data real-time collection method

    CN122885269A