Monitoring processing method and device for page loading performance, equipment and medium
By the start and end time of the record page, calculate the time of loading the page, and perform performance analysis and optimization processing, solve the problem of decreased and increased monitoring costs caused by the motion -monitoring script in the existing technology, and achieve efficient pages. Load performance monitoring.
Patent Information
- Application Number
- CN202411469835.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-01-28
AI Technical Summary
When implementing page loading performance monitoring, the prior art requires embedded monitoring scripts, resulting in a decrease in page loading speed and an increase in monitoring costs.
By loading the request on the response page, get and record the start and end time of the loading page, calculate the loading time of the page, and perform performance analysis and optimization based on this to avoid embedded monitoring script.
The monitoring page loading performance is achieved without embedding the monitoring script, which avoids the impact on the loading speed of the page and does not increase the cost of monitoring.
Smart Images

Figure CN119377050A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of computer technology and financial technology, and in particular to a method, device, equipment and medium for monitoring and processing page loading performance. Background Art
[0002] The WebView component is a component that can embed web content in an application, allowing developers to embed web pages or applications into applications to achieve richer user interfaces and functions. When implementing page loading performance monitoring, there are monitoring solutions similar to performance.js in the industry or products that are used to implement performance monitoring in WebView. These solutions embed custom JavaScript scripts to collect performance indicators such as page loading and rendering to help developers analyze and optimize application performance.
[0003] However, this method of embedding monitoring code may bring some disadvantages. First, the introduction of monitoring scripts may cause a certain degree of delay in the page loading time. Especially in the case of slow network, users may feel a significant decrease in page loading speed, which will have a negative impact on the initial interactive experience. Secondly, tasks related to monitoring code such as development, maintenance and data transmission may increase the cost of application development. The writing, testing and continuous maintenance of monitoring scripts may require additional time and resources. Therefore, although the existing monitoring solutions can realize page loading monitoring and performance analysis, the introduction of monitoring scripts affects the page loading speed and increases the monitoring cost. Summary of the invention
[0004] In view of the above-mentioned deficiencies in the prior art, the object of the present invention is to provide a page loading performance monitoring and processing method, device, equipment and medium that can be applied to financial technology or other related fields. Its main purpose is to realize the monitoring of page loading performance without embedding a monitoring script, avoiding the impact on the page loading speed and without increasing the monitoring cost.
[0005] The technical solution of the present invention is as follows:
[0006] A first aspect of the present invention provides a method for monitoring and processing page loading performance, comprising:
[0007] In response to a page loading request, obtain and record the start time of the page loading;
[0008] Load the specified page according to the page loading request, and display the corresponding loading result on the front end;
[0009] When the specified page is loaded, obtain and record the end time of the page loading;
[0010] Calculating the page loading time according to the start time of the page loading and the end time of the page loading, and performing performance analysis on the designated page according to the page loading time;
[0011] According to the resource loading level and performance analysis result of the designated page, corresponding loading performance optimization processing is performed on the designated page.
[0012] A second aspect of the present invention provides a monitoring and processing device for page loading performance, comprising:
[0013] A start time recording module, used to obtain and record the start time of page loading in response to a page loading request;
[0014] The page loading module is used to load the specified page according to the page loading request and display the corresponding loading result on the front end;
[0015] An end time recording module, used to obtain and record the end time of page loading when the specified page loading is completed;
[0016] A performance analysis module, used to calculate the page loading time according to the start time and the end time of the page loading, and perform performance analysis on the specified page according to the page loading time;
[0017] The performance optimization module is used to perform corresponding loading performance optimization processing on the specified page according to the resource loading level and performance analysis result of the specified page.
[0018] A third aspect of the present invention provides a computer device, comprising at least one processor; and
[0019] a memory communicatively connected to the at least one processor; wherein,
[0020] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned page loading performance monitoring and processing method.
[0021] A fourth aspect of the present invention provides a non-volatile computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by one or more processors, the one or more processors can execute the above-mentioned page loading performance monitoring and processing method.
[0022] Beneficial effects: The present invention discloses a method, device, equipment and medium for monitoring and processing page loading performance. Compared with the prior art, the embodiment of the present invention responds to a page loading request, obtains and records the start time of page loading; loads a specified page according to the page loading request, and displays the corresponding loading result on the front end; when the loading of the specified page is completed, obtains and records the end time of page loading; calculates the page loading time according to the start time of page loading and the end time of page loading, and performs performance analysis on the specified page according to the page loading time; performs corresponding loading performance optimization processing on the specified page according to the resource loading level and performance analysis results of the specified page. By tracking the start and end time of page loading and calculating the page loading time, the page loading performance is evaluated in turn, and then targeted optimization processing is performed in combination with the resource loading level of the page, and the monitoring of page loading performance is achieved without embedding a monitoring script, avoiding the impact on the page loading speed and not increasing the monitoring cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the scheme in the present invention, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present invention. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0024] Figure 1 A schematic diagram of an application environment of a method for monitoring and processing page loading performance provided by an embodiment of the present invention;
[0025] Figure 2 A flow chart of a method for monitoring and processing page loading performance provided by an embodiment of the present invention;
[0026] Figure 3 A flow chart of step S202 in the method for monitoring and processing page loading performance provided by an embodiment of the present invention;
[0027] Figure 4 A flow chart of step S203 in the method for monitoring and processing page loading performance provided by an embodiment of the present invention;
[0028] Figure 5 A flow chart of step S204 in the method for monitoring and processing page loading performance provided by an embodiment of the present invention;
[0029] Figure 6 Another flow chart of step S205 in the method for monitoring and processing page loading performance provided by an embodiment of the present invention;
[0030] Figure 7A schematic diagram of functional modules of a device for monitoring and processing page loading performance provided by an embodiment of the present invention;
[0031] Figure 8 A schematic diagram of the hardware structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail below. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. The embodiments of the present invention are described below in conjunction with the accompanying drawings.
[0033] The page loading performance monitoring and processing method provided by the embodiment of the present invention can be applied to Figure 1 In the application environment of FIG. 1 , it includes a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104 and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.
[0034] The user can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as knowledge reading applications, web browser applications, search applications, instant messaging tools, email clients, and / or social platform software, etc. (only as examples).
[0035] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0036] The server 105 may be a server that provides various services, such as a background server that provides support for the content browsed by the user using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (for example only). The background server may analyze and process the received data such as the user request, and feed back the processing results (such as web pages, information, or data obtained or generated according to the user request) to the terminal device. The server 105 may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server 105 may also be a server for a distributed system, or a server combined with a blockchain.
[0037] It should be noted that the page loading performance monitoring and processing method provided in the embodiment of the present application can generally be executed by the first terminal device 101, the second terminal device 102 or the third terminal device 103. Accordingly, the page loading performance monitoring and processing device provided in the embodiment of the present invention can also be set in the first terminal device 101, the second terminal device 102 or the third terminal device 103. Alternatively, the page loading performance monitoring and processing method provided in the embodiment of the present invention can also generally be executed by the server 105. Accordingly, the page loading performance monitoring and processing device provided in the embodiment of the present invention can generally be set in the server 105.
[0038] It should be understood that the numbers of the above terminal devices, networks and servers are only illustrative. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0039] like Figure 2 As shown, the page loading performance monitoring and processing method provided by the embodiment of the present invention specifically includes the following steps:
[0040] S201. In response to a page loading request, obtain and record a start time of page loading.
[0041] In this embodiment, when a user needs to open a page on the front end, the front end will initiate a page loading request. Specifically, in the field of finance and insurance, users can load pages through WebView components embedded in applications such as web browsers and WeChat applets, so as to browse financial insurance web pages such as product promotion pages, underwriting pages, and insurance application pages. Before the page is loaded, the start time of the page loading is obtained and recorded, so as to accurately obtain the starting time point of the page loading, and provide accurate data support for subsequent performance analysis.
[0042] For example, in the financial insurance field, when a user clicks a link in a financial insurance WeChat applet to open a detailed introduction page for an insurance product, the front-end page of the applet will respond to the page loading request by listening to the user click event. At the moment the user clicks the link, the performance API provided by the browser, such as performance.now(), can be used to obtain and record the start time of the page loading, thereby accurately marking the starting point of the page loading and providing a clear starting point for the performance analysis of the page loading.
[0043] S202: Load the specified page according to the page loading request, and display the corresponding loading result on the front end.
[0044] In this embodiment, in the WebView component, an external web page to be loaded can be specified. Therefore, based on the page loading request initiated by the user at the front end, the back end will respond to the page loading request, thereby returning the page content of the requested specified page to the front end, thereby performing page loading in the front-end WebView component, including obtaining and displaying page content, images, scripts, etc., thereby displaying the corresponding loading results at the front end. For example, in a mini program, a WebView component is used to load a financial insurance web page. When a user clicks a link, the mini program sends a request to the server. The server responds to the request and sends the page content back to the mini program. The mini program front end starts loading the page by setting the src attribute of the WebView component to the page link returned by the server, and displays the loading process on the user interface, so that users can seamlessly access financial insurance web pages within the mini program, improving the consistency and convenience of the user experience. At the same time, the content of the web page can be displayed in a native way in the mini program, providing users with richer information and a better interactive experience.
[0045] S203: When the designated page is loaded, obtain and record the end time of the page loading.
[0046] In this embodiment, when the web page content is completely loaded and rendered on the front end, the performance API, such as performance.now(), can be called again to obtain a time record as the end time of page loading. Specifically, the loading events of the WebView component, such as the onLoad event, can be monitored to determine whether the specified page has been loaded, thereby accurately recording the end time point, so as to accurately calculate the total time required for page loading and reliably evaluate and optimize the performance of page loading.
[0047] S204: Calculate the page loading time according to the start time and the end time of the page loading, and perform performance analysis on the designated page according to the page loading time.
[0048] In this embodiment, the page loading time is calculated based on the acquired and recorded start time and end time of the page loading. The page loading time reflects the speed of the page loading. Therefore, the performance analysis of the specified page can be performed according to the calculated page loading time. For example, if the loading time is within 0-1 second, it is excellent; 1-3 seconds is good, and so on. Performance analysis can also be performed based on the historical loading time of the same page to obtain, for example, the average, maximum, and minimum values of the page loading time, as well as the distribution of the loading time over time, etc., so as to better obtain the changes in the loading performance of a certain page over time and better understand the performance bottleneck of page loading. For example, the page loading time in a certain time period is exceptionally long, so that targeted processing can be performed in this time period to improve the page loading speed and provide users with a smoother browsing experience.
[0049] This embodiment can quantitatively analyze the loading performance of the page through the start time and end time of the page loading, identify the page loading performance, and realize page loading monitoring without embedding additional monitoring scripts in the target page. It not only avoids the additional monitoring script loading time, but also does not require developers to make any modifications to the existing code, reducing the risk of introducing potential errors and complexities. At the same time, since there is no need to embed scripts, potential data security risks are eliminated, protecting the privacy of users and applications.
[0050] S205: Perform corresponding loading performance optimization processing on the designated page according to the resource loading level and performance analysis result of the designated page.
[0051] In this embodiment, in addition to performing performance analysis on the designated page based on the page loading time, the resource loading level is also distinguished according to the resource importance of different pages, so as to confirm the resource loading priority between different pages. For example, more important designated pages need to maintain a higher loading performance, so more resources can be allocated to ensure the loading speed of these pages, while less important designated pages may not require very high loading performance, and can be processed by, for example, asynchronous loading and sequential loading, so as not to block page rendering. Therefore, based on the resource loading level and performance analysis results of the designated page, the designated page can be flexibly optimized for loading performance, so as to achieve targeted optimization of the designated page and meet the loading requirements of different pages, so as to achieve a balance between response speed and resources.
[0052] In the above embodiment, the present invention discloses a method for monitoring and processing page loading performance, which obtains and records the start time of page loading in response to a page loading request; loads a specified page according to the page loading request, and displays the corresponding loading result on the front end; obtains and records the end time of page loading when the loading of the specified page is completed; calculates the page loading time according to the start time of page loading and the end time of page loading, and performs performance analysis on the specified page according to the page loading time; performs corresponding loading performance optimization processing on the specified page according to the resource loading level and performance analysis results of the specified page. By tracking the start and end time of page loading and calculating the page loading time, the page loading performance is evaluated in turn, and then targeted optimization processing is performed in combination with the resource loading level of the page, and the monitoring of page loading performance is achieved without embedding a monitoring script, avoiding the impact on the page loading speed and not increasing the monitoring cost.
[0053] In one embodiment, step S201 specifically includes:
[0054] In response to a request trigger operation input by a user, a corresponding page loading request is captured, a preset method is called at the capturing moment to obtain a current timestamp, and the current timestamp is recorded as the start time of the page loading.
[0055] In this embodiment, the user triggers a page loading request through an operation such as clicking on the front end, for example, clicking a link of an insurance product on the home page or product list page of the application, hoping to view the detailed information of the product. At this time, the event processing function of the front end will capture the page loading request. In the event processing function, once the user clicks the link, a preset method is immediately called to obtain the current Unix timestamp. This timestamp represents the number of seconds or milliseconds from January 1, 1970 (UTC) to the present.
[0056] For example, in a Java backend application, you can use System.currentTimeMillis() to get the current millisecond timestamp, and the obtained timestamp is recorded as the start time of loading the insurance product details page. This timestamp can be stored in the application's state manager, or as a variable in the current page controller for subsequent processing, thereby ensuring that the recorded timestamp accurately reflects the start time of the page loading request.
[0057] In one embodiment, Figure 3 As shown, step S202 includes:
[0058] S301, sending the page loading request to the back-end server, so that the back-end server parses the page loading request and obtains the request path, request method and request parameters;
[0059] S302, receiving the request response returned by the back-end server, loading and rendering the page according to the request response, and displaying the loading result of the specified page; wherein the request response is generated by the back-end server according to the request path, request method and request parameters.
[0060] In this embodiment, the front end sends a page loading request to the server through the WebView component, which can be a GET or POST request for obtaining the content of a specified page, such as requesting detailed page content of an insurance product. The back-end server receives the page loading request sent by the front end through the WebView component, parses the received page loading request, extracts the request path (URL), request method (GET, POST, etc.) and other accompanying request parameters (for example, in the query string of the URL or in the request body of a POST request). By parsing the request, the server can further implement security checks, such as verifying the legitimacy of the request parameters and preventing security threats such as SQL injection.
[0061] According to the parsed request information, the corresponding business logic is executed, such as querying the database to obtain detailed information of the insurance product, calling other services or performing calculations, etc., and then the page content to be sent to the front end is generated. At this time, an HTTP response is constructed, including a status code (such as 200 for success), a response header (such as content type) and a response body (i.e., page content), and the constructed response is sent back to the front end. The WebView component of the front end receives this response and starts to load and render the page content, thereby displaying the loading result of the specified page. For example, when the server generates an HTML page containing detailed information of the insurance product, this HTML is sent to the front end as the response body. After receiving this HTML content, the WebView component of the front end renders it as a page visible to the user. By processing the page loading request initiated by the front end through the WebView component in real time and generating a response, the latest data and information are provided to the user, ensuring that the user can see the latest and correct page content.
[0062] In one embodiment, Figure 4 As shown, step S203 includes:
[0063] S401, monitoring a preset event, wherein the preset event is triggered when the designated page is completely loaded;
[0064] S402: When the preset event is monitored, obtain a timestamp of the completion time from the preset event, and record it as the end time of the page loading.
[0065] In this embodiment, the front-end WebView component triggers a preset event, such as an onLoad event, after completing page loading. This event indicates that all the contents of the page (including HTML, CSS, JavaScript, and images and other resources) have been fully loaded and rendered. When the page is loaded, you can add code to the onLoad event to record the current timestamp, set a listener to listen to the event of page loading completion, so that you can get feedback on the completion of page loading in time. When listening to the preset event, get the timestamp of the completion time recorded in the preset event and record it as the end time of page loading. By recording the end time of page loading, you can analyze the performance of page loading and identify bottlenecks in the loading process.
[0066] In one embodiment, Figure 5 As shown, step S204 includes:
[0067] S501, calculating the difference between the start time of the page loading and the end time of the page loading to obtain the page loading time;
[0068] S502. Match the page loading time with a preset loading performance mapping table to determine the loading performance level of the specified page. The preset loading performance mapping table stores a mapping relationship between page loading times of different lengths and different loading performance levels.
[0069] In this embodiment, the start time and end time of page loading have been recorded. The start time is obtained when the user clicks a link or triggers a page loading action, and the end time is obtained when the page is fully loaded. Subtract the start time from the end time to get the page loading time. This time reflects the total time required from the start of loading to the completion of full loading. For example, if the start time is 10:00 AM and the end time is 10:05 AM, then the page loading time is 5 seconds. The page loading performance is measured by the page loading time, so as to compare the loading performance of different pages or under different conditions.
[0070] When performing performance analysis based on page loading time, a loading performance mapping table is pre-stored, which stores the mapping relationship between page loading times of different lengths and different loading performance levels. For example, the loading performance level of 0-1 second is "excellent", the loading performance level of 1-3 seconds is "good", the loading performance level of 3-5 seconds is "average", the loading performance level of 5-8 seconds is "slow", and the loading performance level of more than 8 seconds is "poor". The calculated page loading time is matched with the mapping table to determine the loading performance level of the page. For example, if the page loading time is 2 seconds, the loading performance level is "good". The page loading time is thus converted into a performance indicator to help developers understand the loading performance status of the page, so that optimization decisions can be made based on the loading performance level, such as adjusting the resource loading strategy or improving the front-end code.
[0071] In one embodiment, Figure 6 As shown, step S205 includes:
[0072] S601, obtaining a resource level identifier of the designated page, identifying a resource loading level of the designated page, wherein the resource loading level includes key resources and non-key resources;
[0073] S602: Determine and call a corresponding optimization strategy according to the resource loading level of the designated page and the loading performance level obtained by analysis, and perform loading performance optimization processing on the designated page using the optimization strategy.
[0074] In this embodiment, each page is pre-marked with a resource level identifier. For example, critical resources may be marked as "critical" and non-critical resources are marked as "non-critical". After the page is loaded, the resource loading level of the page is identified by checking these resource level identifiers, which can be obtained by checking the metadata, configuration file or priority of the resource request of the page. For example, for a financial insurance product details page, critical resources may include product introduction text, price information and a purchase button, while non-critical resources may be related information and advertisements at the bottom of the page. By identifying critical resources and non-critical resources, it can be clarified which resources should be loaded first and which can be loaded later, which helps to optimize the resource allocation of the server and the client, ensure that critical resources can be loaded quickly, and improve the user experience.
[0075] According to the resource loading level and analysis of the page, the loading performance level of the page is obtained. The front-end application determines and calls the corresponding optimization strategy. For example, if the page is a critical resource and the loading performance level is "average", the possible optimization strategies include preloading resources, optimizing server response time, or using CDN, etc. If the page is a non-critical resource and the loading performance level is "slow", the possible optimization strategies include delaying the loading of non-critical resources, compressing images, or merging CSS and JavaScript files, etc. By implementing targeted optimization strategies, the loading performance of different types of pages can be improved, network and server resources can be used more effectively, and unnecessary data transmission and loading time can be reduced.
[0076] In one embodiment, determining and calling a corresponding optimization strategy according to the resource loading level of the specified page and the loading performance level obtained by analysis, and performing loading performance optimization processing on the specified page by using the optimization strategy, includes:
[0077] When the designated page is a key resource, confirm whether the loading performance level is lower than the first performance level, and if so, call the optimization strategy of the key resource to perform loading performance optimization processing on the designated page;
[0078] When the designated page is a non-critical resource, confirm whether the loading performance level is lower than the second performance level, and if so, call the optimization strategy of the non-critical resource to perform loading performance optimization processing on the designated page;
[0079] The first performance level is higher than the second performance level.
[0080] In this embodiment, different optimization strategies can be set when optimizing the loading performance of pages for key resources and non-key resources. Among them, for key resources, such as the purchase page of financial insurance products, the front-end application sets a stricter first performance level (such as the "good" level corresponding to 1-3 seconds in the above embodiment), that is, the loading time of this page is considered unacceptable if it exceeds 3 seconds. When it is confirmed through the page loading time that the loading performance level of the current page is lower than the first performance level, the optimization strategy of key resources is called to optimize the loading performance of the page. The optimization strategy of key resources includes enabling local cache to reduce repeated requests to the server; optimizing the loading of images and scripts to ensure that they do not block page rendering; using server-side rendering (SSR) to increase the first screen loading speed, etc. By strictly controlling the loading time of key resources, any delays in key pages will be quickly optimized to ensure that users can quickly obtain important information to provide the best user experience.
[0081] For non-critical resources, such as advertisements or additional links, a relatively loose second performance level is set (such as the "slower" level corresponding to 5-8 seconds in the above embodiment), that is, the page loading time of non-critical resources can be within 8 seconds. If the page loading time of the designated page of the current non-critical resource obviously exceeds 8 seconds, that is, the loading performance level is lower than the second performance level, the optimization strategy of non-critical resources is triggered to optimize the loading performance of the page. The optimization strategy of non-critical resources includes implementing lazy loading, that is, only when the user scrolls to a specific part of the page, these resources are loaded; reduce the number of non-critical resources, or reduce their file size, etc. For non-critical resources, optimization will be performed only when the loading time significantly affects the user experience, avoiding unnecessary resource consumption. By distinguishing the optimization strategies for critical resources and non-critical resources, resources and optimization efforts can be allocated more effectively, ensuring user experience while also taking into account the cost-effectiveness of performance optimization.
[0082] It should be noted that there is not necessarily a certain order between the above-mentioned steps. A person skilled in the art can understand, based on the description of the embodiments of the present invention, that in different embodiments, the above-mentioned steps may have different execution orders, that is, they may be executed in parallel, may be executed interchangeably, and so on.
[0083] Further references Figure 7 , as a response to the above Figure 2 The present invention provides an embodiment of a monitoring and processing device for page loading performance, and the device embodiment is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0084] like Figure 7 As shown, the monitoring and processing device 70 for page loading performance described in this embodiment includes:
[0085] The start time recording module 701 is used to obtain and record the start time of page loading in response to a page loading request;
[0086] The page loading module 702 is used to load the specified page according to the page loading request and display the corresponding loading result on the front end;
[0087] The end time recording module 703 is used to obtain and record the end time of the page loading when the loading of the specified page is completed;
[0088] The performance analysis module 704 is used to calculate the page loading time according to the start time and the end time of the page loading, and perform performance analysis on the specified page according to the page loading time;
[0089] The performance optimization module 705 is used to perform corresponding loading performance optimization processing on the specified page according to the resource loading level and performance analysis result of the specified page.
[0090] The module referred to in the present invention refers to a series of computer program instruction segments that can perform specific functions, which is more suitable for describing the monitoring and processing execution process of page loading performance than a program. For the specific implementation of each module, please refer to the corresponding method embodiment above, which will not be repeated here.
[0091] In one embodiment, the start time recording module 701 is specifically used to:
[0092] In response to a request trigger operation input by a user, a corresponding page loading request is captured, a preset method is called at the capturing moment to obtain a current timestamp, and the current timestamp is recorded as the start time of the page loading.
[0093] In one embodiment, the page loading module 702 includes:
[0094] A parsing unit, used to send the page loading request to the back-end server, so that the back-end server parses the page loading request and obtains the request path, request method and request parameters;
[0095] A response loading unit is used to receive the request response returned by the back-end server, load and render the page according to the request response, and display the loading result of the specified page; wherein the request response is generated by the back-end server according to the request path, request method and request parameters.
[0096] In one embodiment, the end time recording module 703 includes:
[0097] A monitoring unit, used for monitoring a preset event, wherein the preset event is triggered when the specified page is completely loaded;
[0098] The acquisition unit is used to acquire the timestamp of the completion time from the preset event when monitoring the preset event, and record it as the end time of the page loading.
[0099] In one embodiment, the performance analysis module 704 includes:
[0100] A calculation unit, used to calculate the difference between the start time of the page loading and the end time of the page loading to obtain the page loading time;
[0101] A matching unit is used to match the page loading time with a preset loading performance mapping table to determine the loading performance level of the specified page. The preset loading performance mapping table stores the mapping relationship between page loading times of different lengths and different loading performance levels.
[0102] In one embodiment, performing corresponding loading performance optimization processing on the designated page according to the resource loading level and performance analysis result of the designated page includes:
[0103] Obtaining a resource level identifier of the designated page, and identifying a resource loading level of the designated page, wherein the resource loading level includes key resources and non-key resources;
[0104] According to the resource loading level of the designated page and the loading performance level obtained by analysis, a corresponding optimization strategy is determined and called, and the loading performance optimization processing of the designated page is performed through the optimization strategy.
[0105] In one embodiment, the performance optimization module 705 includes:
[0106] A first optimization unit is used to, when the designated page is a key resource, confirm whether the loading performance level is lower than the first performance level, and if so, call the optimization strategy of the key resource to perform loading performance optimization processing on the designated page;
[0107] A second optimization unit is used to, when the designated page is a non-critical resource, confirm whether the loading performance level is lower than the second performance level, and if so, call the optimization strategy of the non-critical resource to perform loading performance optimization processing on the designated page;
[0108] The first performance level is higher than the second performance level.
[0109] In the above embodiment, the present invention discloses a monitoring and processing device for page loading performance, which obtains and records the start time of page loading by responding to a page loading request; loads a specified page according to the page loading request, and displays the corresponding loading result on the front end; obtains and records the end time of page loading when the loading of the specified page is completed; calculates the page loading time according to the start time of page loading and the end time of page loading, and performs performance analysis on the specified page according to the page loading time; performs corresponding loading performance optimization processing on the specified page according to the resource loading level and performance analysis results of the specified page. By tracking the start and end time of page loading and calculating the page loading time, the page loading performance is evaluated in turn, and then targeted optimization processing is performed in combination with the resource loading level of the page, and the monitoring of page loading performance is achieved without embedding a monitoring script, avoiding the impact on the page loading speed and not increasing the monitoring cost.
[0110] Another embodiment of the present invention provides a computer device, such as Figure 8 As shown, the computer device 80 includes:
[0111] One or more processors 801 and memory 802, Figure 8 A processor 801 is used as an example for the description. The processor 801 and the memory 802 may be connected via a bus or other means. Figure 8 The example of connecting through bus is taken in the following.
[0112] Processor 801 is used to complete various control logics of computer device 80, and it can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a single-chip microcomputer, an ARM (Acorn RISC Machine) or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component or any combination of these components. In addition, processor 801 can also be any traditional processor, microprocessor or state machine. Processor 801 can also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a DSP and / or any other such configuration.
[0113] The memory 802 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions corresponding to the method for monitoring and processing page loading performance in the embodiment of the present invention. The processor 801 executes various functional applications and data processing of the computer device 80 by running the non-volatile software programs, instructions and units stored in the memory 802, that is, implements the method for monitoring and processing page loading performance in the above method embodiment.
[0114] The memory 802 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created according to the use of the computer device 80, etc. In addition, the memory 802 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 802 may optionally include a memory remotely arranged relative to the processor 801, and these remote memories may be connected to the computer device 80 via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof. One or more units are stored in the memory 802, and when executed by one or more processors 801, the steps of the monitoring and processing method for page loading performance in any of the above-mentioned method embodiments are executed.
[0115] In the above embodiment, the present invention discloses a computer device, which obtains and records the start time of page loading by responding to a page loading request; loads a specified page according to the page loading request, and displays the corresponding loading result on the front end; obtains and records the end time of page loading when the loading of the specified page is completed; calculates the page loading time according to the start time of page loading and the end time of page loading, and performs performance analysis on the specified page according to the page loading time; performs corresponding loading performance optimization processing on the specified page according to the resource loading level and performance analysis results of the specified page. By tracking the start and end time of page loading and calculating the page loading time, the page loading performance is evaluated in turn, and then targeted optimization processing is performed in combination with the resource loading level of the page, and the monitoring of page loading performance is achieved without embedding a monitoring script, avoiding the impact on the page loading speed and not increasing the monitoring cost.
[0116] An embodiment of the present invention provides a non-volatile computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by one or more processors, the steps of the page loading performance monitoring and processing method in any of the above method embodiments are executed.
[0117] In the above embodiment, the present invention discloses a non-volatile computer-readable storage medium, which obtains and records the start time of page loading in response to a page loading request; loads a specified page according to the page loading request, and displays the corresponding loading result on the front end; obtains and records the end time of page loading when the loading of the specified page is completed; calculates the page loading time according to the start time of page loading and the end time of page loading, and performs performance analysis on the specified page according to the page loading time; performs corresponding loading performance optimization processing on the specified page according to the resource loading level and performance analysis results of the specified page. By tracking the start and end time of page loading and calculating the page loading time, the page loading performance is evaluated in turn, and then targeted optimization processing is performed in combination with the resource loading level of the page, and the monitoring of page loading performance is achieved without embedding a monitoring script, avoiding the impact on the page loading speed and not increasing the monitoring cost.
[0118] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0119] The present invention can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present invention can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present invention can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0120] In summary, the present invention discloses a method, device, equipment and medium for monitoring and processing page loading performance, the method includes: in response to a page loading request, obtaining and recording the start time of page loading; loading a specified page according to the page loading request, and displaying the corresponding loading result on the front end; when the loading of the specified page is completed, obtaining and recording the end time of page loading; calculating the page loading time according to the start time of page loading and the end time of page loading, and performing performance analysis on the specified page according to the page loading time; performing corresponding loading performance optimization processing on the specified page according to the resource loading level and performance analysis results of the specified page. By tracking the start and end time of page loading and calculating the page loading time, the page loading performance is evaluated in turn, and then targeted optimization processing is performed in combination with the resource loading level of the page, and the monitoring of page loading performance is achieved without embedding a monitoring script, avoiding the impact on the page loading speed and not increasing the monitoring cost.
[0121] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium, and the computer program can include the processes of the above-mentioned method embodiments when executed. The storage medium can be a memory, a disk, a floppy disk, a flash memory, an optical storage device, etc.
[0122] It should be noted that if any software tools or components other than those of the Company appear in the embodiments of the present application, they are merely used for illustration and do not represent actual use. It should be understood that the application of the present invention is not limited to the above examples, and that those skilled in the art can make improvements or changes based on the above description, and all such improvements and changes shall fall within the scope of protection of the claims attached to the present invention.
Claims
1. A method for monitoring and processing page loading performance, characterized in that: include: In response to a page loading request, obtain and record the start time of the page loading; Load the specified page according to the page loading request, and display the corresponding loading result on the front end; When the specified page is loaded, obtain and record the end time of the page loading; Calculating the page loading time according to the start time of the page loading and the end time of the page loading, and performing performance analysis on the designated page according to the page loading time; According to the resource loading level and performance analysis result of the designated page, corresponding loading performance optimization processing is performed on the designated page.
2. The method for monitoring and processing page loading performance according to claim 1, characterized in that: The step of obtaining and recording the start time of the page loading in response to the page loading request specifically includes: In response to a request trigger operation input by a user, a corresponding page loading request is captured, a preset method is called at the capturing moment to obtain a current timestamp, and the current timestamp is recorded as the start time of the page loading.
3. The method for monitoring and processing page loading performance according to claim 1, characterized in that: The loading of the specified page according to the page loading request and displaying the corresponding loading result on the front end include: Sending the page loading request to the back-end server so that the back-end server parses the page loading request and obtains the request path, request method and request parameters; Receive the request response returned by the back-end server, load and render the page according to the request response, and display the loading result of the specified page; wherein the request response is generated by the back-end server according to the request path, request method and request parameters.
4. The method for monitoring and processing page loading performance according to claim 1, characterized in that: When the specified page is loaded, the end time of the page loading is obtained and recorded, including: Listening to a preset event, wherein the preset event is triggered when the specified page is completely loaded; When the preset event is monitored, the timestamp of the completion time is obtained from the preset event and recorded as the end time of the page loading.
5. The method for monitoring and processing page loading performance according to claim 1, characterized in that: The calculating the page loading time according to the start time and the end time of the page loading, and performing performance analysis on the designated page according to the page loading time, includes: Calculate the difference between the start time of the page loading and the end time of the page loading to obtain the page loading time; The page loading time is matched with a preset loading performance mapping table to determine the loading performance level of the specified page. The preset loading performance mapping table stores a mapping relationship between page loading times of different lengths and different loading performance levels.
6. The method for monitoring and processing page loading performance according to claim 5, characterized in that: The performing corresponding loading performance optimization processing on the designated page according to the resource loading level and performance analysis result of the designated page includes: Obtaining a resource level identifier of the designated page, and identifying a resource loading level of the designated page, wherein the resource loading level includes key resources and non-key resources; According to the resource loading level of the designated page and the loading performance level obtained by analysis, a corresponding optimization strategy is determined and called, and the loading performance optimization processing of the designated page is performed through the optimization strategy.
7. The method for monitoring and processing page loading performance according to claim 6, characterized in that: The step of determining and calling a corresponding optimization strategy according to the resource loading level of the designated page and the loading performance level obtained by analysis, and performing loading performance optimization processing on the designated page by using the optimization strategy, includes: When the designated page is a key resource, confirm whether the loading performance level is lower than the first performance level, and if so, call the optimization strategy of the key resource to perform loading performance optimization processing on the designated page; When the designated page is a non-critical resource, confirm whether the loading performance level is lower than the second performance level, and if so, call the optimization strategy of the non-critical resource to perform loading performance optimization processing on the designated page; The first performance level is higher than the second performance level.
8. A monitoring and processing device for page loading performance, characterized in that: include: A start time recording module, used to obtain and record the start time of page loading in response to a page loading request; The page loading module is used to load the specified page according to the page loading request and display the corresponding loading result on the front end; An end time recording module, used to obtain and record the end time of page loading when the specified page loading is completed; A performance analysis module, used to calculate the page loading time according to the start time and the end time of the page loading, and perform performance analysis on the specified page according to the page loading time; The performance optimization module is used to perform corresponding loading performance optimization processing on the specified page according to the resource loading level and performance analysis result of the specified page.
9. A computer device, characterized in that: comprising at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the page loading performance monitoring and processing method described in any one of claims 1-7.
10. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores computer-executable instructions, which, when executed by one or more processors, enable the one or more processors to execute the page loading performance monitoring and processing method described in any one of claims 1-7.