Model training method, method for processing performance data and related device
By acquiring and analyzing web page performance data, using model training methods to identify performance influencing factors and generate optimization suggestions, the performance bottleneck identification problem caused by the lack of precise data in traditional methods is solved, and efficient web page performance analysis and optimization are achieved.
Patent Information
- Application Number
- CN202411781883.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-04-22
AI Technical Summary
Traditional performance monitoring and optimization solutions lack precise data and are difficult to identify and locate performance bottlenecks, making it difficult to achieve expectations.
By obtaining performance-related data of multiple target web pages, extracting target variable data and feature variable data, using model training methods to identify factors that affect page performance, and analyzing the performance data of the to be processed web pages through the trained model to generate optimization suggestions.
It improves the pertinence and efficiency of web page performance analysis, can identify known performance factors and predict the performance performance of new or updated web pages, provide scientific basis for performance optimization, automation provides optimization suggestions, and reduce manual analysis workload.
Smart Images

Figure CN119862466A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a model training method, a method, a device, an electronic device, a computer-readable medium, and a computer program product for processing performance data. Background Art
[0002] As the complexity of network applications grows, users' expectations for web page loading speed and interactive response also increase. In the modern network environment, performance has become a core factor in determining the quality of user experience. However, in the face of this growing demand, traditional performance monitoring and optimization solutions lack accurate data, making it difficult for developers to accurately identify and locate performance bottlenecks without sufficient data support. This not only limits the implementation of optimization measures, but also makes it difficult for optimization results to achieve expected results. Summary of the invention
[0003] Multiple aspects of the present application provide a model training method, a method for processing performance data, an apparatus, an electronic device, a computer-readable medium, and a computer program product.
[0004] In one aspect of the present application, a model training method is provided, wherein the method comprises:
[0005] Obtaining performance-related data corresponding to a plurality of target web pages;
[0006] Based on the performance-related data, extracting target variable data and feature variable data for training a model;
[0007] Based on the target variable data and the feature variable data, a model is trained so that the model learns the relationship between the target variable data and the feature variable data, thereby identifying factors that affect page performance.
[0008] In one aspect of the present application, a method for processing performance data is provided, wherein the method comprises:
[0009] Obtaining performance-related data corresponding to the web page to be processed;
[0010] Analyzing the performance-related data by using the trained model to obtain analysis result information output by the model;
[0011] The model is obtained by training the model training method described in the embodiment of the present application. In one aspect of the present application, a model training device is provided, wherein the model training device includes:
[0012] means for obtaining performance-related data corresponding to a plurality of target web pages;
[0013] means for extracting target variable data and feature variable data for training a model based on the performance-related data;
[0014] A device for identifying factors affecting page performance by training a model based on the target variable data and the feature variable data so that the model learns the relationship between the target variable data and the feature variable data.
[0015] In one aspect of the present application, a device for processing performance data is provided, wherein the device comprises:
[0016] Means for obtaining performance-related data corresponding to the web page to be processed;
[0017] A device for analyzing the performance-related data by using a trained model to obtain analysis result information output by the model;
[0018] Wherein, the model is trained by the model training method described in the embodiment of the present application.
[0019] Another aspect of the present application provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method of an embodiment of the present application.
[0020] In another aspect of the present application, a computer-readable storage medium is provided, on which computer program instructions are stored. The computer program instructions can be executed by a processor to implement the method of the embodiment of the present application.
[0021] Another aspect of the present application provides a computer program product, including a computer program, which implements the method of the embodiment of the present application when executed by a processor.
[0022] In the solution provided in the embodiment of the present application, by obtaining performance-related data of multiple target web pages and extracting target variables and feature variables from the collected data, the focus is on the data most relevant to the performance impact, thereby improving the pertinence and efficiency of web page performance analysis; the model trained using the solution based on the embodiment of the present application can not only identify known performance influencing factors, but also predict the performance of new or updated web pages, providing a scientific basis for performance optimization; based on the analysis results of the model, the solution of the embodiment of the present application can automatically provide optimization suggestions, reduce the workload of manual analysis, and improve the efficiency and quality of optimization decisions; the model of the embodiment of the present application can be sustainably applied to newly collected data to achieve continuous monitoring of web page performance and timely discovery of new performance problems. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0024] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
[0025] Figure 1 A flow chart of a model training method provided in an embodiment of the present application is shown;
[0026] Figure 2 A schematic flow chart of a method for processing performance data according to an embodiment of the present application is shown;
[0027] Figure 3 A schematic diagram of the structure of a device for training a model provided in an embodiment of the present application is shown;
[0028] Figure 4 A schematic diagram of the structure of a device for processing performance data provided by an embodiment of the present application is shown;
[0029] Figure 5 A schematic diagram of the structure of a device suitable for implementing the solution in the embodiment of the present application is shown.
[0030] The same or similar reference numerals in the drawings represent the same or similar components. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0032] In a typical configuration of the present application, the terminal and the equipment of the service network each include one or more processors (CPU), input / output interface, network interface and memory.
[0033] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0034] Computer readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer program instructions, data structures, modules of programs or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0035] Figure 1 A flow chart of a model training method provided in an embodiment of the present application is shown. The method at least includes step S101, step S102 and step S103.
[0036] In actual scenarios, the execution subject of the method can be a network device, or an application running on a network device, wherein the network device includes but is not limited to a network host, a single network server, a plurality of network server sets, or a collection of computers based on cloud computing, and can be used to implement some processing functions when setting an alarm. Here, the cloud is composed of a large number of hosts or network servers based on cloud computing, wherein cloud computing is a type of distributed computing, a virtual computer composed of a group of loosely coupled computer sets.
[0037] Reference Figure 1 In step S101, performance-related data corresponding to a plurality of target web pages is obtained.
[0038] The performance-related data includes various data that can be used to indicate the response speed and interaction fluency of the page.
[0039] According to one embodiment, the performance-related data includes but is not limited to at least any one of the following performance indicators:
[0040] 1) Page loading time: Page loading time (PLT) refers to the total time required from the time a user starts requesting a web page to the time the page is fully loaded. This indicator includes the time for all steps such as DNS resolution, TCP connection, resource request, resource download, and page rendering. Page loading time is a macro indicator for measuring web page performance, which reflects the total time a user waits for a page to be available;
[0041] 2) First Contentful Paint: First Contentful Paint (FCP) refers to the time when the browser first draws any content (such as text or images) from the DOM after the page starts loading. FCP is one of the key indicators for measuring web page performance. A lower FCP value means that users can see the page content faster.
[0042] 3) Largest Contentful Paint: Largest Contentful Paint (LCP) refers to the time it takes for the browser to render the largest block of text or image in a page during page loading. LCP focuses on the speed at which the main content of the page loads, and is crucial to the time it takes for users to perceive that the page has finished loading.
[0043] 4) Interactive time: Time to Interactive (TTI) refers to the time it takes for a page to reliably respond to user input from the beginning of loading. A lower TTI value means that users can interact with the page faster.
[0044] Specifically, use specific tools and APIs to monitor and record key performance data of web pages during loading and execution. For example, use the Performance API provided by the browser. The Performance API is a powerful tool that allows developers to access and analyze performance data during page loading.
[0045] According to one embodiment, step S101 includes step S1011 and step S1012.
[0046] In step S1011, a plurality of target web pages for model training are determined.
[0047] Among them, those skilled in the art may select which web pages to use as target web pages based on actual needs, for example, web pages related to a specific business, web pages with high traffic, or web pages containing multiple types of page elements, etc.
[0048] In step S1012, the performance-related data of the multiple target test web pages during the loading process are obtained through the API set of the browser.
[0049] According to one embodiment, the performance-related data is obtained using the browser's Performance API.
[0050] Specifically, when obtaining the page loading time, the page loading time is obtained by calculating the time difference between the loadEventEnd event and the navigationStart event. The loadEventEnd event indicates the time point when the page loading is completed, including that all resources (such as images, scripts, etc.) have been loaded. The navigationStart event indicates the time point when the browser starts navigating to a new page.
[0051] When obtaining the first content drawing, use PerformanceObserver to listen to the paint event and obtain the time point of the first drawing. The paint event refers to the time point when the browser first draws the content to the screen, that is, the key moment when the user begins to see the page content. Through PerformanceObserver, you can monitor and obtain this time point to analyze the rendering performance of the page.
[0052] When obtaining the largest content painting, the time point of the largest content painting is obtained by using PerformanceObserver to listen to the largest-contentful-paint event. The largest-contentful-paint event refers to the time point when the largest text block or image in the page is drawn to the screen.
[0053] When obtaining the interactive time, the time when the page reaches the interactive state is obtained by calculating the time difference between domInteractive and navigationStart. Among them, the domInteractive event indicates that the DOM has been fully parsed and the page is interactive.
[0054] According to an embodiment, the performance-related data further includes the loading time of each page element in the web page. In step S101, for each target web page, the loading time of one or more page elements in the target web page is obtained.
[0055] The page elements include but are not limited to pictures, text content, flash objects, CSS styles, etc.
[0056] Specifically, the method may use the browser's Performance API to measure the loading time of each page element. For example, all performance entries may be obtained through performance.getEntries(), and then entries of a specific type, such as the 'element' type, may be filtered out.
[0057] In step S102, target variable data and feature variable data for training a model are extracted based on the performance-related data.
[0058] The target variable data is the variable that the model is expected to predict or classify, and the feature variable data is the input data used by the model to make predictions.
[0059] According to one embodiment, the target variable data includes one or more predetermined data for indicating page performance, such as page loading time. The characteristic variable data includes factors indicative of the web page that may affect page performance, such as the size, quantity, type, etc. of page resources.
[0060] In step S103, based on the target variable data and the feature variable data, a model is trained so that the model learns the relationship between the target variable data and the feature variable data, thereby identifying factors that affect page performance.
[0061] According to one embodiment, the method further includes step S104 before step S103.
[0062] In step S104, the target variable data and feature variable data are preprocessed.
[0063] The preprocessing operations include but are not limited to processing missing values, outliers and data standardization.
[0064] According to one embodiment, the method trains the model by a linear regression algorithm in step S103, so that the model learns the linear relationship between the target variable data and the feature variable data.
[0065] The linear regression algorithm is used to predict the relationship between the target variable and multiple features. The linear regression model assumes that there is a linear relationship between the target variable and the feature variables. By calculating this relationship, the method can predict the page performance under different conditions and optimize the web page accordingly.
[0066] According to one embodiment, the linear regression algorithm used in the embodiment of the present application is expressed as:
[0067] y=β0+β1x1+β2x2+…+βnxn+∈ (1)
[0068] Among them, y represents the target variable (such as page loading time), x1, x2, …, xn represent feature variables (such as the size, quantity, type, etc. of page resources), β0 is the intercept term, which represents the expected value of the target variable when all feature variables are zero, β1, β2, …, βn are the coefficients of the feature variables, which represent the influence of each feature variable on the target variable, and ∈ is the error term, which represents the difference between the model predicted value and the actual value.
[0069] According to one embodiment, the method trains the model by a random forest regression algorithm in step S103, so that the model learns the complex nonlinear relationship between the target variable data and the feature variable data.
[0070] Among them, the random forest regression algorithm makes predictions by building multiple decision trees. Each decision tree randomly selects samples and features during training, which can increase the diversity of the model and reduce the risk of overfitting. Random forest can capture the complex nonlinear relationship between the target variable and the feature variable because it can build multiple models to learn different patterns in the data and summarize the results of these models to improve the accuracy and robustness of the prediction.
[0071] It should be noted that in addition to the linear regression algorithm and random forest regression algorithm mentioned above, the embodiments of the present application can also use a variety of other algorithms to train the model, such as decision trees, gradient boosting trees, support vector machines or neural networks, etc. Technical personnel in this field can choose a suitable algorithm to train the model based on actual needs.
[0072] According to one embodiment, the model is trained to analyze the collected performance data and output corresponding analysis result information.
[0073] The analysis result information includes performance prediction information for the current web page. Optionally, the analysis result is visualized information, such as a chart.
[0074] For example, use a visualization tool such as Chart.js to create a bar chart. In the bar chart, use performance indicators such as page load time (PLT), largest content paint (FCP), largest content paint (LCP), interactive time (TTI) as chart labels, and use the collected performance data as chart data points. Next, configure the Y axis of the chart to start from zero to more clearly show the changes in performance indicators.
[0075] According to one embodiment, the analysis result information includes the identified performance bottleneck. The model is trained to determine whether a page performance bottleneck occurs based on the acquired performance-related data; if a page performance bottleneck occurs, one or more causes of the bottleneck are analyzed based on the performance-related data, and corresponding analysis result information is generated.
[0076] According to one embodiment, the model is trained to analyze the collected performance data and generate corresponding performance optimization suggestions based on the analysis result output.
[0077] The performance optimization suggestions include but are not limited to resource compression, lazy loading, code segmentation, and cache. Performance optimization is a continuous process that requires continuous adjustment of optimization strategies based on performance data. For example, for image resources, lazy loading technology can be used, that is, the image is loaded only when it enters the viewport, thereby reducing the first screen loading time.
[0078] According to the method of the embodiment of the present application, by obtaining performance-related data of multiple target web pages, extracting target variables and feature variables from the collected data, and then analyzing the data most relevant to the performance impact, the pertinence and efficiency of web page performance analysis are improved; the model trained using the solution based on the embodiment of the present application can not only identify known performance influencing factors, but also predict the performance of new or updated web pages, providing a scientific basis for performance optimization; based on the analysis results of the model, the solution of the embodiment of the present application can automatically provide optimization suggestions, reduce the workload of manual analysis, and improve the efficiency and quality of optimization decisions; the model of the embodiment of the present application can be sustainably applied to newly collected data to achieve continuous monitoring of web page performance and timely discovery of new performance problems.
[0079] Figure 2 A flow chart of a method for processing performance data according to an embodiment of the present application is shown. Figure 2 The steps shown include step S201 and step S202.
[0080] Reference Figure 2 In step S201, performance-related data corresponding to the web page to be processed is obtained.
[0081] The performance-related data and its acquisition process have been described in the above steps S101 to S103 and will not be repeated here.
[0082] In step S202, the performance-related data is analyzed by using the trained model to obtain analysis result information output by the model.
[0083] The trained model is obtained by training through the above steps S101 to S103.
[0084] The analysis result information includes performance prediction information of the web page to be processed. Optionally, the analysis result is visualized information, such as a chart.
[0085] According to one embodiment, the analysis result information includes the identified performance bottleneck. The method determines whether a page performance bottleneck occurs based on the acquired performance-related data; if a page performance bottleneck occurs, one or more causes of the bottleneck are analyzed based on the performance-related data, and corresponding analysis result information is generated.
[0086] For example, if the page loading time exceeds the set threshold, or indicators such as FCP, LCP, TTI, etc. are outside the expected range, it is considered that a performance bottleneck has occurred. If a performance bottleneck is confirmed, one or more causes of the bottleneck are further analyzed. Among them, possible causes include: resource loading problems: analyze the size and loading time of resource files, identify large files or slow-loading resources; server response time: check the server response time to determine whether the delay is caused by insufficient server performance; code execution efficiency: analyze JavaScript execution time, identify long-running scripts or code that blocks the main thread.
[0087] According to one embodiment, the model analyzes the collected performance data and generates corresponding performance optimization suggestions based on the analysis results, wherein the performance optimization suggestions include but are not limited to resource compression, lazy loading, code segmentation, cache utilization, etc.
[0088] According to one embodiment, the method periodically executes step S201 and step S202, thereby continuously collecting and monitoring the performance-related data of the web page.
[0089] According to the method of the embodiment of the present application, by using the trained model, not only the known performance influencing factors can be identified, but also the performance of new or updated web pages can be predicted, providing a scientific basis for performance optimization; based on the analysis results of the model, the scheme of the embodiment of the present application can automatically provide optimization suggestions, reduce the workload of manual analysis, and improve the efficiency and quality of optimization decisions; the model of the embodiment of the present application can be sustainably applied to newly collected data to achieve continuous monitoring of web page performance and timely discovery of new performance problems.
[0090] Figure 3 A schematic diagram of the structure of a device for training a model provided in an embodiment of the present application is shown.
[0091] The device includes: a device for acquiring performance-related data corresponding to multiple target web pages (hereinafter referred to as "performance data acquisition device 101"), a device for extracting target variable data and feature variable data for training a model based on the performance-related data (hereinafter referred to as "variable data acquisition device 102"), and a device for training a model based on the target variable data and feature variable data so that the model learns the relationship between the target variable data and the feature variable data, thereby identifying factors that affect page performance (hereinafter referred to as "model training device 103").
[0092] Reference Figure 3 The performance data acquisition device 101 acquires performance-related data corresponding to multiple target web pages.
[0093] The performance-related data includes various data that can be used to indicate the response speed and interaction fluency of the page.
[0094] According to one embodiment, the performance-related data includes but is not limited to at least any one of the following performance indicators:
[0095] 1) Page loading time: Page loading time (PLT) refers to the total time required from the time a user starts requesting a web page to the time the page is fully loaded. This indicator includes the time for all steps such as DNS resolution, TCP connection, resource request, resource download, and page rendering. Page loading time is a macro indicator for measuring web page performance, which reflects the total time a user waits for a page to be available;
[0096] 2) First Contentful Paint: First Contentful Paint (FCP) refers to the time when the browser first draws any content (such as text or images) from the DOM after the page starts loading. FCP is one of the key indicators for measuring web page performance. A lower FCP value means that users can see the page content faster.
[0097] 3) Largest Contentful Paint: Largest Contentful Paint (LCP) refers to the time it takes for the browser to render the largest block of text or image in a page during page loading. LCP focuses on the speed at which the main content of the page loads, and is crucial to the time it takes for users to perceive that the page has finished loading.
[0098] 4) Interactive time: Time to Interactive (TTI) refers to the time it takes for a page to reliably respond to user input from the beginning of loading. A lower TTI value means that users can interact with the page faster.
[0099] Specifically, use specific tools and APIs to monitor and record key performance data of web pages during loading and execution. For example, use the Performance API provided by the browser. The Performance API is a powerful tool that allows developers to access and analyze performance data during page loading.
[0100] According to one embodiment, the performance data acquisition device 101 includes a target webpage determination device and a target performance acquisition device.
[0101] The target webpage determining device determines a plurality of target webpages for model training.
[0102] Among them, those skilled in the art may select which web pages to use as target web pages based on actual needs, for example, web pages related to a specific business, web pages with high traffic, or web pages containing multiple types of page elements, etc.
[0103] The target performance acquisition device acquires the performance-related data of the multiple target test web pages during the loading process through the browser's API set.
[0104] According to one embodiment, the target performance acquisition device uses the browser's Performance API to acquire the performance-related data.
[0105] Specifically, when obtaining the page loading time, the page loading time is obtained by calculating the time difference between the loadEventEnd event and the navigationStart event. The loadEventEnd event indicates the time point when the page loading is completed, including that all resources (such as images, scripts, etc.) have been loaded. The navigationStart event indicates the time point when the browser starts navigating to a new page.
[0106] When obtaining the first content drawing, use PerformanceObserver to listen to the paint event and obtain the time point of the first drawing. The paint event refers to the time point when the browser first draws the content to the screen, that is, the key moment when the user begins to see the page content. Through PerformanceObserver, you can monitor and obtain this time point to analyze the rendering performance of the page.
[0107] When obtaining the largest content painting, the time point of the largest content painting is obtained by using PerformanceObserver to listen to the largest-contentful-paint event. The largest-contentful-paint event refers to the time point when the largest text block or image in the page is drawn to the screen.
[0108] When obtaining the interactive time, the time when the page reaches the interactive state is obtained by calculating the time difference between domInteractive and navigationStart. Among them, the domInteractive event indicates that the DOM has been fully parsed and the page is interactive.
[0109] According to an embodiment, the performance-related data further includes the loading time of each page element in the web page, and the performance data acquisition device 101 acquires the loading time of one or more page elements in each target web page.
[0110] The page elements include but are not limited to pictures, text content, flash objects, CSS styles, etc.
[0111] Specifically, the performance data acquisition device 101 may use the browser's Performance API to measure the loading time of each page element. For example, all performance entries may be acquired through performance.getEntries(), and then entries of a specific type, such as the 'element' type, may be filtered out.
[0112] Continue to refer to Figure 3 To explain, the variable data acquisition device 102 extracts the target variable data and feature variable data for training the model based on the performance-related data.
[0113] The target variable data is the variable that the model is expected to predict or classify, and the feature variable data is the input data used by the model to make predictions.
[0114] According to one embodiment, the target variable data includes one or more predetermined data for indicating page performance, such as page loading time. The characteristic variable data includes factors indicative of the web page that may affect page performance, such as the size, quantity, type, etc. of page resources.
[0115] The model training device 103 trains a model based on the target variable data and the feature variable data so that the model learns the relationship between the target variable data and the feature variable data, thereby identifying factors that affect page performance.
[0116] According to one embodiment, the device further comprises a data preprocessing device.
[0117] Before the operation of the model training device 103, the data preprocessing device preprocesses the target variable data and the feature variable data.
[0118] The preprocessing operations include but are not limited to processing missing values, outliers and data standardization.
[0119] According to one embodiment, the model training device 103 trains the model through a linear regression algorithm so that the model learns the linear relationship between the target variable data and the feature variable data.
[0120] The linear regression algorithm is used to predict the relationship between the target variable and multiple features. The linear regression model assumes that there is a linear relationship between the target variable and the feature variables. By calculating this relationship, the method can predict the page performance under different conditions and optimize the web page accordingly.
[0121] According to one embodiment, the model training device 103 trains the model by using a random forest regression algorithm, so that the model learns the complex nonlinear relationship between the target variable data and the feature variable data.
[0122] Among them, the random forest regression algorithm makes predictions by building multiple decision trees. Each decision tree randomly selects samples and features during training, which can increase the diversity of the model and reduce the risk of overfitting. Random forest can capture the complex nonlinear relationship between the target variable and the feature variable because it can build multiple models to learn different patterns in the data and summarize the results of these models to improve the accuracy and robustness of the prediction.
[0123] It should be noted that in addition to the linear regression algorithm and random forest regression algorithm mentioned above, the model training device 103 of the embodiment of the present application can also use a variety of other algorithms to train the model, such as decision trees, gradient boosting trees, support vector machines or neural networks, etc. Those skilled in the art can choose a suitable algorithm to train the model based on actual needs.
[0124] According to one embodiment, the model is trained to analyze the collected performance data and output corresponding analysis result information.
[0125] The analysis result information includes performance prediction information for the current web page. Optionally, the analysis result is visualized information, such as a chart.
[0126] For example, use a visualization tool such as Chart.js to create a bar chart. In the bar chart, use performance indicators such as page load time (PLT), largest content paint (FCP), largest content paint (LCP), interactive time (TTI) as chart labels, and use the collected performance data as chart data points. Next, configure the Y axis of the chart to start from zero to more clearly show the changes in performance indicators.
[0127] According to one embodiment, the analysis result information includes the identified performance bottleneck. The model is trained to determine whether a page performance bottleneck occurs based on the acquired performance-related data; if a page performance bottleneck occurs, one or more causes of the bottleneck are analyzed based on the performance-related data, and corresponding analysis result information is generated.
[0128] According to one embodiment, the model is trained to analyze the collected performance data and generate corresponding performance optimization suggestions based on the analysis result output.
[0129] The performance optimization suggestions include but are not limited to resource compression, lazy loading, code segmentation, and cache. Performance optimization is a continuous process that requires continuous adjustment of optimization strategies based on performance data. For example, for image resources, lazy loading technology can be used, that is, the image is loaded only when it enters the viewport, thereby reducing the first screen loading time.
[0130] According to the device of the embodiment of the present application, by obtaining performance-related data of multiple target web pages, extracting target variables and feature variables from the collected data, and then analyzing the data most relevant to the performance impact, the pertinence and efficiency of web page performance analysis are improved; the model trained using the solution based on the embodiment of the present application can not only identify known performance influencing factors, but also predict the performance of new or updated web pages, providing a scientific basis for performance optimization; based on the analysis results of the model, the solution of the embodiment of the present application can automatically provide optimization suggestions, reduce the workload of manual analysis, and improve the efficiency and quality of optimization decisions; the model of the embodiment of the present application can be sustainably applied to newly collected data to achieve continuous monitoring of web page performance and timely discovery of new performance problems.
[0131] Figure 4 A schematic diagram of the structure of a device for processing performance data provided in an embodiment of the present application is shown.
[0132] The device includes: a device for obtaining performance-related data corresponding to the web page to be processed (hereinafter referred to as "data obtaining device 201"), and a device for analyzing the performance-related data by using a trained model to obtain analysis result information output by the model (hereinafter referred to as "data processing device 202").
[0133] Reference Figure 4 The data acquisition device 201 acquires the performance-related data corresponding to the web page to be processed.
[0134] The performance-related data and its acquisition process have been described in the above step S101 and will not be repeated here.
[0135] The data processing device 202 analyzes the performance-related data by using the trained model to obtain analysis result information output by the model.
[0136] The trained model is obtained by training through the above steps S101 to S103.
[0137] The analysis result information includes performance prediction information of the web page to be processed. Optionally, the analysis result is visualized information, such as a chart.
[0138] According to one embodiment, the analysis result information includes the identified performance bottleneck. The method determines whether a page performance bottleneck occurs based on the acquired performance-related data; if a page performance bottleneck occurs, one or more causes of the bottleneck are analyzed based on the performance-related data, and corresponding analysis result information is generated.
[0139] For example, if the page loading time exceeds the set threshold, or indicators such as FCP, LCP, TTI, etc. are outside the expected range, it is considered that a performance bottleneck has occurred. If a performance bottleneck is confirmed, one or more causes of the bottleneck are further analyzed. Among them, possible causes include: resource loading problems: analyze the size and loading time of resource files, identify large files or slow-loading resources; server response time: check the server response time to determine whether the delay is caused by insufficient server performance; code execution efficiency: analyze JavaScript execution time, identify long-running scripts or code that blocks the main thread.
[0140] According to one embodiment, the model analyzes the collected performance data and generates corresponding performance optimization suggestions based on the analysis results, wherein the performance optimization suggestions include but are not limited to resource compression, lazy loading, code segmentation, cache utilization, etc.
[0141] According to one embodiment, the method periodically executes the operations of the data acquisition device 201 and the data processing device 202, thereby continuously collecting and monitoring the performance-related data of the web page.
[0142] According to the device of the embodiment of the present application, by using the trained model, not only the known performance influencing factors can be identified, but also the performance of new or updated web pages can be predicted, providing a scientific basis for performance optimization; based on the analysis results of the model, the scheme of the embodiment of the present application can automatically provide optimization suggestions, reduce the workload of manual analysis, and improve the efficiency and quality of optimization decisions; the model of the embodiment of the present application can be sustainably applied to newly collected data to achieve continuous monitoring of web page performance and timely discovery of new performance problems.
[0143] Based on the same inventive concept, an electronic device is also provided in an embodiment of the present application, and the method corresponding to the electronic device may be the method in the aforementioned embodiment, and its principle of solving the problem is similar to that of the method. The electronic device provided in an embodiment of the present application includes: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the methods and / or technical solutions of the aforementioned multiple embodiments of the present application.
[0144] The electronic device may be a user device, or a device formed by integrating a user device and a network device through a network, or may be an application running on the above device. The user device includes but is not limited to various terminal devices such as computers, mobile phones, tablet computers, smart watches, and bracelets. The network device includes but is not limited to network hosts, single network servers, multiple network server sets, or cloud computing-based computer sets, which can be used to implement some processing functions when setting an alarm. Here, the cloud is composed of a large number of hosts or network servers based on cloud computing, where cloud computing is a type of distributed computing, a virtual computer composed of a group of loosely coupled computer sets.
[0145] Figure 5 The structure of a device suitable for implementing the method and / or technical solution in the embodiment of the present application is shown, and the device 1200 includes a central processing unit (CPU, Central Processing Unit) 1201, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM, Read Only Memory) 1202 or the program loaded from the storage part 1208 to the random access memory (RAM, Random Access Memory) 1203. In RAM1203, various programs and data required for system operation are also stored. CPU 1201, ROM 1202 and RAM 1203 are connected to each other through bus 1204. Input / output (I / O, Input / Output) interface 1205 is also connected to bus 1204.
[0146] The following components are connected to the I / O interface 1205: an input section 1206 including a keyboard, a mouse, a touch screen, a microphone, an infrared sensor, etc.; an output section 1207 including a cathode ray tube (CRT), a liquid crystal display (LCD), an LED display, an OLED display, etc., and a speaker, etc.; a storage section 1208 including one or more computer-readable media such as a hard disk, an optical disk, a magnetic disk, a semiconductor memory, etc.; and a communication section 1209 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1209 performs communication processing via a network such as the Internet.
[0147] In particular, the methods and / or embodiments in the embodiments of the present application may be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. When the computer program is executed by the central processing unit (CPU) 1201, the above functions defined in the method of the present application are executed.
[0148] Another embodiment of the present application further provides a computer-readable storage medium having computer program instructions stored thereon, wherein the computer program instructions can be executed by a processor to implement the methods and / or technical solutions of any one or more embodiments of the present application described above.
[0149] Specifically, the present embodiment may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device, or device.
[0150] Computer readable signal media may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer readable program code. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than a computer readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0151] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0152] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0153] The flow chart or block diagram in the accompanying drawings shows the possible architecture, function and operation of the equipment, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated system for hardware that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0154] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0155] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or page components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0156] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0157] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0158] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
[0159] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
[0160] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in a device claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
Claims
1. A model training method, wherein: The method comprises: Obtaining performance-related data corresponding to a plurality of target web pages; Based on the performance-related data, extracting target variable data and feature variable data for training a model; Based on the target variable data and the feature variable data, a model is trained so that the model learns the relationship between the target variable data and the feature variable data, thereby identifying factors that affect page performance.
2. The method according to claim 1, wherein: The relationship between the target variable data and the feature variable data is learned by training the model, including: The model is trained through a linear regression algorithm so that the model learns the linear relationship between the target variable data and the feature variable data.
3. The method according to claim 1, wherein: The relationship between the target variable data and the feature variable data is learned by training the model, including: The model is trained by the random forest regression algorithm, so that the model can learn the complex nonlinear relationship between the target variable data and the feature variable data.
4. The method according to claim 1, wherein: The obtaining of performance-related data corresponding to the plurality of target web pages includes: Identify multiple target web pages for model training; The performance related data of the multiple target test web pages during the loading process are obtained through the API set of the browser.
5. The method according to any one of claims 1 to 4, wherein: The performance-related data also includes the loading time of each page element in the web page, and the obtaining of the performance-related data corresponding to the plurality of target web pages includes: For each target web page, the loading time of one or more page elements in the target web page is obtained.
6. The method according to any one of claims 1 to 5, wherein: The method further comprises: The model is trained to analyze the collected performance data and output corresponding analysis result information.
7. A method for processing performance data, wherein: The method comprises: Obtaining performance-related data corresponding to the web page to be processed; Analyzing the performance-related data by using the trained model to obtain analysis result information output by the model; Wherein, the model is obtained by training using the model training method described in any one of claims 1 to 6.
8. The method according to claim 7, wherein: The analysis result information includes the identified performance bottleneck, and the method further includes: Based on the obtained performance-related data, determine whether there is a page performance bottleneck; If a page performance bottleneck occurs, one or more causes of the bottleneck are analyzed based on performance-related data, and corresponding analysis result information is generated.
9. A device for training a model, wherein: The device comprises: means for obtaining performance-related data corresponding to a plurality of target web pages; means for extracting target variable data and feature variable data for training a model based on the performance-related data; A device for identifying factors affecting page performance by training a model based on the target variable data and the feature variable data so that the model learns the relationship between the target variable data and the feature variable data.
10. An apparatus for processing performance data, wherein: The device comprises: Means for obtaining performance-related data corresponding to the web page to be processed; A device for analyzing the performance-related data by using a trained model to obtain analysis result information output by the model; Wherein, the model is obtained by training using the model training method described in any one of claims 1 to 6.
11. An electronic device, comprising: at least one processor; as well as 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 to enable the at least one processor to execute the method of any one of claims 1 to 6, or the method of claim 7 or 8.
12. A computer readable medium having computer program instructions stored thereon, wherein the computer program instructions can be executed by a processor to implement the method according to any one of claims 1 to 6, or the method according to claim 7 or 8.
13. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented, or the method according to claim 7 or 8 is implemented.