Web page performance detection method, device and electronic equipment

By simulating users to access web pages and collecting performance indicators and resource consumption data, and combining preset rules to generate test reports, it solves the problems of low efficiency of web page performance detection, affecting user access and information security in the existing technology, and achieves accurate optimized configuration.

CN118171010BActive Publication Date: 2024-09-06CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410579070.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-11
Publication Date
2024-09-06
Estimated Expiration
2044-05-11

AI Technical Summary

Technical Problem

Existing web page performance detection methods have contingency results, long data collection time, impact on user access and information security issues, and cannot perform process monitoring and data aggregation.

Method used

Determine test scenario tags through user input information, simulate users accessing web pages, collect performance indicators and resource consumption data, and generate test reports based on preset rules to optimize web page performance.

Benefits of technology

It improves detection efficiency, draws accurate conclusions, reduces the impact of the web page loading process on other user operations, and simplifies data aggregation and optimized configuration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118171010B
    Figure CN118171010B
Patent Text Reader

Abstract

The present application discloses a web page performance detection method, device and electronic device, which relates to the field of Internet technology, in order to solve the problem of poor performance of web page performance detection. The method includes: determining a test scenario label according to user input information; simulating a user's access to a web page to be detected according to a preset test case according to the test scenario label, and collecting performance indicator data of a target web page application and resource consumption data of the process where the target web page application is located; processing the performance indicator data and resource consumption data according to the test scenario label to generate test data; matching the test data with preset test comparison rules and / or indicator combination rules in a preset test experience library, and generating a test report according to the matching results. The embodiments of the present application can improve detection efficiency and draw accurate test conclusions, avoiding the performance of users accessing web pages affected by the web page performance detection process occupying the resources of users in the process of accessing web pages.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet technology, and in particular to a web page performance detection method, device and electronic device. Background Art

[0002] With the development of the Internet, many companies have elevated product user experience to a strategic position. As the front-end page that directly contacts users, it is particularly important to improve page opening speed and operation smoothness.

[0003] In the related art, the performance of a web page is tested, and measures are taken to improve the page opening speed and operation fluency based on the test results.

[0004] However, the web page performance detection methods in the relevant technology are mainly based on dial-up testing, test tools or automated testing. Among them, the results of dial-up testing are accidental and lack of big data sample support analysis; the test tools often require more configuration, and data analysis and report issuance require more client resources. One analysis may take tens of seconds to several minutes; the time span of the collected data samples is generally short, and the analysis cost of longer test scenarios is high, which means that process monitoring is impossible; the test data and analysis results collected by the test tools often cannot be exported and are suitable for one-time analysis. If records and summaries are required, they need to be done manually, which takes a lot of time and effort; automated testing has a certain intrusion on the test target, affecting the performance of users accessing the web page and the information security performance. Summary of the invention

[0005] The embodiments of the present application provide a web page performance detection method, device and electronic device, which can simulate user access to a web page to be detected based on user input and use preset test cases, and collect performance indicator data and resource consumption data in the process. In this way, by analyzing the collected data, the detection efficiency can be improved and accurate test conclusions can be drawn, and it is convenient for operation and maintenance personnel to optimize the configuration of the web page based on the detected web page loading performance and hardware resource consumption data, thereby reducing the risk of affecting other user operations due to the web page loading process occupying a large amount of resources on the user side.

[0006] In a first aspect, an embodiment of the present application provides a web page performance detection method, the method comprising:

[0007] Determine a test scenario label according to user input information, wherein the test scenario label is used to indicate the test purpose of the web page performance detection and the web page to be detected;

[0008] According to the test scenario tag, simulating a user accessing the web page to be tested according to a preset test case, and collecting performance indicator data of a target web application and resource consumption data of a process where the target web application is located, wherein the web page to be tested is a current web page displayed in the target web application;

[0009] Processing the performance indicator data and the resource consumption data according to the test scenario label to generate test data;

[0010] The test data is matched with preset test comparison rules and / or indicator combination rules in a preset test experience library, and a test report is generated according to the matching results, wherein the test report includes at least one of the following: web page performance detection results of a single test scenario, web page performance comparison conclusions of at least two test scenarios, and performance optimization suggestions for the web page to be tested.

[0011] In a second aspect, an embodiment of the present application further provides a web page performance detection device, the device comprising:

[0012] A first determination module, used to determine a test scenario label according to user input information, wherein the test scenario label is used to indicate the test purpose of the web page performance detection and the web page to be detected;

[0013] a collection module, configured to simulate a user accessing the web page to be tested according to the test scenario tag and a preset test case, and collect performance indicator data of a target web application and resource consumption data of a process where the target web application is located, wherein the web page to be tested is a current web page displayed in the target web application;

[0014] A first processing module, used to process the performance indicator data and the resource consumption data according to the test scenario label to generate test data;

[0015] The second processing module is used to match the test data with preset test comparison rules and / or indicator combination rules in a preset test experience library, and generate a test report based on the matching results, wherein the test report includes at least one of the following: web page performance detection results of a single test scenario, web page performance comparison conclusions of at least two test scenarios, and performance optimization suggestions for the web page to be tested.

[0016] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the web page performance detection method as described above when executing the computer program.

[0017] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the web page performance detection method as described above are implemented.

[0018] In a fifth aspect, an embodiment of the present application further provides a computer program product, comprising computer instructions, which, when executed by a processor, implement the steps in the web page performance detection method as described above.

[0019] In an embodiment of the present application, a test scenario label is determined based on user input information, wherein the test scenario label is used to indicate the test purpose of the web page performance detection and the web page to be detected; based on the test scenario label, a user access to the web page to be detected is simulated according to a preset test case, and performance indicator data of a target web page application and resource consumption data of a process in which the target web page application is located are collected, wherein the web page to be detected is a current web page displayed in the target web page application; the performance indicator data and the resource consumption data are processed according to the test scenario label to generate test data; the test data is matched with preset test comparison rules and / or indicator combination rules in a preset test experience library, and a test report is generated according to the matching result, wherein the test report includes at least one of the following: a web page performance detection result of a single test scenario, a web page performance comparison conclusion of at least two test scenarios, and a performance optimization suggestion for the web page to be detected. On the one hand, based on user input, preset test cases are used to simulate users accessing the web page to be tested, and performance indicator data and resource consumption data in the process are collected. In this way, by analyzing the collected data, the detection efficiency can be improved and accurate test conclusions can be drawn, and it is convenient for operation and maintenance personnel to optimize the configuration of the web page based on the detected web page loading performance and hardware resource consumption data, thereby reducing the risk of affecting other user operations due to the web page loading process occupying a large amount of resources on the user side; on the other hand, by matching the collected test data with preset test comparison rules and / or indicator combination rules in a preset test experience library, the content of the test report generated according to the matching results can be made more comprehensive, and can reflect the changing trends and optimization suggestions of web page performance in a single test scenario based on the test report, or reflect the comparison of changing trends and optimization suggestions of web page performance in multiple test scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only 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.

[0021] Figure 1 is a flow chart of a web page performance detection method provided by an embodiment of the present application;

[0022] Figure 2 is a schematic diagram of the data collection process in an embodiment of the present application;

[0023] Figure 3 is a schematic diagram of the changing trend of resource consumption data in an embodiment of the present application;

[0024] Figure 4 is a schematic diagram of the changing trend of performance indicator data in the embodiment of the present application;

[0025] Figure 5 This is a test data indicator summary chart for a test scenario in an embodiment of the present application;

[0026] Figure 6 It is a schematic diagram of a process for eliminating abnormal points in test data in an embodiment of the present application;

[0027] Figure 7 is a schematic diagram of the difference in the changing trend of resource consumption data in the embodiments of the present application;

[0028] Figure 8 It is a schematic diagram of the difference in the changing trend of the performance indicator data in the embodiments of the present application;

[0029] Fig. 9 It is a summary chart of the differences in test data indicators of two test scenarios in the embodiment of the present application;

[0030] Fig.10 is a schematic diagram of a test result query process in an embodiment of the present application, when the target test data corresponds to at least two test scenario labels;

[0031] Fig.11 It is a schematic diagram of the interaction of various modules of the web page performance detection method provided in the embodiment of the present application;

[0032] Fig.12 It is a workflow diagram of access configuration module;

[0033] Fig.13 is a schematic diagram of a web page performance detection device provided in an embodiment of the present application;

[0034] Fig.14 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0036] In order to make the embodiments of the present application clearer, the relevant technical knowledge involved in the embodiments of the present application is first introduced as follows:

[0037] In related technologies, the following three methods are mainly used to implement web page performance detection:

[0038] 1. Dial-up test method: The principle is to send Hypertext Transfer Protocol (HTTP) request information to the server by implanting code in the test page or creating a page sandbox, obtain the file to be tested and the test instruction returned by the server, and perform the network (Web) browser (dial-up test) running performance test according to the instruction to obtain the Web browser running performance result;

[0039] 2. Testing tools: Almost all mainstream browsers provide performance analysis tools, such as Chrome browser developer tools (devtools), which can make relatively detailed statistics on page loading and rendering, and can also make relatively detailed analysis of script (JavaScript, JS) heap memory, network, and graphics processing unit (Graphics Processing Unit, GPU). Developers usually use Chrome devtools' memory analysis tool to analyze page memory leaks, and use its performance tools to analyze page loading and rendering performance. Tools such as WebPageTest and Lighthouse can also perform web page performance analysis;

[0040] 3. Automated testing: By embedding plug-in scripts in web pages, the central processing unit (CPU) and memory information consumed by the current page when real users visit the page are collected for analysis and comparison with preset thresholds to determine whether the page load meets expectations.

[0041] The above three web page performance detection methods each have their own shortcomings, as follows:

[0042] 1. The results of dialing tests are accidental and lack big data samples to support analysis.

[0043] 2. Testing tools often require a lot of configuration, and data analysis and report generation require more client resources. An analysis may take from tens of seconds to several minutes. The time span of the collected data samples is generally short, and the cost of analyzing longer test scenarios is high, which means that process monitoring is impossible. The test data and analysis results collected by the testing tools often cannot be exported and are suitable for one-time analysis. If you want to record and summarize them manually, you need to do it, which takes a lot of time and effort.

[0044] 3. Automated testing has a certain degree of intrusion into the test target, affecting the performance of users accessing web pages and reducing the information security performance of the test target.

[0045] In the embodiment of the present application, based on the user's web page performance test requirements, the user's access to the web page to be tested can be simulated according to the preset test case, and the performance indicator data and resource consumption data in the process can be collected; in this way, standard data collection can be realized, the generalization ability of sample collection can be improved, and only the test data during the period of imitating the user's access to the web page based on the test case is collected during the web page performance detection process, rather than collecting data during the user's access to the web page, which can avoid affecting the user's access to the web page due to the additional resources occupied by data collection during the user's access to the web page, and can improve the protection of the user's information security during the user's access to the web page; in addition, the test report generated based on the matching result of the test data with the preset test comparison rule and / or the indicator combination rule in the preset test experience library is convenient for export and aggregation, for example: by matching the collected test data with the preset test comparison rule, the test data under at least two test scenarios can be compared to obtain the difference between the test data under different scenarios, or, by matching the collected test data with the indicator combination rule in the preset test experience library, the indicators of the test data under one or at least two test scenarios can be evaluated to obtain the web page performance test conclusion or web page performance optimization suggestion.

[0046] The web page performance detection method, web page performance detection device and electronic device provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.

[0047] See also Figure 1 , Figure 1 is a flow chart of a web page performance detection method provided by an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:

[0048] Step 101: Determine a test scenario label according to user input information, wherein the test scenario label is used to indicate the test purpose of web page performance detection and the web page to be detected.

[0049] Step 102: according to the test scenario tag, simulate a user accessing the web page to be tested according to a preset test case, and collect performance indicator data of a target web application and resource consumption data of a process where the target web application is located, wherein the web page to be tested is a current web page displayed in the target web application.

[0050] It should be noted that the "web page" in the embodiment of the present application may also be referred to as a "page"; the "resource consumption data" in the embodiment of the present application may also be referred to as "page consumption data", "web page consumption data" or "hardware consumption data"; the "performance indicator data" in the embodiment of the present application may be referred to as "page performance data", "web page performance data", "page loading performance data", etc.

[0051] Step 103: Process the performance indicator data and the resource consumption data according to the test scenario label to generate test data.

[0052] Step 104: match the test data with preset test comparison rules and / or indicator combination rules in a preset test experience library, and generate a test report based on the matching results, wherein the test report includes at least one of the following: web page performance detection results of a single test scenario, web page performance comparison conclusions of at least two test scenarios, and performance optimization suggestions for the web page to be tested.

[0053] In some embodiments, a plug-in can be installed on a network web browser. After the plug-in is enabled, an input window can be displayed on the web page to be detected. At this time, the user can enter input information for determining the test scenario label in the input window, such as test label information and test duration, etc., wherein the test label is used to identify the test scenario, and the test duration is used to divide the test scenario, so that the test scenario corresponds to the test scenario label one by one. In this way, the test data of different test scenarios can be isolated based on the test scenario label, avoiding the impact of too much data in one test scenario on loading. While supporting the monitoring of a longer test process, it also prevents the impact of too much test data in one test scenario on chart loading. At this time, the test scenario label determined based on the above input information may include the test label and the identifier of the web page to be detected (such as the URL address).

[0054] Of course, the above test duration may be system-configured, and it is not limited to the user having to input the test duration.

[0055] It should be noted that, in some implementations, there may be at least two test scenario tags.

[0056] For example: during the same web page performance test, the duration of data collection may exceed the test duration of a test scenario label. At this time, the data collected after exceeding the test duration will be summarized into the test data under a new test scenario label, so that the time span of the test data marked by each test scenario label is less than or equal to the test duration.

[0057] Among them, the test scenario label can mark the collected data (such as the performance indicator data and the resource consumption data) so that the collected data marked as different test scenarios can be independently matched with the preset test comparison rules and / or the indicator combination rules in the preset test experience library.

[0058] For example: the performance indicator data and the resource consumption data are processed according to the test scenario label to generate test data. The collected performance indicator data and the resource consumption data can be marked with the test scenario label that is effective at the time when the performance indicator data and the resource consumption data are collected. In this way, the test scenarios of the performance indicator data and the resource consumption data can be distinguished according to the test scenario label, as well as the collection time of the performance indicator data and the resource consumption data.

[0059] In some embodiments, the test duration of a test scenario does not exceed the specified test duration. If it exceeds, a new test scenario label is automatically generated (subsequently collected data will be attributed to the new test scenario), and test data with the same test scenario label will be merged into the same test scenario.

[0060] It is worth mentioning that in the embodiment of the present application, the test scenarios of the performance indicator data and the resource consumption data are distinguished by test scenario labels, and the performance indicator data and resource consumption data under different test scenarios are analyzed independently. This can avoid the problem of the analysis process being too complicated and requiring a large amount of computing power due to the simultaneous analysis of a large amount of collected data.

[0061] In some implementations, the test scenario label can be subjected to non-empty check and length check so that the test scenario label can identify the current test purpose as concisely as possible, thereby ensuring that the test data and test report of the current test scenario can be accurately retrieved through the test scenario label, and the aesthetics and experience of the viewed and exported test reports will not be affected by overly long titles.

[0062] In some implementations, to further ensure the uniqueness of the test scenario label, the generation time of the test scenario label may be concatenated after the test label input by the user to obtain the test scenario label.

[0063] In some embodiments, the preset test cases may be at least two test cases pre-set based on testing experience, and each test case may include its own test environment, test object, etc. In this way, based on the preset test cases, the user's access operations on the web page to be tested in various scenarios can be simulated, thereby collecting performance indicator data and resource consumption data in the scenario.

[0064] In some implementations, the performance indicator data may be indicator data of web page loading performance, such as web page loading time, etc.

[0065] In some implementations, the resource consumption data may be the consumption data of the CPU, memory, network and other hardware resources by the process of the target web application. The memory includes total memory, allocated memory, used memory, and can also be extended to the memory occupied by the css cache and script cache.

[0066] It is worth mentioning that in the relevant technology, web page performance detection usually only considers the web page loading time, but does not consider the consumption data of hardware resources. In the embodiment of the present application, the web page performance detection is to jointly analyze the performance indicator data such as the web page loading time and the consumption data of hardware resources. In this way, the web page performance analysis results can be more comprehensive. For example: in order to improve the performance of the page, the developer may introduce some mechanisms to consume more CPU, memory, and network on the client; there are also some products that optimize the page opening speed to the extreme, but the CPU, memory and other resources are consumed during use. In severe cases, the page will freeze, crash, and even affect the client system performance. In the embodiment of the present application, in the process of web page performance detection, the consumption data of hardware resources such as CPU, memory, and network are also analyzed based on the process where the target web page application is located, and the problem caused by the excessive occupation of hardware resources such as CPU, memory, and network by the process where the target web page application is located can be found.

[0067] In some implementations, the target web page application may be understood as a web front-end application that displays the web page to be detected.

[0068] In some embodiments, the preset test comparison rules may include at least one test comparison rule, each test comparison rule is used to indicate that the web page performance of at least two test scenarios satisfies the corresponding rule. At this time, the web page performance comparison conclusions of at least two test scenarios may include whether the adopted test comparison rules pass or fail, wherein passing indicates that the web page performance of at least two test scenarios satisfies the adopted test comparison rules, and failing indicates that the web page performance of at least two test scenarios does not satisfy the adopted test comparison rules.

[0069] For example: Assume that the test comparison rules used to compare the web page performance of test scenario A and test scenario B are: the absolute value increase of the average page loading time of scenario A compared with test scenario B shall not exceed 300ms, the absolute value increase of the average CPU consumption shall not exceed 10% and the growth rate shall not exceed 25%, the absolute value increase of the average allocated memory consumption shall not exceed 30M or the growth rate shall not exceed 15%, and the absolute value increase of the average network consumption shall not exceed 15Kb / s and the growth rate shall not exceed 30%. If the test data of test scenario A and the test data of test scenario B meet the above test comparison rules, it can be determined that the conclusion of the web page performance comparison of test scenario A and test scenario B includes the passing of the above test comparison rules.

[0070] In some implementations, web page performance description statements for when each candidate test comparison rule passes or fails may also be pre-configured. When generating a test report, web page performance description statements corresponding to the web page performance comparison conclusions of at least two test scenarios may be added to the test report.

[0071] For example: Assume that the test comparison rules used to compare the web page performance of test scenario A and test scenario B are: the absolute value increase of the average page loading time of scenario A compared with test scenario B shall not exceed 300ms, the absolute value increase of the average CPU consumption shall not exceed 10% and the growth rate shall not exceed 25%, the absolute value increase of the average allocated memory consumption shall not exceed 30M or the growth rate shall not exceed 15%, and the absolute value increase of the average network consumption shall not exceed 15Kb / s and the growth rate shall not exceed 30%. If the test data of test scenario A and the test data of test scenario B meet the above test comparison rules, the corresponding web page performance description statement when the above test comparison rules are passed (such as test scenario A has a poorer price-performance ratio than test scenario B) will be added to the test report.

[0072] In some embodiments, the preset test experience library may include knowledge and experience corresponding to at least one indicator combination rule, and the knowledge and experience may include at least one of cause analysis and optimization suggestions. Thus, when the test data corresponding to a certain test scenario tag satisfies one or more indicator combination rules in the preset test experience library, the cause analysis and optimization suggestions corresponding to the one or more indicator combination rules that are satisfied may be added to the test report.

[0073] In some embodiments, the preset test experience library can be obtained based on the accumulation of testing experience and performance optimization experience. For example, the CPU and network consumption remain unchanged or even decrease, but the memory consumption increases significantly and exceeds the comparison rule threshold. According to experience, this may be due to excessive use of cache in the web page, use of large images and other resources, or closures in the code that fail to release memory resources; if the CPU consumption increases significantly, while the memory and network consumption do not change much, it may be because the page layout or style settings are unreasonable, which increases the redrawing and reflux of the page; if the CPU and network consumption increase significantly, it may be because there is a network request timer on the page, and it is necessary to confirm whether the timer setting is reasonable.

[0074] In some implementations, multiple pieces of knowledge and experience may be set for each indicator combination rule, an example being (indicator A is less than or equal to T1, indicator B is greater than T2, and indicator C is less than T3, then the test report includes the following corresponding to the indicator combination rule: knowledge and experience 1, knowledge and experience 2).

[0075] In some implementations, the test data may be sent to a web page performance detection server, which performs the above step 104. This can reduce the usage of client resources and facilitate querying and exporting test data and test reports from the web page performance detection server.

[0076] In an embodiment of the present application, a test scenario label is determined based on user input information, wherein the test scenario label is used to indicate the test purpose of the web page performance detection and the web page to be detected; based on the test scenario label, a user access to the web page to be detected is simulated according to a preset test case, and performance indicator data of a target web page application and resource consumption data of a process in which the target web page application is located are collected, wherein the web page to be detected is a current web page displayed in the target web page application; the performance indicator data and the resource consumption data are processed according to the test scenario label to generate test data; the test data is matched with preset test comparison rules and / or indicator combination rules in a preset test experience library, and a test report is generated according to the matching result, wherein the test report includes at least one of the following: a web page performance detection result of a single test scenario, a web page performance comparison conclusion of at least two test scenarios, and a performance optimization suggestion for the web page to be detected. On the one hand, based on user input, preset test cases are used to simulate users accessing the web page to be tested, and performance indicator data and resource consumption data in the process are collected. In this way, by analyzing the collected data, the detection efficiency can be improved and accurate test conclusions can be drawn, and it is convenient for operation and maintenance personnel to optimize the configuration of the web page based on the detected web page loading performance and hardware resource consumption data, thereby reducing the risk of affecting other user operations due to the web page loading process occupying a large amount of resources on the user side; on the other hand, by matching the collected test data with preset test comparison rules and / or indicator combination rules in a preset test experience library, the content of the test report generated according to the matching results can be made more comprehensive, and can reflect the changing trends and optimization suggestions of web page performance in a single test scenario based on the test report, or reflect the comparison of changing trends and optimization suggestions of web page performance in multiple test scenarios.

[0077] As an optional implementation, the target web application is a web application in a target browser, the target browser is installed with a collection plug-in, the collection plug-in includes a first component, a second component and a third component, wherein the first component is a plug-in pop-up window interface component, the second component is a plug-in pop-up window control script component, and the third component is an extended script component running in a web page (such as a script running in a Web page);

[0078] Determining the test scenario label according to the user input information includes:

[0079] Obtaining the test label information and test duration input by the user through the input box in the first component;

[0080] Acquire the address of the webpage currently running in the target browser from the third component through the second component;

[0081] A test scenario tag is generated according to the test tag information and the web page address, wherein the time span of all collected data corresponding to the same test scenario tag is less than or equal to the test duration.

[0082] In some implementations, taking the target browser as a Chrome browser as an example, the acquisition plug-in may be a Chrome acquisition plug-in, which includes a plug-in pop-up interface component, a plug-in pop-up control script component, and an extension script component running in a web page.

[0083] Among them, the plug-in pop-up interface component is used to provide a window for interaction with the user, so as to establish a bridge between the Web front-end application to be tested and the plug-in pop-up control script component and the extended script component running in the web page according to the user operation. In this way, the tester can enter the test label information and test duration into the input box generated by the plug-in pop-up interface component. After the user completes the input or clicks the "Start" button generated by the plug-in pop-up interface component, the plug-in pop-up control script component and the extended script component running in the web page can be controlled to start collecting test data.

[0084] In some embodiments, the address of the web page currently running in the target browser is obtained from the third component through the second component, and the plug-in pop-up control script component may send a control instruction to the extension script component running in the web page based on the control of the plug-in pop-up interface component, and the extension script component running in the web page obtains the Uniform Resource Locator (URL) of the current web page based on the instruction, and feeds back the URL to the plug-in pop-up control script component, and the URL is used as an optional option for the test scenario label. For example: assuming that the test tag information entered by the user is {inputTag} and the web page address is {url}, the complete test scenario label can be "${url} ${inputTag} ${year}-${month}-${day}-${hour}", where ${year}-${month}-${day}-${hour} represents the time of the collected data annotated using the test scenario label.

[0085] Optionally, the extension script component running in the webpage can also obtain the number of system logical processors (processorNum) based on the instruction from the plug-in pop-up control script component as an option of the test scenario label.

[0086] In some embodiments, the time span of all collected data corresponding to the same test scenario label is less than or equal to the test duration. In this way, each test scenario label can be used only to mark collected data within a certain duration, avoiding excessive test data in one test scenario.

[0087] For example: assuming that the test duration is L, when the time span of the collected data under a certain test scenario exceeds L, a new test scenario label is generated, and the data collected thereafter is tagged with the new test scenario label.

[0088] As an optional implementation, the target browser has an interface capable of acquiring hardware consumption data;

[0089] The step of simulating a user accessing the web page to be tested according to the test scenario tag and a preset test case, and collecting performance indicator data of a target web application and resource consumption data of a process where the target web application is located, includes:

[0090] According to the test scenario label, simulating a user accessing the web page to be tested according to a preset test case;

[0091] collecting resource consumption data of a target process in the target browser based on the second component, wherein the target process is a process corresponding to the target webpage application;

[0092] The third component is requested to collect performance indicator data of the target browser loading the web page to be detected through the second component.

[0093] The target browsers mentioned above refer to browsers that provide an interface for obtaining CPU and other hardware resource consumption data in real time. For example, Chrome Developer Tools (DevTools) has opened an experimental interface in its development version, which can collect CPU, network and other hardware consumption information.

[0094] In some implementations, collecting resource consumption data of a target process in the target browser based on the second component may include:

[0095] Monitor the memory of the target process, and when the memory of the target process is found to change, collect the resource consumption data of the target process.

[0096] In this way, the resource consumption data of the target process when it has tasks can be collected more specifically, avoiding repeated collection of the same or similar resource consumption data.

[0097] In some implementations, the loading duration of the web page to be detected may be collected based on a timing strategy.

[0098] In this way, during the web page interaction process, if web page refresh, web page jump and other behaviors occur, the loading time of the web page refresh, web page jump and other behaviors can be collected.

[0099] In some embodiments, requesting the third component to collect performance indicator data of the target browser loading the web page to be tested through the second component can be: the plug-in pop-up control script component sends a control instruction to the extension script component running in the web page based on the test scenario tag, and the extension script component running in the web page obtains the loading time of the current web page based on the instruction, and feeds back the loading time to the plug-in pop-up control script component.

[0100] For example: Figure 2 As shown, when the user sets the test scenario label through the plug-in pop-up window interface and starts to collect data, the plug-in pop-up window control script obtains the process of the current display window of the browser. Then, on the one hand, the memory changes of the process are monitored. If the memory of the process is found to have changed, the resource consumption information of the process is recorded; on the other hand, the plug-in pop-up window control script sends instructions for collecting page loading performance to the running script in the Web page according to the timing strategy, and the running script in the Web page monitors the message from the plug-in pop-up window control script, and obtains the page loading performance data in time according to the instructions sent by the plug-in pop-up window control script, and replies the obtained page loading performance data to the plug-in pop-up window control script, and the plug-in pop-up window control script records the current page loading performance. Finally, according to the calculated or updated test scenario label, the above resource consumption information and the current page loading performance are marked with a scenario label to obtain test data, which can be used for analysis to obtain a test report.

[0101] In this implementation, the resource consumption data of the target process can be collected by utilizing an interface on the target browser that can acquire hardware consumption data.

[0102] As an optional implementation manner, the preset test comparison rule is a rule for comparing web page performance of at least two test scenarios, and the preset test comparison rule includes at least one of the following:

[0103] Indicator type, the indicator type includes at least one indicator of the performance indicator data and the resource consumption data, for example, the indicator can be refined into average CPU consumption, maximum CPU consumption, average total memory consumption, average allocated memory consumption, average used memory consumption, maximum total memory consumption, maximum allocated memory consumption, maximum used memory consumption, average network consumption, maximum network consumption, maximum loading time, average loading time, etc.;

[0104] An indicator comparison method, wherein the indicator comparison method includes a comparison method for comparing the same indicator value of the at least two test scenarios, for example, comparing the absolute value difference or the percentage difference;

[0105] A judgment condition, wherein the judgment condition is used to judge whether the same indicator value of the at least two test scenarios satisfies a preset numerical relationship, wherein the numerical relationship may include four types: greater than, less than, greater than or equal to, and less than or equal to;

[0106] A combination condition, wherein the combination condition includes a combination of at least two of the judgment conditions, for example, indicator 1 is greater than L1, and indicator B is less than L2, or indicator 1 is greater than L1, or indicator B is less than L2;

[0107] The diagnostic conclusion is used to indicate whether the judgment condition or the combination condition is met, for example: if the test data meets the judgment condition or the combination condition, the diagnostic conclusion includes that the test data passes the judgment condition or the combination condition; or, if the test data does not meet the judgment condition or the combination condition, the diagnostic conclusion includes that the test data does not pass the judgment condition or the combination condition.

[0108] In some implementations, the preset test comparison rule may be a comparison rule for a single indicator, such as a comparison rule for any one of the indicators such as CPU consumption, memory consumption, network consumption, page loading time, etc. In this case, the preset test comparison rule may include an indicator type, an indicator comparison method, a judgment condition, and a diagnosis conclusion.

[0109] For example, to set a comparison rule for a single indicator, you need to select the indicator type, indicator comparison method, judgment condition (threshold), and diagnosis conclusion. Among them, you can add multiple comparison methods and judgment conditions to form a combination. Take the average memory consumption indicator as an example. If the average memory consumption increment is required to be no more than 30M, then select the indicator type as "average memory consumption", the indicator comparison method as "absolute value difference", the judgment condition as "less than or equal to", the threshold as 30, and the diagnosis conclusion as "passed"; if the average memory consumption is required to be no more than 30M or the growth rate is no more than 15%, then select the indicator type as "average memory consumption", the indicator comparison method as "absolute value difference", the judgment condition as "less than or equal to", the value as 30 (M), add a combination condition rule as "or", the indicator comparison method as "percentage difference", the judgment condition as "less than or equal to", the value as 15 (%), and the diagnosis conclusion as "passed". For a single indicator, if it does not meet the judgment conditions, it is considered "failed". The diagnostic description information in the test report can be automatically generated according to the set rules, based on the adopted indicator comparison rules and the diagnostic conclusions of the indicator comparison rules. For example, the diagnostic description information in the test report can be "the average memory consumption increase does not exceed 30M, the test passed", "the average memory consumption growth rate exceeds 15%, but the absolute value increase does not exceed 30M, the test passed".

[0110] In some implementations, the preset test comparison rule may be a comparison rule for at least two indicators, such as a comparison rule for at least two of the indicators such as CPU consumption, memory consumption, network consumption, page loading time, etc. At this time, the preset test comparison rule may include an indicator type, an indicator comparison method, a combination condition, and a diagnostic conclusion.

[0111] For example: to set a combination comparison rule for multiple indicators, you need to select the indicator type, indicator comparison method, judgment condition (preset), diagnostic conclusion, and set the diagnostic description. Among them, multiple indicators, indicator comparison methods, and judgment conditions can be added for combination. Compared with setting comparison rules for a single indicator, it can combine multiple indicators, such as requiring that "Compared with test scenario 1, the absolute value increment of the average page loading time in test scenario 2 shall not exceed 300ms, the absolute value increment of the average CPU consumption shall not exceed 10% and the growth rate shall not exceed 25%, the absolute value increment of the average allocated memory consumption shall not exceed 30M or the growth rate shall not exceed 15%, and the absolute value increment of the average network consumption shall not exceed 15Kb / s and the growth rate shall not exceed 30%". The setting can be completed according to the combination configuration rules. Finally, the user-input or automatically generated diagnostic description can be obtained, such as "The price-performance ratio has been significantly improved", "The price-performance ratio has been improved", and "The price-performance ratio is poor". When generating a test report, the diagnostic description information will be automatically generated according to the rules and add this descriptive text. , a complete description example is "Compared with test scenario 1, the average page loading time of test scenario 2 is 1780ms, with an absolute value increase of 249ms, which does not exceed 300ms; the average CPU consumption is 27%, the absolute value increase is 9%, and the percentage increase is 69%, of which the absolute value increase does not exceed 10% and the percentage increase exceeds 25%; the average allocated memory consumption is 120M, the absolute value increase is 12M, and the percentage increase is 11%, of which the absolute value increase does not exceed 30M and the percentage increase does not exceed 15; the average network consumption is 22Kb / s, the absolute value increase is 2Kb / s, the percentage increase is 10%, the absolute value increase does not exceed 15Kb / s, and the percentage increase does not exceed 30%. The diagnosis conclusion is failure. Compared with test scenario 1, test scenario 2 has a poor cost performance."

[0112] In some embodiments, the diagnostic descriptive text may be preconfigured, for example: preconfiguring the diagnostic descriptive text corresponding to each indicator combination comparison rule when it passes, and the diagnostic descriptive text corresponding to each indicator combination comparison rule when it fails; in this way, when the comparison conclusion between test scenario 2 and test scenario 1 passes a certain indicator combination comparison rule, the diagnostic descriptive text corresponding to the indicator combination comparison rule when it passes can be added to the test report.

[0113] In some implementations, the number of preset test comparison rules may be one or at least two, which is not specifically limited herein.

[0114] In the implementation manner of the present application, by comparing at least two test scenarios, it is possible to compare the running differences of the same front-end application under different network environments, different client environments, and different time periods, and it is also possible to compare the differences of the same front-end application before and after optimization, and its diagnostic conclusion can be configured according to demand (scenario extensible). In the embodiment of the present application, the at least two test scenarios for comparison are based on the same or similar test cases and test processes by default, but are not limited to other uses.

[0115] As an optional implementation, the preset test experience library includes at least one indicator combination rule and a performance optimization suggestion corresponding to each indicator combination rule;

[0116] Each of the indicator combination rules includes a change trend or a value range of at least two indicators in the performance indicator data and the resource consumption data;

[0117] The test report includes performance optimization suggestions corresponding to the target indicator combination rule, the target indicator combination rule is at least one of the at least one indicator combination rule, and the indicator value in the test data satisfies the target indicator combination rule.

[0118] In some implementations, a preset test experience library is used to accumulate test experience and performance optimization experience, and obtain performance defects or performance optimization suggestions that may occur when various indicator combination rules are met.

[0119] For example: CPU and network consumption remain unchanged or even decrease, but memory consumption increases significantly and exceeds the comparison rule threshold. According to experience, this may be due to excessive use of cache in the web page, use of large images and other resources, or closures in the code that do not release memory resources. CPU consumption increases significantly, while memory and network consumption do not change much. This may be because the page layout or style settings are unreasonable, which increases the redrawing and reflux of the page. CPU and network consumption increase significantly, which may be because the page has a network request timer, and you need to confirm whether the timer setting is reasonable.

[0120] In some implementations, multiple pieces of knowledge and experience (such as performance defects or performance optimization suggestions) can be set for each indicator combination rule. For example, for the indicator combination rule: indicator A is less than or equal to T1, indicator B is greater than T2, and indicator C is less than T3, the corresponding knowledge and experience include: knowledge and experience 1 and knowledge and experience 2).

[0121] In this implementation, the indicators in the test data can be matched with the indicator combination rules in the preset test experience library, and the performance defects or performance optimization suggestions corresponding to at least one successfully matched indicator combination rule are added to the test report.

[0122] In the embodiment of the present application, three main functions, namely, test result query, test scenario comparison, and test report export, can be realized based on the test report.

[0123] As an optional implementation manner, matching the test data with a preset test comparison rule and / or an indicator combination rule in a preset test experience library, and generating a test report according to the matching result, includes:

[0124] Receive a test result query request input by a user, wherein the test result query request includes a keyword of a test scenario label to be queried;

[0125] Query target test data matching the keyword;

[0126] The target test data is matched with preset test comparison rules and / or indicator combination rules in a preset test experience library, and a test report is generated according to the matching results.

[0127] In some embodiments, during the data collection process, the test data in each test scenario is labeled with a test scenario label based on user input. On the test result query page, the test scenario label can be entered as a keyword to query the test results. The test data marked with the test scenario label is the target test data.

[0128] The same test scenario label can be used to label multiple test data under the corresponding test scenario. In this case, there can be multiple target test data. In some embodiments, the test results corresponding to the multiple target test data can be displayed in pages, such as displaying the test results of 2, 4, 6, 8, 10, 12, or 20 target test data on each page. In other embodiments, the test results of the multiple target test data can be summarized in a chart.

[0129] Optionally, when the test data is matched with a preset test comparison rule, a test report is generated according to the matching result, and the target test data corresponds to the same test scenario label, the test report is used to indicate at least one of the following:

[0130] A change trend of resource consumption data in the target test data;

[0131] The changing trend of the performance indicator data in the target test data;

[0132] A statistical value of a target indicator of the target test data, wherein the target indicator is related to any indicator of the resource consumption data and the performance indicator data.

[0133] In some implementations, the resource consumption trend of each target test data can be summarized through a resource consumption data indicator trend chart. Figure 3 As shown, the horizontal axis of the resource consumption data indicator trend chart is time, and there are three vertical axes, corresponding to CPU, memory, and network consumption. And the resource consumption data indicator trend chart is used to present a time trend line chart of 5 indicators, which are CPU usage, total occupied memory, allocated memory, used memory, and network consumption rate. Optionally, when focusing on analyzing some of the above 5 indicators, other indicators can be hidden in the resource consumption data indicator trend chart.

[0134] In some implementations, the performance indicator data indicator trend chart can be used to summarize the changing trend of the web page loading performance of each target test data. Figure 4 As shown, the horizontal axis of the performance indicator data indicator trend graph is time, and the vertical axis is the web page loading time. The performance indicator data indicator trend graph can be used to present a web page loading time trend line graph.

[0135] It should be noted that the curves of other indicators related to web page loading performance can be expanded in the performance indicator data indicator trend chart as needed, such as first rendering time, first screen time, first interactive time, etc. The web page loading time in the embodiment of the present application refers to the time required for the web page to be fully loaded.

[0136] In some implementations, the statistical values ​​of various indicators of all target test data may be summarized in the form of a chart, which may be an average value, a cumulative value, an effective value, and the like.

[0137] In some implementations, for indicators related to resource consumption, the overall consumption and average consumption can be counted, and the effective CPU average consumption of resources that require CPU scheduling (such as CPU resources, which are consumed only when there is calculation; network resources, which require CPU when there is scheduling) can also be counted.

[0138] In some implementations, for indicators related to web page loading performance, the number of web page loading times may be recorded, and the average web page loading time during the entire web page loading process may be counted.

[0139] In some implementations, each test scenario may count the duration of resource monitoring and the effective CPU consumption duration in the entire test cycle.

[0140] For example: Figure 5As shown, the statistical value of each indicator, the duration of resource monitoring, and the effective CPU consumption time can be displayed in the test data indicator summary chart.

[0141] In this embodiment, by analyzing and processing the collected test data, an indicator trend chart and an indicator summary icon can be generated, and a test report can be output according to the configuration of the test comparison rules and / or the preset test experience library.

[0142] It is worth mentioning that when calculating the average web page loading time, abnormal data caused by sudden environmental jitter can be excluded.

[0143] For example: Figure 6 As shown in the figure, when calculating the average web page loading time, the process of eliminating abnormal points includes the following steps:

[0144] 1. Define an empty data array;

[0145] 2. Traverse the average loading time data of each web page loaded during the web page performance test in time order. If the currently traversed data is the first average loading time data, place it (push) in an empty density array, and place the density array into the data array in step 1;

[0146] 3. If the currently traversed data is not the first average loading time data, determine whether the absolute value of the difference between the data and the target average value is greater than the threshold value k (the threshold value can be customized according to the actual situation and is not specifically limited here). If it is greater than the threshold value, place the average loading time data into a new empty density array and place the density array into the data array; if it is less than the threshold value, place it into the last density array in the data array. The target average value refers to the average value of the average loading time data in the last density array in the data array;

[0147] 4. After the traversal is completed, filter the density arrays in the data array whose density array length is equal to 1 (or other custom array length thresholds), and replace the density array with the average of the two density arrays before and after the density array. Finally, expand the data array into a one-dimensional array, which is the data after excluding abnormal points.

[0148] Through the above process, abnormal peaks and valleys in the average web page loading time can be eliminated. This method focuses on local data to remove abnormal points, which is more in line with the processing method of time series data and can remove the jitter data of web page loading time caused by abnormal environmental jitter.

[0149] In some implementations, if there is abnormal data in the web page loading time and it is eliminated, a prompt should be given when presenting the test results, for example: "Prompt: The two data with loading times of 1478ms and 2567ms were removed due to a large offset."

[0150] In some embodiments, during the data collection process, test data in each test scenario are labeled with a test scenario label based on user input. On the test result query page, at least two test scenario labels can be entered as keywords to query the test results, and the queried test data marked with the at least two test scenario labels can be compared.

[0151] As an optional implementation, when the test data is matched with a preset test comparison rule, a test report is generated according to the matching result, and the target test data corresponds to at least two test scenario labels, the test report is used to indicate at least one of the following:

[0152] The difference in the change trend of resource consumption data in the test scenarios corresponding to the at least two test scenario labels;

[0153] The difference in change trends of performance indicator data in the test scenarios corresponding to the at least two test scenario labels;

[0154] The statistical value difference of the target indicator in the test scenarios corresponding to the at least two test scenario labels, wherein the target indicator is related to any indicator in the resource consumption data and the performance indicator data.

[0155] In some implementations, the resource consumption trend of each target test data under at least two test scenarios can be summarized through a resource consumption data indicator trend comparison chart. Figure 7 As shown, taking the first test scenario as the benchmark, the two test scenarios are combined into a resource consumption data indicator trend comparison chart for comparison (the order can be swapped as needed).

[0156] Optionally, the actual offset duration of the test scenario may be indicated in the resource consumption data indicator trend comparison chart.

[0157] Optionally, the resource consumption data indicator trend comparison chart presents a single-dimensional indicator trend comparison by default. The user can switch the indicator to be compared as needed. The indicator trend curves of the two test scenarios are distinguished by different colors.

[0158] In some implementations, similar to the resource consumption data indicator trend comparison chart, a performance indicator data change trend comparison chart can be used to summarize the performance indicator change trend of each target test data in at least two test scenarios. Figure 8As shown, taking the first test scenario as a benchmark, the two test scenarios are combined into a performance indicator data change trend comparison chart for comparison (the order can be swapped as needed).

[0159] In some implementations, the indicators in each test scenario may be combined first, and the indicators in at least two test scenarios may be summarized in a chart. Fig. 9 As shown, the comparison test results will present a combined indicator summary table: the test results mark the absolute value change and percentage change of each indicator, and present the comparison conclusion according to the configuration rules of the comparison rule configuration module, and apply the knowledge base experience as needed. Indicators that meet the indicator combination rules and indicators that do not meet the indicator combination rules can be displayed separately, such as displayed in different colors.

[0160] For ease of understanding, the following example illustrates the test report generation process in this implementation mode, in which the test data is matched with the preset test comparison rule, a test report is generated according to the matching result, and the target test data corresponds to at least two test scenario labels:

[0161] In this embodiment, Fig.10 As shown, on the test result query page, a check box is placed in the upper left corner of the test unpacking display panel of each test scenario. When the number of check boxes is greater than or equal to 2, the "Compare" button takes effect. After clicking the "Compare" button, at least two checked test scenarios will be compared. At this time, you can select the test comparison rule for comparing at least two test scenarios, or choose whether to apply the experience knowledge base. The specific process includes the following steps:

[0162] (1) Select two test scenarios from the list on the test result query page and click the "Compare" button to compare the test scenarios.

[0163] (2) After triggering the "Compare" button, a pop-up window will pop up. The user can select comparison rules (multiple rules can be selected) in the pop-up window to obtain the comparison conclusions of web page performance for at least two test scenarios. Then, the user can set whether to apply the comparison conclusions to the knowledge base (i.e., match the indicator combination rules in the preset test experience library).

[0164] (3) On the test result query page, when a single test result is displayed on the panel, you can export the test report of the test scenario; on the test scenario comparison page, you can export the comparison test report after the comparison analysis is completed.

[0165] In some implementations, the web page performance comparison conclusions of at least two test scenarios may include three modes, namely, all rules passed, any one rule passed, and selected certain rules passed.

[0166] In some embodiments, the knowledge base may be represented by a checkbox, which, if checked, automatically applies the knowledge base experience to provide diagnosis and suggestions for the test results.

[0167] (4) After completing the configuration of test comparison rules, test conclusions, application knowledge base, etc., the user clicks "Confirm" and the comparison test results will be displayed.

[0168] (5) Comparative test results will present a resource consumption data indicator trend comparison chart and a performance indicator data change trend comparison chart.

[0169] (6) Comparative test results will present a combined indicator summary table.

[0170] (7) Based on the comprehensive comparison rules set by the user, give an overall test diagnosis conclusion.

[0171] Based on the following process, the following functions can be achieved:

[0172] Page performance consumption test: collect page performance consumption data through the device of the present invention, and intuitively view the page performance consumption trend;

[0173] Page access speed test: The page access speed is collected by the device of the present invention, and the average page access speed is evaluated by performing multiple tests under different environments;

[0174] Page memory leak test: By observing the trends of collected memory indicators, diagnose whether the page has obvious memory leak symptoms;

[0175] Page performance consumption comparison test: Test two pages through equivalent test cases as two test scenarios for comparison, and analyze the performance consumption and page opening speed of the two pages;

[0176] Comparative test before and after page optimization: Test the same page before and after optimization through equivalent test cases. The test results can be compared as two test scenarios to analyze whether the page optimization effect meets the requirements.

[0177] Comparative testing of pages in different environments: Comparative testing of page performance consumption in different server environments, network environments, and client environments, and comparative testing of page opening speed.

[0178] In summary, the web page performance detection method provided in the embodiment of the present application can use standard data collection thinking, adopt Chrome extension program to implement data collection plug-in, use test cases to simulate real user access, collect large amounts of test data, and isolate the data collected by test scenarios and use cases through test scenario tags. The test scenario is automatically segmented, and page performance consumption data trend analysis and test result output are performed. It can also eliminate abnormal points in page loading time, thereby solving problems such as data collection, data isolation, and data anomaly point processing.

[0179] In order to facilitate understanding of the web page performance detection method provided in the embodiment of the present application, the web page performance detection method provided in the embodiment of the present application is illustrated by taking the following web page performance detection device as an example:

[0180] like Fig.11 As shown, the web page performance detection device in this embodiment may include: an access configuration module 11, a data collection client module 12, a data collection server module 13, a rule configuration module 14 and a test report module 15.

[0181] The process of implementing the web page performance detection method by the web page performance detection device includes:

[0182] Step 1: Install the data collection client module in the Chrome Dev browser;

[0183] Step 2: Start the data collection client module in the web page to be tested to complete the access configuration, including setting the test scenario label and the maximum test duration. After clicking the start button, the page test is performed according to the pre-designed test case. At the same time, the page performance consumption data is reported to the data collection server module;

[0184] Step 3: The data collection server module receives the collected and reported data and saves it to the database after processing and processing;

[0185] Step 4: Configure test comparison rules based on test requirements and maintain the test knowledge base based on existing knowledge and test experience;

[0186] Step 5: Present the data in the form of a test report chart on a web page, export a single scenario test report as needed, select two test scenarios based on the test scenario comparison requirements and select test comparison rules for comparative analysis, output the test report and comparison conclusions, and provide optimization suggestions.

[0187] This application proposal uses a Chrome extension program to collect and analyze the performance data and hardware consumption data generated by the page during the execution of the test case with standard data collection thinking, combines the test comparison rules and the test experience library to generate a test report, and intelligently generates comparative analysis conclusions and optimization suggestions.

[0188] 1. The access configuration module 11 is a bridge between the Web front-end application to be tested and the data collection client. This module provides an interface for the tester to set the test scenario label. After the setting is completed, the data collection client module 12 can be controlled to start collecting test data.

[0189] like Fig.12 As shown, the user can perform the following operations on the access configuration module 11:

[0190] a) Open the access configuration interface;

[0191] b) Define the test duration of the test scenario;

[0192] c) Input test tag;

[0193] d) Click the Start Collection button;

[0194] e) Verify the legitimacy of user input and start collecting test data after the verification passes.

[0195] The following is a detailed description of each module in the web page performance detection device:

[0196] 2. The carrier of the data collection client module 12 is usually a collection program, which is used to collect resource consumption and performance data of web application programs, including information such as CPU, memory, network, web page loading time, etc. In order to distinguish the test scenario corresponding to the collected data, each piece of collected data will be marked with a test scenario label, which is obtained from the access configuration module.

[0197] It should be noted that in the relevant technology, the front-end page data collection is usually completed by a collection SDK program, and the SDK is embedded in the web application to collect the required information. However, on the one hand, due to the browser security policy and the current implementation mechanism, there is no open interface that can directly obtain the CPU, network and other hardware consumption information in real time, so it is impossible to collect the CPU, network and other hardware consumption information; on the other hand, the SDK is embedded in the web application to be tested to collect data, which is bound to bring some transformation workload and cause intrusion to the test target. In the embodiment of the present application, an experimental interface is provided based on the Chrome development (develop) version to collect CPU, network and other hardware consumption information. The Chrome plug-in can be used to implement the collection program, and the plug-in program is integrated based on the Chrome develop version to collect test data. During implementation, the access configuration module can be integrated into the plug-in program.

[0198] Specifically, the developed Chrome plug-in mainly includes three parts: plug-in pop-up window interface, plug-in pop-up window control script, and extension script running in the web page. Among them, the plug-in pop-up window interface is used to provide an interactive interface for entering the test scenario limit time, test scenario label, and clicking the start collection button; the plug-in pop-up window control script is used to control the plug-in pop-up window interface interaction, collect resource consumption information of the process where the current browser window is located, communicate with the extension script running in the web page, and report the aggregated data to the data collection server module. The extension script running in the web page is used to receive the communication instructions sent by the plug-in pop-up window control script, collect page performance indicators and return them to the plug-in pop-up window control script.

[0199] It should be noted that the test scenario tag is used to mark the test scenario so that the collected data under each test scenario is marked with the test scenario tag corresponding to the test scenario. The test scenario tag is related to the test purpose input by the user, the web page to be tested, and the start time of the test scenario tag (such as the time when the user inputs the test tag).

[0200] For example, two input boxes are set in the plug-in pop-up interface to set the user-defined test scenario limit time L (in hours) and the test scenario label inputTag. The plug-in pop-up control script obtains the year (year), month (month), day (day), and hour (hour) corresponding to the current time every time data is collected, and compares them with the year, month, day, and hour corresponding to the current test scenario. If the difference is within the limit time L, the newly collected data is considered to belong to the current test scenario, and no new test scenario label is generated; otherwise, the year, month, day, and hour corresponding to the current test scenario are updated, and a new test scenario label is generated. Finally, combined with the address url of the current web page to be tested, a complete test scenario label is finally generated, which can be expressed as "${url} ${inputTag} ${year}-${month}-${day}-${hour}". Each reported test data can be expressed as { tag: "${url} ${inputTag} ${year}-${month}-${day}-${hour}", resource consumption data, performance indicator data}.

[0201] In some embodiments, in the plug-in pop-up control script, the chrome.processes.getProcessIdForTab method can be used to obtain the CPU, memory, and network resources occupied by the current browser window process; and the navigator.sendBeacon method can be used to report the collected data to the data collection server; in the extension script running in the web page, the PerformanceTiming method can be used to obtain the web page loading performance data, the location.href method can be used to obtain the current page URL information, and the navigator.hardwareConcurrency method can be used to obtain the number of client logical processors.

[0202] In some implementations, the plug-in pop-up control script can communicate with the extension script running in the Web page to obtain data collected by the extension script running in the Web page. For example: in the plug-in pop-up control script, the chrome.tabs.sendMessage method can be used to send information to the extension script running in the Web page; in the extension script running in the Web page, the chrome.runtime.onMessage.addListener method can be used to listen to messages from the plug-in pop-up control script, and reply to the plug-in pop-up control script through a callback function.

[0203] 3. The data collection server module 13 is used to receive the data collected and reported by the data collection client module 12, process the batch reported data, and save it in the database.

[0204] Fourth, the rule configuration module 14 has two functions: one is to configure the test comparison rules to assist in outputting the comparison test report and diagnostic conclusion of the two test scenarios; the other is to maintain the knowledge base and provide optimization suggestions for the test target object. This module can set the test comparison rules and experience knowledge base for indicators such as CPU consumption, memory consumption, network consumption, page loading time, etc., and agree to calculate the second test scenario in a way that is compared with the first test scenario.

[0205] In the embodiment of the present application, by setting test comparison rules, test pass rules, and a test experience knowledge base, it is possible to flexibly set comparison rules for single indicators, combined indicators, and overall test pass rules. By accumulating test experience and performance optimization experience through the test experience knowledge base, test reports and suggestions are generated on demand, and the testing needs in different scenarios can be met.

[0206] V. Test report module 15 includes three main functions: test result query, test scenario comparison, and test report export. This module analyzes and processes the collected data, forms an indicator trend chart, and outputs diagnostic conclusions and test reports based on rule configuration.

[0207] The web page performance detection device in the embodiment of the present application can not only use standard collection thinking to solve the time-consuming and labor-intensive problem of Web page performance consumption testing, but also compare two test scenarios and output a comparison test report and diagnostic conclusion.

[0208] In some implementations, one implementation of the Chrome collection plug-in is as follows:

[0209] The Chrome collection plug-in is used to complete access configuration, collect page loading time and resource consumption information, and report it to the collection server. The Chrome plug-in is essentially an application extension, usually a group of files compressed together, including HTML, CSS, Javascript scripts, image files, etc. For ease of explanation, the first component in the Chrome collection plug-in is called component A, the second component is called component B, and the third component is called component C:

[0210] 1) Implement component A, which usually corresponds to the default_popup field in the action configuration in the configuration file. The file is an HTML file and can be named popup.html. Set an input box in popup.html to limit the test scenario duration. The recommended default value is 2 hours, which can be adjusted as needed, but it is not recommended to exceed 4 hours; set an input box to enter the test scenario label; set a button to start test collection.

[0211] 2) Implement the test scenario tag generation and control logic, which is completed in component B. First, obtain the test scenario tag inputTag entered by the user, and then obtain the current page address url by communicating with the extended script running in the Web page (it can be intercepted according to actual needs. In this step, the number of logical processors of the client system processorNum can also be obtained for reference in the test scenario). Each time data is collected, the year, month, day, and hour corresponding to the current time are recorded. Finally, a complete test scenario tag is generated and recorded in the collected data. The format of the complete test scenario tag is "${url} ${inputTag} ${year}-${month}-${day}-${hour}".

[0212] 3) Implement page loading performance data collection. In component B, periodically (it is recommended to detect once every 2 to 3 seconds) send a communication request to component C to obtain the page loading time. If the page loading time is obtained and it is determined that it is not the same as the previous page loading, then record the page loading data and wait for reporting;

[0213] 4) Implement resource consumption data collection. In component B, use the chrome.tabs.query method to obtain the process ID of the current page window, recorded as processId, and use chrome.processes.onUpdatedWithMemory.addListener to monitor changes in the memory occupied by the browser process (usually changes once every 1 second). Based on processId, you can obtain the CPU consumption, total memory occupied, allocated memory, used memory, and network consumption of the process where the current window is located at the current moment, record resource consumption data, and wait for reporting.

[0214] 5) Add test scenario tags to the data and report them to the server. Start a scheduled task (once every 15 seconds) to centrally process the collected page loading data and resource consumption data. Based on the current time and the input test scenario tags, generate a complete test scenario tag and report it to the server through navigator.sendBeacon. Example: navigator.sendBeacon('${reportUrl}', JSON.stringify({ tag, physicalData,performanceData})).

[0215] 6) Implement component C. Listen to the communication events from component B through chrome.runtime.onMessage.addListener, determine the event instruction, if the instruction is to obtain the current page URL, then obtain the current page URL and the number of system logical processors processorNum, and reply to component B through the sendResponse method; if the instruction is to obtain the page loading performance, then obtain the page loading duration through PerformanceTiming (if the full loading duration fails, delay 2 seconds and try again), and reply to component B together with the timestamp of this loading (used to determine whether it is the same loading).

[0216] In some implementations, the data collection server module can use nodejs+mongodb to implement collection services and data query services.

[0217] In some implementations, the comparison rule configuration module provides a visualization page for comparison rule configuration. An implementation of the comparison rule configuration module is as follows:

[0218] 1) The CPU indicator supports configuration of absolute value difference and percentage difference. The combination condition can be at least one of "AND" and "OR". If the configuration rule is met, the diagnosis conclusion is passed. If the configuration rule is not met, the diagnosis conclusion is failed.

[0219] 2) The total memory indicator supports configuration of absolute value difference and percentage difference. The combination conditions can be AND / OR. If the configuration rule is met, the diagnosis conclusion is passed. If the configuration rule is not met, the diagnosis conclusion is failed.

[0220] 3) The memory allocation indicator supports configuration of absolute value difference and percentage difference. The combination conditions can be AND / OR. If the configuration rule is met, the diagnosis conclusion is passed. If the configuration rule is not met, the diagnosis conclusion is failed.

[0221] 4) Use memory indicators to support configuration of absolute value difference and percentage difference. The combination conditions can be AND / OR. If the configuration rules are met, the diagnosis conclusion is passed. If the configuration rules are not met, the diagnosis conclusion is failed.

[0222] 5) Network consumption indicators support configuration of absolute value difference and percentage difference. The combination conditions can be AND / OR. If the configuration rules are met, the diagnosis conclusion is passed. If the configuration rules are not met, the diagnosis conclusion is failed.

[0223] 6) The page loading time indicator supports the configuration of absolute value difference and percentage difference. The combination conditions can be AND / OR. When the configuration rules are met, the diagnosis conclusion is passed, and when the configuration rules are not met, the diagnosis conclusion is failed.

[0224] In some implementations, the user may install and configure the web page performance detection device to implement the web page performance detection method through the following operation process:

[0225] 1. Download Chrome Dev.

[0226] 2. Download the Chrome collection plug-in implemented based on this proposal and install it in Chrome Dev;

[0227] 3. After opening the web page to be detected, start the extension corresponding to the Chrome acquisition plug-in in the current window;

[0228] 4. Enter the test tag and click the "Start Collection" button;

[0229] 5. Perform web page testing operations based on the written test cases;

[0230] 6. Open the test result query page to see the collected data charts and trends.

[0231] The web page performance detection method provided in the embodiment of the present application can achieve the following technical effects:

[0232] Quantify resource consumption and trends generated when accessing a page;

[0233] Collect and summarize test data for multiple test scenarios;

[0234] During the data collection process, you can see the indicator trends formed by various types of data;

[0235] It can automatically compare the page performance and resource consumption of at least two test scenarios, and output test reports and comparison conclusions.

[0236] The web page performance detection method provided in the embodiment of the present application can be executed by a web page performance detection device. In the embodiment of the present application, the web page performance detection device executing the web page performance detection method is taken as an example to illustrate the web page performance detection device provided in the embodiment of the present application.

[0237] Reference Fig.13 , the embodiment of the present application also provides a web page performance detection device, such as Fig.13 As shown, the web page performance detection device 1300 includes:

[0238] The first determination module 1301 is used to determine a test scenario label according to user input information, wherein the test scenario label is used to indicate the test purpose of the web page performance detection and the web page to be detected;

[0239] The collection module 1302 is used to simulate a user accessing the web page to be tested according to the test scenario tag and a preset test case, and collect performance indicator data of a target web application and resource consumption data of a process where the target web application is located, wherein the web page to be tested is a current web page displayed in the target web application;

[0240] A first processing module 1303 is used to process the performance indicator data and the resource consumption data according to the test scenario label to generate test data;

[0241] The second processing module 1304 is used to match the test data with preset test comparison rules and / or indicator combination rules in a preset test experience library, and generate a test report based on the matching results, wherein the test report includes at least one of the following: web page performance detection results of a single test scenario, web page performance comparison conclusions of at least two test scenarios, and performance optimization suggestions for the web page to be tested.

[0242] Optionally, the target web application is a web application in a target browser, the target browser is installed with a collection plug-in, the collection plug-in includes a first component, a second component and a third component, wherein the first component is a plug-in pop-up window interface component, the second component is a plug-in pop-up window control script component, and the third component is an extension script component running in the web page;

[0243] The first determining module 1301 includes:

[0244] A first acquisition unit, used to acquire the test label information and test duration input by the user through the input box in the first component;

[0245] A second acquisition unit, configured to acquire the address of the webpage currently running in the target browser from the third component through the second component;

[0246] The first generating unit is used to generate a test scenario tag according to the test tag information and the web page address, wherein the time span of all collected data corresponding to the same test scenario tag is less than or equal to the test duration.

[0247] Optionally, the target browser has an interface capable of acquiring hardware consumption data;

[0248] The acquisition module 1302 includes:

[0249] A simulated access unit, used for simulating a user accessing the web page to be tested according to the test scenario label and a preset test case;

[0250] a first collecting unit, configured to collect resource consumption data of a target process in the target browser based on the second component, wherein the target process is a process corresponding to the target webpage application;

[0251] The second collecting unit is used to request the third component to collect performance indicator data of the target browser loading the web page to be detected through the second component.

[0252] Optionally, the preset test comparison rule is a rule for comparing web page performance in at least two test scenarios, and the preset test comparison rule includes at least one of the following:

[0253] An indicator type, wherein the indicator type includes at least one indicator of the performance indicator data and the resource consumption data;

[0254] An indicator comparison method, the indicator comparison method comprising a comparison method for comparing the same indicator value of the at least two test scenarios;

[0255] A judgment condition, wherein the judgment condition is used to judge whether the same indicator value of the at least two test scenarios satisfies a preset numerical relationship;

[0256] A combination condition, wherein the combination condition includes a combination of at least two of the judgment conditions;

[0257] A diagnosis conclusion is used to indicate whether the judgment condition or the combination condition is satisfied.

[0258] Optionally, the preset test experience library includes at least one indicator combination rule and a performance optimization suggestion corresponding to each of the indicator combination rules;

[0259] Each of the indicator combination rules includes a change trend or a value range of at least two indicators in the performance indicator data and the resource consumption data;

[0260] The test report includes performance optimization suggestions corresponding to the target indicator combination rule, the target indicator combination rule is at least one of the at least one indicator combination rule, and the indicator value in the test data satisfies the target indicator combination rule.

[0261] Optionally, the second processing module 1304 includes:

[0262] An input unit, used to receive a test result query request input by a user, wherein the test result query request includes a keyword of a test scenario label to be queried;

[0263] A query unit, used to query target test data matching the keyword;

[0264] The first processing unit is used to match the target test data with preset test comparison rules and / or indicator combination rules in a preset test experience library, and generate a test report according to the matching result.

[0265] Optionally, when the test data is matched with a preset test comparison rule, a test report is generated according to the matching result, and the target test data corresponds to the same test scenario label, the test report is used to indicate at least one of the following:

[0266] A change trend of resource consumption data in the target test data;

[0267] The changing trend of the performance indicator data in the target test data;

[0268] A statistical value of a target indicator of the target test data, wherein the target indicator is related to any indicator of the resource consumption data and the performance indicator data.

[0269] Optionally, when the test data is matched with a preset test comparison rule, a test report is generated according to the matching result, and the target test data corresponds to at least two test scenario labels, the test report is used to indicate at least one of the following:

[0270] The difference in the change trend of resource consumption data in the test scenarios corresponding to the at least two test scenario labels;

[0271] The difference in change trends of performance indicator data in the test scenarios corresponding to the at least two test scenario labels;

[0272] The statistical value difference of the target indicator in the test scenarios corresponding to the at least two test scenario labels, wherein the target indicator is related to any indicator in the resource consumption data and the performance indicator data.

[0273] The web page performance detection device 1300 provided in the embodiment of the present application can implement each process in the aforementioned web page performance detection method embodiment and achieve the same technical effect. To avoid repetition, it will not be described here.

[0274] The present application also provides an electronic device. Fig.14 , Fig.14 is a structural diagram of an electronic device provided in an embodiment of the present application. Since the principle of solving the problem by the electronic device is similar to the embodiment of the web page performance detection method described above in the present application, the implementation of the electronic device can refer to the implementation of the method, and the repeated parts will not be repeated. Fig.14 As shown, the electronic device includes: a processor 1400 and a memory 1420, and the processor 1400 is used to read the program in the memory 1420 and perform the following process:

[0275] Determine a test scenario label according to user input information, wherein the test scenario label is used to indicate the test purpose of the web page performance detection and the web page to be detected;

[0276] According to the test scenario tag, simulating a user accessing the web page to be tested according to a preset test case, and collecting performance indicator data of a target web application and resource consumption data of a process where the target web application is located, wherein the web page to be tested is a current web page displayed in the target web application;

[0277] Processing the performance indicator data and the resource consumption data according to the test scenario label to generate test data;

[0278] The test data is matched with preset test comparison rules and / or indicator combination rules in a preset test experience library, and a test report is generated according to the matching results, wherein the test report includes at least one of the following: web page performance detection results of a single test scenario, web page performance comparison conclusions of at least two test scenarios, and performance optimization suggestions for the web page to be tested.

[0279] Among them, Fig.14 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically one or more processors represented by processor 1400 and various circuits of memory represented by memory 1420 are linked together. The bus architecture may also link together various other circuits such as peripheral devices (such as mouse and keyboard), voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. Processor 1400 is responsible for managing the bus architecture and general processing, and memory 1420 may store data used by processor 1400 when performing operations.

[0280] Optionally, the target web application is a web application in a target browser, the target browser is installed with a collection plug-in, the collection plug-in includes a first component, a second component and a third component, wherein the first component is a plug-in pop-up window interface component, the second component is a plug-in pop-up window control script component, and the third component is an extension script component running in the web page;

[0281] The processor 1400 is further configured to read the program in the memory 1420 and execute the following process:

[0282] Obtaining the test label information and test duration input by the user through the input box in the first component;

[0283] Acquire the address of the webpage currently running in the target browser from the third component through the second component;

[0284] A test scenario tag is generated according to the test tag information and the web page address, wherein the time span of all collected data corresponding to the same test scenario tag is less than or equal to the test duration.

[0285] Optionally, the target browser has an interface capable of acquiring hardware consumption data;

[0286] The processor 1400 is further configured to read the program in the memory 1420 and execute the following process:

[0287] According to the test scenario label, simulating a user accessing the web page to be tested according to a preset test case;

[0288] collecting resource consumption data of a target process in the target browser based on the second component, wherein the target process is a process corresponding to the target webpage application;

[0289] The third component is requested to collect performance indicator data of the target browser loading the web page to be detected through the second component.

[0290] Optionally, the preset test comparison rule is a rule for comparing web page performance in at least two test scenarios, and the preset test comparison rule includes at least one of the following:

[0291] An indicator type, wherein the indicator type includes at least one indicator of the performance indicator data and the resource consumption data;

[0292] An indicator comparison method, the indicator comparison method comprising a comparison method for comparing the same indicator value of the at least two test scenarios;

[0293] A judgment condition, wherein the judgment condition is used to judge whether the same indicator value of the at least two test scenarios satisfies a preset numerical relationship;

[0294] A combination condition, wherein the combination condition includes a combination of at least two of the judgment conditions;

[0295] A diagnosis conclusion is used to indicate whether the judgment condition or the combination condition is satisfied.

[0296] Optionally, the preset test experience library includes at least one indicator combination rule and a performance optimization suggestion corresponding to each of the indicator combination rules;

[0297] Each of the indicator combination rules includes a change trend or a value range of at least two indicators in the performance indicator data and the resource consumption data;

[0298] The test report includes performance optimization suggestions corresponding to the target indicator combination rule, the target indicator combination rule is at least one of the at least one indicator combination rule, and the indicator value in the test data satisfies the target indicator combination rule.

[0299] Optionally, the processor 1400 is further configured to read a program in the memory 1420 and execute the following process:

[0300] Receive a test result query request input by a user, wherein the test result query request includes a keyword of a test scenario label to be queried;

[0301] Query target test data matching the keyword;

[0302] The target test data is matched with preset test comparison rules and / or indicator combination rules in a preset test experience library, and a test report is generated according to the matching results.

[0303] Optionally, when the test data is matched with a preset test comparison rule, a test report is generated according to the matching result, and the target test data corresponds to the same test scenario label, the test report is used to indicate at least one of the following:

[0304] A change trend of resource consumption data in the target test data;

[0305] The changing trend of the performance indicator data in the target test data;

[0306] A statistical value of a target indicator of the target test data, wherein the target indicator is related to any indicator of the resource consumption data and the performance indicator data.

[0307] Optionally, when the test data is matched with a preset test comparison rule, a test report is generated according to the matching result, and the target test data corresponds to at least two test scenario labels, the test report is used to indicate at least one of the following:

[0308] The difference in the change trend of resource consumption data in the test scenarios corresponding to the at least two test scenario labels;

[0309] The difference in change trends of performance indicator data in the test scenarios corresponding to the at least two test scenario labels;

[0310] The statistical value difference of the target indicator in the test scenarios corresponding to the at least two test scenario labels, wherein the target indicator is related to any indicator in the resource consumption data and the performance indicator data.

[0311] The electronic device provided in the embodiment of the present application can execute the aforementioned web page performance detection method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0312] The embodiment of the present application also provides a computer-readable storage medium for storing a computer program. The computer program can be executed by a processor, can implement the various steps of the aforementioned web page performance detection method embodiment, and can achieve the same beneficial effects as the aforementioned web page performance detection method embodiment. To avoid repetition, it will not be repeated here.

[0313] The embodiment of the present application also provides a computer program product, which is stored in a non-volatile storage medium. The computer program product is executed by at least one processor to implement the various steps of the aforementioned web page performance detection method embodiment, and can achieve the same beneficial effects as the aforementioned web page performance detection method embodiment. To avoid repetition, it will not be repeated here.

[0314] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices 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, such as multiple units or 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 through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0315] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may be physically included 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.

[0316] 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.) to perform some steps of the sending and receiving 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.

[0317] The above is a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles described in the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A web page performance detection method, characterized in that: include: Determine a test scenario label according to user input information, wherein the test scenario label is used to indicate the test purpose of the web page performance detection and the web page to be detected; According to the test scenario tag, simulating a user accessing the web page to be tested according to a preset test case, and collecting performance indicator data of a target web application and resource consumption data of a process where the target web application is located, wherein the web page to be tested is a current web page displayed in the target web application; Processing the performance indicator data and the resource consumption data according to the test scenario label to generate test data; The test data is matched with preset test comparison rules and / or indicator combination rules in a preset test experience library, and a test report is generated according to the matching results, wherein the test report includes at least one of the following: web page performance detection results of a single test scenario, web page performance comparison conclusions of at least two test scenarios, and performance optimization suggestions for the web page to be tested.

2. The method according to claim 1, characterized in that The target web application is a web application in a target browser, the target browser is installed with a collection plug-in, the collection plug-in includes a first component, a second component and a third component, wherein the first component is a plug-in pop-up window interface component, the second component is a plug-in pop-up window control script component, and the third component is an extension script component running in a web page; Determining the test scenario label according to the user input information includes: Obtaining the test label information and test duration input by the user through the input box in the first component; Acquire the address of the webpage currently running in the target browser from the third component through the second component; A test scenario tag is generated according to the test tag information and the web page address, wherein the time span of all collected data corresponding to the same test scenario tag is less than or equal to the test duration.

3. The method according to claim 2, characterized in that The target browser has an interface capable of acquiring hardware consumption data; The step of simulating a user accessing the web page to be tested according to the test scenario tag and a preset test case, and collecting performance indicator data of a target web application and resource consumption data of a process where the target web application is located, includes: According to the test scenario label, simulating a user accessing the web page to be tested according to a preset test case; collecting resource consumption data of a target process in the target browser based on the second component, wherein the target process is a process corresponding to the target webpage application; The third component is requested to collect performance indicator data of the target browser loading the web page to be detected through the second component.

4. The method according to any one of claims 1 to 3, characterized in that The preset test comparison rule is a rule for comparing the web page performance of at least two test scenarios, and the preset test comparison rule includes at least one of the following: An indicator type, wherein the indicator type includes at least one indicator of the performance indicator data and the resource consumption data; An indicator comparison method, the indicator comparison method comprising a comparison method for comparing the same indicator value of the at least two test scenarios; A judgment condition, wherein the judgment condition is used to judge whether the same indicator value of the at least two test scenarios satisfies a preset numerical relationship; A combination condition, wherein the combination condition includes a combination of at least two of the judgment conditions; A diagnosis conclusion is used to indicate whether the judgment condition or the combination condition is satisfied.

5. The method according to any one of claims 1 to 3, characterized in that The preset test experience library includes at least one indicator combination rule and a performance optimization suggestion corresponding to each indicator combination rule; Each of the indicator combination rules includes a change trend or a value range of at least two indicators in the performance indicator data and the resource consumption data; The test report includes performance optimization suggestions corresponding to the target indicator combination rule, the target indicator combination rule is at least one of the at least one indicator combination rule, and the indicator value in the test data satisfies the target indicator combination rule.

6. The method according to any one of claims 1 to 3, characterized in that The step of matching the test data with a preset test comparison rule and / or an indicator combination rule in a preset test experience library, and generating a test report according to the matching result, includes: Receive a test result query request input by a user, wherein the test result query request includes a keyword of a test scenario label to be queried; Query target test data matching the keyword; The target test data is matched with preset test comparison rules and / or indicator combination rules in a preset test experience library, and a test report is generated according to the matching results.

7. The method according to claim 6, characterized in that When the test data is matched with a preset test comparison rule, a test report is generated according to the matching result, and the target test data corresponds to the same test scenario label, the test report is used to indicate at least one of the following: A change trend of resource consumption data in the target test data; The changing trend of the performance indicator data in the target test data; A statistical value of a target indicator of the target test data, wherein the target indicator is related to any indicator of the resource consumption data and the performance indicator data.

8. The method according to claim 6, characterized in that When the test data is matched with a preset test comparison rule, a test report is generated according to the matching result, and the target test data corresponds to at least two test scenario labels, the test report is used to indicate at least one of the following: The difference in the change trend of resource consumption data in the test scenarios corresponding to the at least two test scenario labels; The difference in change trends of performance indicator data in the test scenarios corresponding to the at least two test scenario labels; The statistical value difference of the target indicator in the test scenarios corresponding to the at least two test scenario labels, wherein the target indicator is related to any indicator in the resource consumption data and the performance indicator data.

9. A web page performance detection device, characterized in that: include: A first determination module, used to determine a test scenario label according to user input information, wherein the test scenario label is used to indicate the test purpose of the web page performance detection and the web page to be detected; a collection module, configured to simulate a user accessing the web page to be tested according to the test scenario tag and a preset test case, and collect performance indicator data of a target web application and resource consumption data of a process where the target web application is located, wherein the web page to be tested is a current web page displayed in the target web application; A first processing module, used to process the performance indicator data and the resource consumption data according to the test scenario label to generate test data; The second processing module is used to match the test data with preset test comparison rules and / or indicator combination rules in a preset test experience library, and generate a test report based on the matching results, wherein the test report includes at least one of the following: web page performance detection results of a single test scenario, web page performance comparison conclusions of at least two test scenarios, and performance optimization suggestions for the web page to be tested.

10. An electronic device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor; characterized in that: The processor is used to read the program in the memory to implement the steps in the web page performance detection method as described in any one of claims 1 to 8.

11. A computer-readable storage medium for storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the web page performance detection method according to any one of claims 1 to 8 are implemented.

12. A computer program product, characterized in that It comprises computer instructions, which, when executed by a processor, implement the steps in the web page performance detection method as described in any one of claims 1 to 8.