Cross-end page performance calculation method
By calculating the interaction response coefficient and page error coefficient, combined with the rendering time coefficient, the page performance index is established, and the problem of inaccurate page performance evaluation in the existing technology is solved, the accuracy of evaluation and user experience are improved, and page optimization is promoted.
Patent Information
- Application Number
- CN202410879240.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2024-11-22
AI Technical Summary
The existing page performance evaluation method is based on the page full load time, resulting in inaccurate evaluation data when the page is not fully loaded, reducing the accuracy of evaluation.
By obtaining the specific time when users can interact from entering the page, calculating the interaction response coefficient, collecting log information during the page loading process, filtering error data, calculating page error coefficients, combining the rendering time coefficients, establishing the page performance index and performing evaluation.
Improves the accuracy of page performance evaluation, helps developers identify and optimize page loading speed and interactive response issues, improves user experience, reduces waiting anxiety, reduces user churn, and saves traffic and energy consumption.
Smart Images

Figure CN119003296A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and more specifically to a method for calculating cross-end page performance. Background Art
[0002] Page performance refers to the performance and response speed of a web page or application during loading, rendering, and interaction. It covers aspects such as page loading speed, rendering speed, interactive response speed, and page stability. The quality of page performance directly affects the user experience and satisfaction, so optimizing page performance is crucial during the development of web pages and applications.
[0003] The existing page performance evaluation uses the time it takes for a page to be fully loaded as the time it can be interacted with by the user and is comprehensively evaluated with other page performance indicators. However, this evaluation method may result in inaccurate data for the page performance evaluation when the user can still interact with the page even if the page is not fully loaded, thereby reducing the accuracy of the page performance evaluation.
[0004] In view of the above problems, the present invention proposes a solution. Summary of the invention
[0005] In order to overcome the above-mentioned defects of the prior art, the present invention provides a cross-end page performance calculation method to solve the problems existing in the above-mentioned background technology.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] A method for calculating cross-end page performance includes the following steps:
[0008] Get the specific time that users can perform interactive operations from the time they enter the page, record it as the actual interactive time, calculate the ratio of the actual interactive time to the expected interactive time, and calculate the interactive response coefficient, which is calculated as follows: Where IT represents the interactive response coefficient, AT represents the actual interactive time, and ET represents the expected interactive time;
[0009] Collect all log information generated from the time the user enters the page to the time the page is fully loaded, including network requests, JavaScript errors, and resource loading error information during the page loading process;
[0010] Filter out the number of each type of error data in the collected log information, the error data including HTTP error code, JavaScript error information and resource loading failure, assign weight values according to the degree of impact of HTTP error code, JavaScript error information and resource loading failure on user use, count the number of each type of error information, and calculate the page error coefficient according to the number and weight of the error information;
[0011] A model of page complexity, the number of CSS style rules on a page, and rendering time is established. The model is used to predict the estimated rendering time of the current page. The actual rendering time of the page is collected, and the ratio of the actual rendering time to the estimated rendering time is calculated to obtain the rendering time coefficient. The calculation formula is: Where RT represents the rendering time coefficient, R 实际 Represents the actual rendering time, R 预计 Expressed as estimated rendering time;
[0012] The page performance index is calculated based on the interactive response coefficient, page error coefficient, and rendering time coefficient. The calculation formula is: Among them, PF represents the page performance index, IT represents the interactive response coefficient, PE represents the page error coefficient, RT represents the rendering time coefficient, a1, a2, and a3 represent the weight coefficients of the interactive response coefficient, the page error coefficient, and the rendering time coefficient, and the page performance is evaluated according to the page performance index.
[0013] Preferably, the step of obtaining the specific time at which the user can perform interactive operations from the time of entering the page is:
[0014] Step 001: Get the time when the first page element is created when the user enters the page, and record it as the start time;
[0015] Step 002: Set the stay time threshold and obtain the time interval according to the user's stay time;
[0016] Step 003: Obtain the time when the first page element of the current page is created within the time interval;
[0017] Step 004: Count the specific time of the page elements created within the time interval, with seconds as the time unit, count the number of page elements created per second, obtain the number of page elements created every second after the user enters the page, and record the creation time of the last page element created every second;
[0018] Step 005: Calculate the total number of times the page element is created from the start time to the current time, and record it as the current number of times the page element is created;
[0019] Step 006: Calculate the number of times all page elements are created within the time interval, and record it as the total number of times page elements are created;
[0020] Step 007: Calculate the ratio of the current number of page element creation times to the total number of page element creation times to obtain the page completeness, which is calculated as follows: Wherein PC represents the page completeness, CM represents the number of times the current page elements are created, and TM represents the total number of times the page elements are created. When the page completeness is greater than or equal to 85%, the creation time of the last page element in the current time period is recorded as the specific time when the user can perform interactive operations. If the page completeness is less than or equal to 85%, return to step 005 to continue calculating the number of times the current page elements are created.
[0021] Preferably, the steps of establishing a model of page complexity, number of page CSS style rules and rendering time are:
[0022] Step 1: Collect a batch of data on different pages, including page complexity, the number of CSS style rules on the page, and the actual rendering time, and divide the mobile phone page data into a training set and a test set;
[0023] Step 2: Use regression analysis to build a mathematical model based on the collected data to describe the relationship between page complexity, the number of CSS style rules, and rendering time;
[0024] Step 3: Use the data of the training set to fit the model, adjust the model parameters, and obtain the initial model with adjusted parameters;
[0025] Step 4: Use the test set to verify the accuracy of the initial model, and compare the accuracy of the initial model with the preset threshold. If the accuracy of the initial model is greater than the preset threshold, output the current parameters to obtain the final model. If the accuracy of the initial model is less than the preset threshold, return to step 3 to continue adjusting the model parameters until the accuracy of the initial model is greater than the preset threshold.
[0026] Preferably, the page complexity calculation steps are:
[0027] Get the DOM tree of the page through the DOM parsing library;
[0028] Starting from the root node of the DOM tree, recursively traverse each DOM element and record the depth of each DOM element;
[0029] For each DOM element, its depth is defined as the length of its path to the root node, that is, the level of the element in the DOM tree;
[0030] The depth of all DOM elements is accumulated to calculate the total DOM structure depth;
[0031] Divide the total DOM structure depth by the number of DOM elements in the page to get the average DOM structure depth, and use the average DOM structure depth as the page complexity. The calculation formula is: SD represents the total DOM structure depth, and ED represents the DOM element data in the page.
[0032] Preferably, the step of using the data of the training set to fit the model and adjusting the model parameters is:
[0033] Step 1: Organize the training set data into a format suitable for regression analysis. The data should include page complexity, number of CSS style rules, and rendering time.
[0034] Step 2: Select a linear regression model and fit the selected model using the least squares method;
[0035] Step 3: Use the gradient descent method to estimate the model parameters by minimizing the error term. The optimization algorithm will try different parameter values and adjust the parameter values to make the model's predicted values consistent with the observed values.
[0036] Step 4: Use the mean square error to evaluate the fitting effect of the model. Compare the mean square error of the model with the preset threshold. If the mean square error is less than the preset threshold, output the current model parameters as the fitted model. If the mean square error is greater than the preset threshold, return to step 3 to adjust the model parameters until the mean square error is less than the preset threshold.
[0037] Preferably, the step of using the test set to verify the accuracy of the initial model is:
[0038] Use the fitted model to predict the samples in the test set and obtain the prediction results of the model for the test set samples;
[0039] Compare the model's prediction results with the actual target variable in the test set and calculate the R square value of the model. The calculation formula is: Where R 2 Expressed as R square value, y i is represented by the actual observed value of sample i, It is represented as the model prediction value of sample i, It is expressed as the average of all observations, and n represents the number of samples in the data set;
[0040] Based on the evaluation results on the test set, the model is adjusted and optimized.
[0041] Preferably, the step of evaluating the page performance according to the page performance index is to compare the page performance index with a preset threshold. If the page performance index is less than the preset threshold, the page performance is judged to be poor and relevant personnel are required to optimize the page. If the page performance index is greater than the preset threshold, the page performance is judged to be good.
[0042] Technical effects and advantages of the present invention:
[0043] Get the actual interactive time that users can perform interactive operations from the time they enter the page, calculate the ratio of the actual interactive time to the expected interactive time, calculate the interactive response coefficient, collect all log information generated from the time the user enters the page to the time the page is fully loaded, filter out the number of each type of error data in the collected log information, calculate the page error coefficient based on the number of error information, calculate the page performance index based on the interactive response coefficient, page error coefficient and rendering time coefficient, and evaluate the page performance based on the page performance index, which effectively improves the accuracy of page performance evaluation. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 It is the overall flow chart of the present invention.
[0045] Figure 2 This is a specific time flow chart of the interactive operation of the present invention. DETAILED DESCRIPTION
[0046] The technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the present invention. In addition, the forms of the various structures recorded in the following implementation modes are merely illustrative. The cross-end page performance calculation method involved in the present invention is not limited to the various structures recorded in the following implementation modes. All other implementation modes obtained by ordinary technicians in this field without making creative work belong to the scope of protection of the present invention.
[0047] The present invention provides a method for calculating the performance of a cross-end page, comprising the following steps:
[0048] Get the specific time that users can perform interactive operations from the time they enter the page, record it as the actual interactive time, calculate the ratio of the actual interactive time to the expected interactive time, and calculate the interactive response coefficient, which is calculated as follows: Where IT represents the interactive response coefficient, AT represents the actual interactive time, and ET represents the expected interactive time;
[0049] Collect all log information generated from the time the user enters the page to the time the page is fully loaded. The log information includes network requests, JavaScript errors, and resource loading error information during the page loading process. Filter out the number of each error data from the collected log information. The error data includes HTTP error codes, JavaScript error information, and resource loading failures. Give weight values according to the degree of impact of HTTP error codes, JavaScript error information, and resource loading failures on user use. Count the number of each error information. According to the number and weight of the error information, calculate the page error coefficient, which is calculated as PE=q1×NUM H +q2×NUM J +q3×NUM R , where PE represents the page error coefficient, NUM H Indicates the number of HTTP error codes, NUM J Indicates the number of JavaScript error messages, NUM R It is represented by the number of resource loading failures. q1, q2, and q3 represent the HTTP error code, JavaScript error message, and the weight of resource loading failure.
[0050] A model of page complexity, the number of CSS style rules on a page, and rendering time is established. The model is used to predict the estimated rendering time of the current page. The actual rendering time of the page is collected, and the ratio of the actual rendering time to the estimated rendering time is calculated to obtain the rendering time coefficient. The calculation formula is: Where RT represents the rendering time coefficient, R 实际 Represents the actual rendering time, R 预计 Expressed as estimated rendering time;
[0051] The page performance index is calculated based on the interactive response coefficient, page error coefficient, and rendering time coefficient. The calculation formula is: PF stands for page performance index, and IT stands for interactive response coefficient. The larger the interactive response coefficient, the shorter the time required for actual interaction. A shorter interactive time can directly affect the interactive response speed, that is, the response time of the page to the operation after the user's operation. Fast interactive response time can provide users with a smoother experience, enhance user satisfaction and usage experience, and PE stands for page error coefficient. The larger the page error coefficient, the more errors there are when the page is loaded. The more errors there are when the page is loaded, the lower the page performance index will usually be. This is because errors occurring during page loading may lead to problems such as page loading failure, prolonged loading time, incomplete or erroneous display of page content, thereby reducing user experience. RT is represented by the rendering time coefficient. The larger the rendering time coefficient, the shorter the actual rendering time. The shorter the actual rendering time, usually means that the page loads faster and users can see the page content and interact faster. Therefore, the page performance index tends to be higher. Short actual rendering time can directly increase the rendering speed, that is, the page content can be rendered faster on the user device, improving user experience. a1, a2, and a3 are represented as weight coefficients of the interactive response coefficient, the page error coefficient, and the rendering time coefficient. This embodiment does not perform specific calculations on the specific values of a1, a2, and a3, but evaluates the page performance based on the page performance index.
[0052] Evaluating page performance can help developers find problems such as slow page loading and untimely interactive response, and optimize them to improve user experience. Fast page loading and smooth interaction can increase user satisfaction and promote continuous use; evaluating and optimizing page performance can reduce the time users wait for page loading and reduce users' waiting anxiety, thereby reducing user churn. Fast page loading and smooth interaction can improve user stickiness and increase user retention; optimizing mobile APP page performance can reduce the amount of page resource loading and the amount of data transmitted over the network, thereby saving users' traffic consumption. In addition, optimizing page performance can also reduce the energy consumption of mobile phones and extend the battery life of mobile phones; search engines usually consider page loading speed as a factor in web page ranking. Optimizing mobile APP page performance can increase page loading speed, improve the search engine ranking of the page, and increase the exposure and traffic of the page; optimizing mobile APP page performance can reduce server resource consumption and maintenance costs, reduce the cost of developer debugging and optimization, thereby saving operating costs.
[0053] In this embodiment, it should be specifically explained that Figure 2 As shown, the specific steps for obtaining the time at which the user can perform interactive operations from the time the user enters the page are:
[0054] Obtain the time when the first page element is created when the user enters the page, and record it as the start time. The page element refers to various components, controls or elements that constitute the application interface;
[0055] Get the time interval. If the user stays on the current page for more than 5 seconds, set the time interval to 5 seconds. Otherwise, set the time interval to the length of time the user stays on the current page.
[0056] Get the time when the first page element of the current page is created within the time interval;
[0057] The specific time of page elements created within the time interval is counted, with seconds as the time unit, and the number of page elements created per second is counted to obtain the number of page elements created every second after the user enters the page, and the creation time of the last page element created every second is recorded;
[0058] Calculate the total number of page elements created from the start time to the current time, and record it as the current number of page elements created. For example, after the user enters the page, the number of page elements created within one second or the number of page elements created within two seconds;
[0059] Calculate the number of all page elements created within the time interval, and record it as the total number of page elements created;
[0060] The page completeness is calculated by calculating the ratio of the current number of page element creations to the total number of page element creations. The calculation formula is: Among them, PC represents the page completeness, CM represents the number of times the current page elements are created, and TM represents the total number of times the page elements are created. When the page completeness is greater than or equal to 85%, the creation time of the last page element in the current time period is recorded as the specific time when the user can perform interactive operations.
[0061] By evaluating the specific interaction operation time, we can objectively understand the actual feelings of users when using mobile APP. Such an evaluation is not based only on subjective feelings, but on actual user behavior data, which can more accurately evaluate the impact of page performance on user experience; the specific interaction operation time can help developers accurately locate the bottleneck of page performance. For example, if a certain interaction operation takes a long time, it may mean that the page loading or response speed is insufficient, and corresponding optimization measures are needed; evaluating the specific interaction operation time can help developers quantify the effect of performance improvement. By comparing the specific interaction operation time before and after optimization, we can intuitively understand the improvement effect of performance optimization on page performance, thereby providing a reference for subsequent optimization work.
[0062] In this embodiment, it should be specifically explained that the steps of establishing the model of page complexity, the number of page CSS style rules and rendering time are:
[0063] Step 1: Collect a batch of data on different pages, including page complexity (such as average DOM structure depth), the number of CSS style rules on the page, and the actual rendering time, and divide the mobile phone page data into a training set and a test set. The actual rendering time refers to the time it takes from the user's request to open the page to the page content being fully loaded and displayed. It includes multiple steps such as requesting page resources from the network, parsing HTML, loading CSS, executing JavaScript, and rendering page elements;
[0064] Step 2: Use regression analysis to build a mathematical model based on the collected data to describe the relationship between page complexity, the number of CSS style rules, and rendering time;
[0065] Step 3: Use the data of the training set to fit the model, adjust the model parameters so that it can better fit the actual data, and obtain the initial model with adjusted parameters;
[0066] Step 4: Use the test set to verify the accuracy of the initial model, and compare the accuracy of the initial model with the preset threshold. If the accuracy of the initial model is greater than the preset threshold, output the current parameters to obtain the final model. If the accuracy of the initial model is less than the preset threshold, return to step 3 to continue adjusting the model parameters until the accuracy of the initial model is greater than the preset threshold.
[0067] In this embodiment, it should be specifically explained that the page complexity calculation steps are:
[0068] Get the DOM tree of the page through the browser's developer tools or DOM parsing library, which is a software tool or library used to parse HTML documents and convert them into a document object model representation. DOM is a standard interface for representing the structure of HTML documents. It represents HTML documents as a tree structure, in which each node represents an element, attribute or text node in the document; the DOM tree is a tree data structure for representing the structure of HTML or XML documents. It represents each element, attribute and text node in an HTML or XML document as a node in the tree, and the nodes are connected through parent-child relationships, sibling relationships, etc.
[0069] Starting from the root node of the DOM tree, recursively traverse each DOM element and record the depth of each DOM element;
[0070] For each DOM element, its depth is defined as the length of its path to the root node, that is, the level of the element in the DOM tree;
[0071] The depth of all DOM elements is accumulated to calculate the total DOM structure depth;
[0072] Divide the total DOM structure depth by the number of DOM elements in the page to get the average DOM structure depth, and use the average DOM structure depth as the page complexity. The calculation formula is: SD represents the total DOM structure depth, and ED represents the DOM element data in the page.
[0073] The DOM tree can intuitively reflect the hierarchy and complexity of the page structure. The DOM tree is a tree structure formed by the elements in the HTML document according to their hierarchical relationship in the document. It contains all the elements in the page and their mutual relationships. The DOM tree provides an intuitive representation of the page structure. Developers can quickly understand the hierarchy and element organization of the page by viewing the DOM tree. The more complex the page structure, the deeper the hierarchy of the DOM tree and the more nodes there are; the DOM tree can quantify the complexity of the page through indicators such as the number of nodes and depth. The more nodes and the deeper the depth, the more complex the page structure is, and the more content needs to be loaded and rendered. Therefore, these indicators can be used as the basis for evaluating the complexity of the page; by comparing the DOM trees of different pages, you can quickly understand their relative complexity. For example, by comparing the number of nodes and depth of two pages, you can find out which page is more complex, thereby helping developers identify and optimize page performance issues.
[0074] In this embodiment, it should be specifically explained that the steps of using the data of the training set to fit the model and adjusting the model parameters are as follows:
[0075] Step 1: Organize the training set data into a format suitable for regression analysis. The data should include independent variables (page complexity, number of CSS style rules) and dependent variables (rendering time), and ensure that the data set contains enough samples and covers different ranges of independent and dependent variables.
[0076] Step 2: Select a linear regression model and use the least squares method to fit the selected model. The general form of the linear regression model is y=β0+β1x1+β2x2+...+β n x n +ε, where y is the dependent variable (rendering time), x1,x2,...x n are independent variables (page complexity, number of CSS style rules), β0,β1,...β n is the model parameter, ε is the error term, and the least square method is a commonly used parameter estimation method, which is used to estimate the parameters in the regression model so as to minimize the residual square sum between the predicted value of the model and the actual observed value;
[0077] Step 3: Use the gradient descent method to estimate the model parameters by minimizing the error term. The optimization algorithm will try different parameter values and adjust the parameter values to make the model's predicted value as close to the observed value as possible. The gradient descent method is a commonly used optimization algorithm used to minimize the loss function or objective function. It iteratively updates the parameters and gradually adjusts the parameter values along the direction of the gradient of the loss function to find the parameter value that minimizes the loss function.
[0078] Step 4: Use the mean square error to evaluate the fitting effect of the model, compare the mean square error of the model with the preset threshold, if the mean square error is less than the preset threshold, output the current model parameters, if the mean square error is greater than the preset threshold, return to step 3 to adjust the model parameters until the mean square error is less than the preset threshold, the mean square error is one of the commonly used indicators for evaluating the fitting effect of the regression model, it measures the square of the average deviation between the model prediction value and the true observation value. When the mean square error is small, it means that the predicted value of the model is closer to the actual observation value, and the fitting effect of the model is better; on the contrary, when the mean square error is large, it means that the predicted value of the model deviates greatly from the actual observation value, the fitting effect of the model is poor, and the mean square error calculation is a prior art, and this embodiment does not provide a detailed description of its specific calculation process.
[0079] In this embodiment, it should be specifically explained that the steps of using the test set to verify the accuracy of the initial model are:
[0080] Use the trained model to predict the samples in the test set and obtain the prediction results of the model for the test set samples;
[0081] Compare the model's predictions with the actual target variables in the test set and calculate the model's performance indicators, such as the R-squared value, which is calculated as follows: Where R 2 It is expressed as R square value, also known as the coefficient of determination, which indicates the degree to which the model explains the variance of the dependent variable, y i is represented by the actual observed value of sample i, It is represented as the model prediction value of sample i, It is expressed as the average of all observations, n represents the number of samples in the data set, and the performance index of the model can help evaluate the model's predictive ability for unseen data;
[0082] Adjust and optimize the model based on the evaluation results on the test set. You may need to adjust the model's hyperparameters, change the model structure, or perform feature engineering to improve the model's prediction accuracy and generalization ability;
[0083] If the data set is small or has a certain degree of randomness, the cross-validation method can be used to evaluate the model. Cross-validation divides the data set into multiple subsets, uses one of the subsets as the test set, and the remaining subsets as the training set, repeats the training and testing process multiple times, and finally takes the average value as the performance evaluation indicator of the model.
[0084] In this embodiment, it needs to be specifically explained that the step of evaluating the page performance according to the page performance index is to compare the page performance index with a preset threshold. If the page performance index is less than the preset threshold, it is determined that the page performance is poor and relevant personnel are required to optimize the page. If the page performance index is greater than the preset threshold, it is determined that the page performance is good.
[0085] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
[0086] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for calculating the performance of a cross-end page, characterized in that: The following steps are involved: Get the specific time that users can perform interactive operations from the time they enter the page, record it as the actual interactive time, calculate the ratio of the actual interactive time to the expected interactive time, and calculate the interactive response coefficient, which is calculated as follows: Where IT represents the interactive response coefficient, AT represents the actual interactive time, and ET represents the expected interactive time; Collect all log information generated from the time the user enters the page to the time the page is fully loaded, including network requests, JavaScript errors, and resource loading error information during the page loading process; Filter out the number of each type of error data in the collected log information, the error data including HTTP error code, JavaScript error information and resource loading failure, assign weight values according to the degree of impact of HTTP error code, JavaScript error information and resource loading failure on user use, count the number of each type of error information, and calculate the page error coefficient according to the number and weight of the error information; A model of page complexity, the number of CSS style rules on a page, and rendering time is established. The model is used to predict the estimated rendering time of the current page. The actual rendering time of the page is collected, and the ratio of the actual rendering time to the estimated rendering time is calculated to obtain the rendering time coefficient. The calculation formula is: Where RT represents the rendering time coefficient, R 实际 Represents the actual rendering time, R 预计 Expressed as estimated rendering time; The page performance index is calculated based on the interactive response coefficient, page error coefficient, and rendering time coefficient. The calculation formula is: Among them, PF represents the page performance index, IT represents the interactive response coefficient, PE represents the page error coefficient, RT represents the rendering time coefficient, a1, a2, and a3 represent the weight coefficients of the interactive response coefficient, the page error coefficient, and the rendering time coefficient, and the page performance is evaluated according to the page performance index.
2. A cross-end page performance calculation method according to claim 1, characterized in that: The specific steps for obtaining the time at which the user can perform interactive operations from the time the user enters the page are: Step 001: Get the time when the first page element is created when the user enters the page, and record it as the start time; Step 002: Set the stay time threshold and obtain the time interval according to the user's stay time; Step 003: Obtain the time when the first page element of the current page is created within the time interval; Step 004: Count the specific time of the page elements created within the time interval, with seconds as the time unit, count the number of page elements created per second, obtain the number of page elements created every second after the user enters the page, and record the creation time of the last page element created every second; Step 005: Calculate the total number of times the page element is created from the start time to the current time, and record it as the current number of times the page element is created; Step 006: Calculate the number of times all page elements are created within the time interval, and record it as the total number of times page elements are created; Step 007: Calculate the ratio of the current number of page element creations to the total number of page element creations to obtain the page completeness, which is calculated as follows: Wherein PC represents the page completeness, CM represents the number of times the current page elements are created, and TM represents the total number of times the page elements are created. When the page completeness is greater than or equal to 85%, the creation time of the last page element in the current time period is recorded as the specific time when the user can perform interactive operations. If the page completeness is less than or equal to 85%, return to step 005 to continue calculating the number of times the current page elements are created.
3. A cross-end page performance calculation method according to claim 1, characterized in that: The steps for building a model of page complexity, number of page CSS style rules and rendering time are as follows: Step 1: Collect a batch of data on different pages, including page complexity, the number of CSS style rules on the page, and the actual rendering time, and divide the mobile phone page data into a training set and a test set; Step 2: Use regression analysis to build a mathematical model based on the collected data to describe the relationship between page complexity, the number of CSS style rules, and rendering time; Step 3: Use the data of the training set to fit the model, adjust the model parameters, and obtain the initial model with adjusted parameters; Step 4: Use the test set to verify the accuracy of the initial model, and compare the accuracy of the initial model with the preset threshold. If the accuracy of the initial model is greater than the preset threshold, output the current parameters to obtain the final model. If the accuracy of the initial model is less than the preset threshold, return to step 3 to continue adjusting the model parameters until the accuracy of the initial model is greater than the preset threshold.
4. A cross-end page performance calculation method according to claim 3, characterized in that: The page complexity calculation steps are: Get the DOM tree of the page through the DOM parsing library; Starting from the root node of the DOM tree, recursively traverse each DOM element and record the depth of each DOM element; For each DOM element, its depth is defined as the length of its path to the root node, that is, the level of the element in the DOM tree; The depth of all DOM elements is accumulated to calculate the total DOM structure depth; Divide the total DOM structure depth by the number of DOM elements in the page to get the average DOM structure depth, and use the average DOM structure depth as the page complexity. The calculation formula is: SD represents the total DOM structure depth, and ED represents the DOM element data in the page.
5. A cross-end page performance calculation method according to claim 3, characterized in that: The steps of using the data of the training set to fit the model and adjust the model parameters are as follows: Step 1: Organize the training set data into a format suitable for regression analysis. The data should include page complexity, number of CSS style rules, and rendering time. Step 2: Select a linear regression model and fit the selected model using the least squares method; Step 3: Use the gradient descent method to estimate the model parameters by minimizing the error term. The optimization algorithm will try different parameter values and adjust the parameter values to make the model's predicted values consistent with the observed values. Step 4: Use the mean square error to evaluate the fitting effect of the model. Compare the mean square error of the model with the preset threshold. If the mean square error is less than the preset threshold, output the current model parameters as the fitted model. If the mean square error is greater than the preset threshold, return to step 3 to adjust the model parameters until the mean square error is less than the preset threshold.
6. A cross-end page performance calculation method according to claim 3, characterized in that: The steps of using the test set to verify the accuracy of the initial model are: Use the fitted model to predict the samples in the test set and obtain the prediction results of the model for the test set samples; Compare the model's prediction results with the actual target variable in the test set and calculate the R square value of the model. The calculation formula is: Where R 2 Expressed as R square value, y i is represented by the actual observed value of sample i, Represented as the model prediction value of sample i, It is expressed as the average of all observations, and n represents the number of samples in the data set; Based on the evaluation results on the test set, the model is adjusted and optimized.
7. A cross-end page performance calculation method according to claim 1, characterized in that: The step of evaluating page performance according to the page performance index is to compare the page performance index with a preset threshold. If the page performance index is less than the preset threshold, the page performance is judged to be poor and relevant personnel are required to optimize the page. If the page performance index is greater than the preset threshold, the page performance is judged to be good.
Citation Information
Cited By
Estimation method and related device
CN120856794A
