Method for detecting page performance of Hybrid APP
By simulating the simulation environment of the Hybrid APP client and hijacking bridge communication, performance detection of the dependency-free client is realized, solving the problem of high performance detection cost of Hybrid APP page, improving detection efficiency and accuracy, and adopting the front-end technology stack programming language.
Patent Information
- Application Number
- CN202411023435.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2024-12-06
AI Technical Summary
Hybrid APP page performance detection technology has high detection cost. The existing methods rely on client operation and complex frame calculations, and cannot directly use non-invasive solutions, resulting in low efficiency and inaccurate detection results.
By simulating the simulation environment of the Hybrid APP client, hijacking the bridge communication method of the native client, using performance detection tools to perform performance detection on the simulation environment, collect performance data, and analyze and obtain performance detection reports to achieve performance detection without dependencies.
It reduces the detection cost of Hybrid APP page performance detection technology, realizes intrusion-free performance detection, improves detection efficiency and accuracy, and does not need to learn other technology stacks, and adopts the front-end technology stack programming language.
Smart Images

Figure CN119088654A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of base frame operation and maintenance, and in particular to a method for detecting the performance of a Hybrid APP page. Background Art
[0002] A hybrid app (hybrid application) is a mobile application that combines features of native and web applications. Hybrid apps are rapidly growing due to their advantages in development efficiency and cross-platform compatibility. Hybrid apps typically use web technologies (such as HTML, CSS, and JavaScript) to build their user interfaces, then access native device functionality through built-in browser components.
[0003] Because Hybrid APP pages involve native client-side bridge communication and cannot be opened in a browser, current performance testing technologies for Hybrid APP pages are mainly as follows: 1. Introducing a performance testing SDK into the page, accessing the webpage in the Hybrid APP, and collecting performance data; 2. Accessing the webpage in the Hybrid APP and performing screen recording and frame calculations to simulate and calculate performance data, thereby achieving the purpose of testing the performance of the Hybrid APP page. For example, Chinese invention patent CN115129563A discloses a webpage performance testing method and device, which includes: determining the website depth information of the website to be tested; the website depth information includes the website depth of the website to be tested and the page addresses corresponding to each website depth; crawling the target pages corresponding to each page address to obtain the page source code information corresponding to each page address; based on the page source code information, performing page access event simulation operations on each target page to obtain performance test results; the performance test results include a first performance test result corresponding to each target page and a second performance test result corresponding to the website to be tested. For example, Chinese invention patent CN115858900A discloses a website accessibility compliance detection method based on puppeteer, which includes: first, visiting a designated ancestral website; second, injecting an accessibility compliance detection script into the website and saving the web page Dom file. If there is no abnormality, the score of the web page is calculated based on the accessibility rules set by compliance and the results obtained by the detection script, and the same-origin and valid access links in the website are filtered out; then, based on the obtained valid access links, similar web pages are filtered out through a hierarchical traversal method and edit distance algorithm detection is added, and the above steps are repeated in sequence until the ancestral website has successfully calculated the specified number of page scores; finally, the scores of each web page obtained under the ancestral website are summarized to obtain a final score for the accessibility compliance of the ancestral website, i.e., the detection website.
[0004] However, during testing and production operations, the low performance of the Hybrid App page can cause client lag and a poor user experience. Furthermore, because the Hybrid App page involves client-side bridge communication, it cannot be opened by the browser, and non-invasive performance testing solutions such as Lighthouse cannot be used directly. Furthermore, introducing a performance testing SDK into the page introduces additional risks. Furthermore, frame calculations are complex, inefficient, and lack universality, and the test results depend on the video, making it impossible to obtain accurate and comprehensive performance data. Scripts are usually written in other technology stack languages such as Python, which are separated from the front-end technology stack and have a high learning cost.
[0005] Therefore, in summary, the existing technology has the problem of high detection cost of Hybrid APP page performance detection technology. Summary of the Invention
[0006] The embodiments of the present application provide a method for detecting the performance of a Hybrid APP page, thereby solving the problem of high detection costs of the Hybrid APP page performance detection technology in the prior art and reducing the detection costs of the Hybrid APP page performance detection technology.
[0007] An embodiment of the present application provides a method for Hybrid APP page performance detection, comprising the following steps: triggering a performance detection task and obtaining page performance detection configuration information; simulating a simulation environment of a Hybrid APP client according to the page performance detection configuration information; injecting code into the simulation environment to hijack the bridge communication method of the native client, and rewriting the bridge communication method of the native client into a client bridge interface interaction method in the simulation environment; based on the bridge interface method in the simulation environment, performing user login and performing proxy forwarding at the communication layer according to the page performance detection configuration information; based on the proxy forwarding at the communication layer, using a performance detection tool to perform performance detection on the page of the simulation environment and collect performance data; analyzing the performance data to obtain a performance detection report.
[0008] Optionally, after obtaining the performance test report, the method further includes: combining the performance test report with a triggering method of the performance test task to issue an early warning or quality control for the next performance data.
[0009] Optionally, the process of simulating the simulation environment of the Hybrid APP is as follows: creating a browser instance based on the Puppeteer library, creating a new page in the browser instance; and simulating the simulation environment of the Hybrid APP by setting page performance detection configuration information of the new page.
[0010] Optionally, the client bridge interface interaction method in the simulation environment includes the following steps: using Node.js to create a server, denoted as the Node.js server, as the client bridge interface in the simulation environment; determining the requirement information of the client bridge interface in the simulation environment, and defining the interface method corresponding to the requirement information in the Node.js server; when the client in the simulation environment sends a request to the Node.js server, the Node.js server receives and processes the request, and calls the corresponding interface method to execute the corresponding operation of the request based on the result of processing the request; and returns the execution result of the operation corresponding to the request to the client through the Node.js server.
[0011] An embodiment of the present application provides a system for Hybrid APP page performance detection, including a detection task triggering module, an environment simulation module, a bridge communication hijacking module, a login state injection module, a performance detection module and a performance data result analysis module: wherein the detection task triggering module is used to trigger the performance detection task and obtain page performance detection configuration information; the environment simulation module is used to simulate the simulation environment of the Hybrid APP client according to the page performance detection configuration information; the bridge communication hijacking module is used to inject code into the simulation environment, hijack the bridge communication method of the native client, and rewrite the bridge communication method of the native client into the client bridge interface interaction method in the simulation environment; the login state injection module is used to perform user login and perform proxy forwarding at the communication layer based on the bridge interface method in the simulation environment and according to the page performance detection configuration information; the performance detection module is used to perform performance detection on the page of the simulation environment based on the proxy forwarding of the communication layer using a performance detection tool to collect performance data; the performance data result analysis module is used to analyze the performance data and obtain a performance detection report.
[0012] Optionally, in the performance data result analysis module, after obtaining the performance test report, the method further includes: combining the performance test report with a triggering method of the performance test task to issue an early warning or quality access control for the next performance data.
[0013] Optionally, in the environment simulation module, the process of simulating the simulation environment of the Hybrid APP is: creating a browser instance based on the Puppeteer library, creating a new page in the browser instance; simulating the simulation environment of the Hybrid APP by setting page performance detection configuration information of the new page.
[0014] Optionally, in the bridge communication hijacking module, the client bridge interface interaction method in the simulation environment includes the following steps: using Node.js to create a server, denoted as the Node.js server, as the client bridge interface in the simulation environment; determining the requirement information of the client bridge interface in the simulation environment, and defining the interface method corresponding to the requirement information in the Node.js server; when the client in the simulation environment sends a request to the Node.js server, the Node.js server receives and processes the request, and calls the corresponding interface method to execute the corresponding operation of the request according to the result of processing the request; and returns the execution result of the operation corresponding to the request to the client through the Node.js server.
[0015] Among them, an embodiment of the present application also provides an electronic device, including: an instruction input device for inputting operation instructions; a memory for storing computer programs; and a processor for executing the computer program so that the electronic device implements the steps of the Hybrid APP page performance detection method.
[0016] An embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the computer program implements the steps of a method for detecting performance of a Hybrid APP page.
[0017] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:
[0018] 1. By simulating the simulation environment of the Hybrid App client and using performance testing tools to perform performance testing on the page, the page does not need to be run in the native App, making the detection independent of the client, thereby reducing the detection cost of the Hybrid App page performance detection technology and solving the problem of high detection cost of the Hybrid App page performance detection technology in the existing technology.
[0019] 2. By using the Puppeteer simulation environment, Node.js server bridging, hijacking page interactions, and combining triggering methods for early warning or quality control, there is no need to introduce additional SDKs into the page, thus achieving non-invasive performance detection.
[0020] 3. By adopting all front-end technology stack programming languages, there is no learning cost, and all front-end web pages can be supported, which makes it universal and practical. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 A flow chart of the method for detecting the performance of a Hybrid APP page provided in an embodiment of the present application;
[0022] Figure 2 A diagram showing the page performance detection structure provided in an embodiment of the present application;
[0023] Figure 3 This is a structural diagram of the Hybrid APP page performance detection system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0024] The embodiments of the present application provide a method for detecting page performance of a Hybrid APP, thereby solving the problem of high detection cost of the Hybrid APP page performance detection technology in the prior art. By simulating the simulation environment of the Hybrid APP client and performing performance testing on the page through a performance detection tool, the page does not need to be run in the native APP for detection, making the detection independent of the client, thereby reducing the detection cost of the Hybrid APP page performance detection technology.
[0025] The technical solution in the embodiments of this application is to solve the problem of high detection cost of Hybrid APP page performance detection technology. The overall idea is as follows:
[0026] Trigger performance detection tasks: trigger performance detection tasks through certain triggering methods, and obtain page performance detection configuration information; simulate Hybrid APP simulation environment: simulate the simulation environment of Hybrid APP client according to the page performance detection configuration information; hijack bridge communication: inject code into the simulation environment, hijack the bridge communication method of the native client, and rewrite the bridge communication method of the native client into the client bridge interface interaction method in the simulation environment; inject login state: based on the bridge interface method in the simulation environment, log in the user and perform proxy forwarding at the communication layer according to the page performance detection configuration information; use Lighthouse to detect performance: based on the proxy forwarding of the communication layer, use the performance detection tool to perform performance detection on the page of the simulation environment and collect performance data; analyze performance data results: analyze performance data and obtain a performance detection report, thereby reducing the detection cost of Hybrid APP page performance detection technology.
[0027] In order to better understand the above technical solution, the above technical solution will be described in detail below with reference to the accompanying drawings and specific implementation methods.
[0028] Example 1
[0029] like Figure 1As shown, it is a flow chart of a method for Hybrid APP page performance detection provided by an embodiment of the present application, which is applied to a system for Hybrid APP page performance detection, and the method includes the following steps: S10, triggering a performance detection task and obtaining page performance detection configuration information of the Hybrid APP page; S11, simulating the simulation environment of the Hybrid APP client according to the page performance detection configuration information through the Browser, Page and other class methods of the Puppeteer library; S12, injecting code into the simulation environment, hijacking the JsBridge bridge communication method of the native client, and rewriting the bridge communication method of the native client into a method for interaction through Node Native, that is, the client bridge interface interaction method in the simulation environment; S13, based on the bridge interface method in the simulation environment, judging whether it is necessary to enter the login state according to the page performance detection configuration information, if necessary, performing user login through Nodejs and performing proxy forwarding at the communication layer; S14, based on the proxy forwarding at the communication layer, using the performance detection tool Lighthouse to perform performance detection on the page of the simulation environment and collect performance data; S15, analyzing the performance data and obtaining a performance detection report.
[0030] In this embodiment, if Figure 2 As shown in the figure, it is a page performance detection structure diagram provided by an embodiment of the present application. In the figure, Hybrid APP Client simulation simulates the Hybrid APP client environment, Webview simulation simulates the environment of the Web part, and Native simulation simulates the functions of the native part. Performance data includes indicators such as page loading time, resource loading time, rendering performance, etc. The performance detection report includes performance analysis results, trend analysis results, warning information, quality access control information, etc., and also includes optimization suggestions for each analysis result, such as reducing resource loading time, optimizing the rendering process, etc.
[0031] Specifically, the performance detection task is triggered through some triggering methods to obtain the page performance detection configuration information, wherein the page performance detection configuration information mainly includes: page link address or route, whether login is required, device information (mobile phone model, screen size, etc.), client (Webview) information, etc. The triggering methods used to trigger the performance detection task include manual input or preset timer tasks, Git Hooks, etc., and the page performance detection configuration information is obtained by manual input or from preset information. By setting the triggering method, an alarm can be automatically triggered when the performance data reaches the warning threshold, and a quality gate can be set to ensure that the new code meets the performance requirements before it is merged into the main branch. Based on the capabilities of the Node.js server, continuous monitoring and trend analysis of performance data can also be achieved. For example, performance data can be collected regularly, and trends and patterns of performance changes can be discovered by analyzing historical data trends.
[0032] Furthermore, in the method for detecting performance of a Hybrid APP page, after obtaining the performance detection report, the method further includes: combining the performance detection report with a triggering method of the performance detection task to issue an early warning or quality control for the next performance data.
[0033] In this embodiment, in a performance monitoring scenario for an e-commerce website, performance data such as page load time and rendering metrics can be regularly collected. This performance data is analyzed. If a page's performance data fails to meet the target or fluctuates beyond a threshold within a certain time period, this issue is recorded in a performance monitoring report and optimization suggestions are provided to improve page performance. Furthermore, an early warning policy can be set to send an alert when page performance data triggers an alarm policy, allowing for timely detection and resolution of performance issues.
[0034] Furthermore, in the method for detecting page performance of a Hybrid APP, the process of simulating the simulation environment of the Hybrid APP is as follows: creating a browser instance based on the Puppeteer library, creating a new page in the browser instance; simulating the simulation environment of the Hybrid APP by setting page performance detection configuration information of the new page.
[0035] In this embodiment, the device model, client Webview configuration and environment variables, user agent, etc. are simulated according to the configuration information in step 10 through the Browser, Page and other class methods in the Puppeteer library, and finally the Webview simulation of the HybridAPP is realized.
[0036] Specifically, the Puppeteer library's Browser class methods are used to create a browser instance, simulating the entire browser's operating environment, including the browser window and rendering engine. A browser instance is equivalent to an instantiation of the entire browser program, used to manage multiple page objects (Pages). Next, the browser instance's newPage method is used to create a page object to load the Hybrid App page. Within the page object, Puppeteer library methods, such as emulate, exposeFunction, and evaluateOnNewDocument, are used to set the device model, client webview configuration, environment variables, and user agent, thereby simulating the Hybrid App's operating environment. The page object's goto method is then used to load the Hybrid App page, simulating the page loading process in a real environment. Finally, the Puppeteer library's API is used to interact with the loaded Hybrid App page as needed, such as executing JavaScript code and retrieving page content.
[0037] Specifically, interactive operations include: executing JavaScript code through the evaluate method of the page object to operate the page or obtain information about the page; using the methods of the page object to obtain the HTML content, screenshots and other information of the page for further analysis or display; using the methods of the page object to simulate user clicks, input and other operations to test whether the interactive performance or function of the page is normal; adding event listeners through the methods of the page object to listen to various events of the page, such as clicks, scrolling, etc., to monitor the behavior of the page; finding specific elements on the page through the methods of the page object and operating them, such as clicking buttons, filling out forms, etc.
[0038] Furthermore, in the method for detecting the performance of a Hybrid APP page, the client bridge interface interaction method in the simulation environment includes the following steps: using Node.js to create a server, denoted as the Node.js server, as the client bridge interface in the simulation environment; determining the requirement information of the client bridge interface in the simulation environment, and defining the interface method corresponding to the requirement information in the Node.js server; when the client in the simulation environment sends a request to the Node.js server, the Node.js server receives and processes the request, and calls the corresponding interface method to execute the corresponding operation of the request according to the result of processing the request; and returning the execution result of the operation corresponding to the request to the client through the Node.js server.
[0039] In this embodiment, a client bridge interface is implemented through Node.js to create a server-side application that provides various interface methods for processing network communication, encryption and decryption, taking pictures, recording, positioning, calling peripherals, and other functions. The ability to implement the client bridge interface through Node.js is denoted as Node Native, that is, the client bridge interface interaction method in the simulation environment. Since the interface method is implemented through Node.js native code, it does not rely on the client or other custom browser environments. At the same time, by hijacking the JsBridge bridge communication method of the native client, the bridge communication method of the native client is rewritten as the client bridge interface interaction method in the simulation environment, thereby solving the problem that the browser cannot load the hybrid application page normally and supporting bridge interface logic processing.
[0040] Specifically, because Node.js is a server-side runtime environment built on the Chrome V8 JavaScript engine, it enables JavaScript to run on the server, allowing developers to use the same language to write front-end and back-end code, achieving full-stack development. Therefore, based on the full use of front-end technology stack programming languages, the hybrid app page performance testing method provided in the embodiments of this application has no learning cost and can be supported by all front-end web pages, showing versatility and practicality.
[0041] Specifically, the built-in modules of Node.js can be used to process HTTP requests, WebSocket connections, etc. to achieve network communication with the client; the encryption modules of Node.js, including crypto, can be used to implement various encryption and decryption algorithms; the camera program can be executed by using the child process module of Node.js to achieve photo taking operations on the server side and return the photo data to the client; the audio processing modules of Node.js, including node-record-lpcm16, can be used to record sound, and the recorded data can be saved or transmitted to the client; the positioning modules of Node.js, including geolib, can be used to obtain the geographic location information of the device and return the location data to the client; the hardware modules of Node.js, including serialport and johnny-five, can be used to communicate with external devices and achieve interactive operations with various peripherals, where peripherals include sensors, actuators, etc.
[0042] The following introduces a system for detecting page performance of a Hybrid APP provided by an embodiment of the present invention. The system for detecting page performance of a Hybrid APP described below and the method for detecting page performance of a Hybrid APP described above can refer to each other.
[0043] Example 2
[0044] like Figure 3 As shown in FIG, a structure diagram of a Hybrid APP page performance detection system provided in an embodiment of the present application is provided. The Hybrid APP page performance detection system provided in an embodiment of the present application includes: a detection task triggering module 110, an environment simulation module 111, a bridge communication hijacking module 112, a login state injection module 113, a performance detection module 114 and a performance data result analysis module 115: wherein the detection task triggering module 110 is used to trigger the performance detection task and obtain the page performance detection configuration information; the environment simulation module 111 is used to simulate the Hybrid APP page performance detection configuration information according to the page performance detection configuration information. The simulation environment of the APP client; the bridge communication hijacking module 112 is used to inject code into the simulation environment, hijack the bridge communication method of the native client, and rewrite the bridge communication method of the native client into the client bridge interface interaction method in the simulation environment; the login state injection module 113 is used to log in the user and perform proxy forwarding of the communication layer based on the bridge interface method in the simulation environment according to the page performance detection configuration information; the performance detection module 114 is used to perform performance detection on the pages of the simulation environment based on the proxy forwarding of the communication layer, using the performance detection tool to collect performance data; the performance data result analysis module 115 is used to analyze the performance data and obtain a performance detection report.
[0045] As a preferred implementation, in the performance data result analysis module, after obtaining the performance test report, it also includes: combining the performance test report with the triggering method of the performance test task to issue an early warning or quality access control for the next performance data.
[0046] As a preferred implementation, in the environment simulation module, the process of simulating the simulation environment of the Hybrid APP is as follows: create a browser instance based on the Puppeteer library, create a new page in the browser instance; simulate the simulation environment of the Hybrid APP by setting the page performance detection configuration information of the new page.
[0047] As a preferred implementation, in the bridge communication hijacking module, the client bridge interface interaction method in the simulation environment includes the following steps: using Node.js to create a server, denoted as the Node.js server, as the client bridge interface in the simulation environment; determining the requirement information of the client bridge interface in the simulation environment, and defining the interface method corresponding to the requirement information in the Node.js server; when the client in the simulation environment sends a request to the Node.js server, the Node.js server receives and processes the request, and calls the corresponding interface method to execute the corresponding operation of the request according to the result of processing the request; and returns the execution result of the corresponding operation of the request to the client through the Node.js server.
[0048] The Hybrid APP page performance detection system of this embodiment is used to implement the aforementioned Hybrid APP page performance detection method. Therefore, the specific implementation method of the Hybrid APP page performance detection system can be seen in the embodiment part of the Hybrid APP page performance detection method in the previous text, for example, step S10, step S11, step S12, step S13, step S14, step S15 correspond to the detection task trigger module 110, the environment simulation module 111, the bridge communication hijacking module 112, the login state injection module 113, the performance detection module 114 and the performance data result analysis module 115 respectively, so its specific implementation method can refer to the description of the corresponding each part embodiment, which will not be repeated here.
[0049] Among them, an embodiment of the present application also provides an electronic device, including: an instruction input device for inputting operation instructions; a memory for storing computer programs; and a processor for executing the computer program so that the electronic device implements the steps of the Hybrid APP page performance detection method.
[0050] An embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the computer program implements the steps of a hybrid app page performance detection method.
[0051] In summary, with the help of the above-mentioned technical solution of the present invention, by simulating the simulation environment of the Hybrid APP client and performing performance testing on the page through the performance detection tool, the page does not need to be run in the native APP for detection, so that the detection does not rely on the client, thereby reducing the detection cost of the Hybrid APP page performance detection technology.
[0052] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional modules as needed, that is, the internal structure of the specific device can be divided into different functional modules to complete all or part of the functions described above.
[0053] Those skilled in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0054] In the several embodiments covered by this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the division of modules is merely a logical functional division, and in actual implementation, other division methods may be used, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not implemented. In addition, the coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or module, or can be an electrical, mechanical or other form of connection.
[0055] Modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical modules, i.e., they may be located in one place or distributed across multiple network modules. Some or all of the modules may be selected based on actual needs to achieve the objectives of the embodiments of the present application.
[0056] In addition, each functional module in each embodiment of the present application can be implemented in the form of hardware or in the form of software functional modules. If these functional modules are implemented in the form of software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or partly contributed to the prior art, or all or part of the technical solution can be embodied in the form of a computer program product, which includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer program product is stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. Available media may be magnetic media (eg, floppy disks, hard disks, tapes), optical media (eg, DVDs), or semiconductor media (eg, solid-state drives (SSDs)).
[0057] The above content is merely an example and explanation of the structure of the present invention. Those skilled in the art may make various modifications or additions to the described specific embodiments or replace them in a similar manner. As long as they do not deviate from the structure of the invention or exceed the scope defined by the claims, they should all fall within the scope of protection of the present invention.
Claims
1. A method for detecting the performance of a Hybrid APP page, characterized in that: The following steps are involved: Trigger the performance detection task and obtain the page performance detection configuration information; According to the page performance detection configuration information, simulate the simulation environment of the Hybrid APP client; Injecting code into the simulation environment, hijacking the bridge communication method of the native client, and rewriting the bridge communication method of the native client into a client bridge interface interaction method in the simulation environment; Based on the bridge interface method in the simulation environment, user login is performed and proxy forwarding of the communication layer is performed according to the page performance detection configuration information; Based on the proxy forwarding of the communication layer, a performance detection tool is used to perform performance detection on the pages of the simulation environment to collect performance data; Analyze the performance data and obtain a performance test report.
2. The method for detecting the performance of a Hybrid APP page according to claim 1, characterized in that: After the performance test report is obtained, the method further includes: combining the performance test report with the triggering method of the performance test task to issue an early warning or quality access control for the next performance data.
3. The method for detecting the performance of a Hybrid APP page according to claim 1, characterized in that: The process of simulating the simulation environment of HybridAPP is as follows: Create a browser instance based on the Puppeteer library and create a new page in the browser instance; By setting the page performance detection configuration information of the new page, the simulation environment of the Hybrid APP is simulated.
4. The method for detecting the performance of a Hybrid APP page according to claim 1, characterized in that: The client bridge interface interaction method in the simulation environment comprises the following steps: Use Node.js to create a server, denoted as Node.js server, as the client bridge interface in the simulation environment; Determine the requirements of the client bridge interface in the simulation environment and define the interface methods corresponding to the requirements in the Node.js server; When the client in the simulation environment sends a request to the Node.js server, the Node.js server receives and processes the request, and calls the corresponding interface method to perform the corresponding operation according to the processing result of the request; The Node.js server returns the corresponding operation execution result to the client.
5. A system for detecting performance of a Hybrid APP page, characterized in that: It includes detection task trigger module, environment simulation module, bridge communication hijacking module, login state injection module, performance detection module and performance data result analysis module: The detection task triggering module is used to trigger the performance detection task and obtain the page performance detection configuration information; The environment simulation module is used to simulate the simulation environment of the Hybrid APP client according to the page performance detection configuration information; The bridge communication hijacking module is used to inject code into the simulation environment, hijack the bridge communication method of the native client, and rewrite the bridge communication method of the native client into the client bridge interface interaction method in the simulation environment; The login state injection module is used to perform user login and proxy forwarding at the communication layer based on the bridge interface method in the simulation environment and according to the page performance detection configuration information; The performance detection module is used to perform performance detection on the pages of the simulation environment based on the proxy forwarding of the communication layer using the performance detection tool to collect performance data; The performance data result analysis module is used to analyze the performance data and obtain a performance test report.
6. The system for detecting the performance of a Hybrid APP page as claimed in claim 5, characterized in that: In the performance data result analysis module, after obtaining the performance test report, the method further includes: combining the performance test report with the triggering method of the performance test task to issue an early warning or quality access control for the next performance data.
7. The hybrid app page performance detection system as claimed in claim 5, characterized in that: In the environment simulation module, the process of simulating the simulation environment of the Hybrid APP is as follows: Create a browser instance based on the Puppeteer library and create a new page in the browser instance; By setting the page performance detection configuration information of the new page, the simulation environment of the Hybrid APP is simulated.
8. The system for detecting performance of a Hybrid APP page as claimed in claim 5, characterized in that: In the bridge communication hijacking module, the client bridge interface interaction method in the simulation environment includes the following steps: Use Node.js to create a server, denoted as Node.js server, as the client bridge interface in the simulation environment; Determine the requirements of the client bridge interface in the simulation environment and define the interface methods corresponding to the requirements in the Node.js server; When the client in the simulation environment sends a request to the Node.js server, the Node.js server receives and processes the request, and calls the corresponding interface method to perform the corresponding operation according to the processing result of the request; The Node.js server returns the corresponding operation execution result to the client.
9. An electronic device, characterized in that: include: An instruction input device, used for inputting operation instructions; Memory for storing computer programs; The processor is used to execute the computer program so that the electronic device implements the steps of the Hybrid APP page performance detection method as described in any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for detecting the performance of a Hybrid APP page are implemented as claimed in any one of claims 1 to 4.
