Methods, electronic devices, and storage media for testing the performance of quick application cards

Through JavaScript thread loading and performance monitoring, combined with the quick application debugger tool, it solves the problem of fast application card performance detection, realizes standardized evaluation and detection of card performance, and ensures that the card meets standards in terms of memory, power consumption and latency, improving user experience.

CN117707386BActive Publication Date: 2024-10-25HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311131406.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-31
Publication Date
2024-10-25
Estimated Expiration
2043-08-31

AI Technical Summary

Technical Problem

Existing technology is difficult to effectively detect and evaluate the performance of quick application cards, resulting in the inability to ensure that the cards meet standards in terms of memory, power consumption, and latency, affecting user experience.

Method used

Load quick application cards through JavaScript threads, register performance monitoring, trigger preset method functions during the loading process, obtain and parse performance parameters, compare with preset standards to determine the performance results of the card, and use the quick application debugger tool for standardized detection .

Benefits of technology

It achieves intuitive evaluation and standardized testing of fast application card performance, ensuring that the card meets standards in terms of memory, power consumption and latency, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117707386B_ABST
    Figure CN117707386B_ABST
Patent Text Reader

Abstract

The present application provides a method, electronic device and storage medium for detecting the performance of quick application cards, and relates to the field of terminal technology. Load the first quick application card through a JavaScript thread; register to monitor the performance of the first quick application card; at each stage of the first quick application card loading process, trigger the execution of the corresponding preset method function, and obtain the specific fields of the preset method function by calling the preset interface function; perform data analysis on the specific fields of the preset method function to obtain multiple performance parameters of the first quick application card, and compare them with the preset standard parameters to determine whether the performance result of the first quick application card is qualified or unqualified. The present application has formulated a performance evaluation standard for quick application cards, which can detect the corresponding performance information of quick application cards based on the RPK files of the quick application cards that are listed for review, and can intuitively evaluate whether the listed cards meet the performance standards in terms of memory, power consumption, and latency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a method for detecting performance of a quick application card, an electronic device, and a storage medium. Background Art

[0002] Quick apps are a new form of mobile apps that can be used instantly without downloading or installing. A card is a page defined in a quick app, and is an information carrier that is embedded in other apps for display. A quick app can correspond to multiple cards, and each card can only correspond to one page. Quick app cards can be embedded and displayed in native apps in various usage scenarios, such as: negative one screen, desktop, quick service center, global search, etc.

[0003] At present, there are many types of quick application cards with different performances. In order to standardize quick application cards, it is necessary to perform performance testing on quick application cards. Only quick application cards that meet the performance standards can be applied to mobile phones. Therefore, a method that can detect whether the performance of quick application cards meets the standards is urgently needed. Summary of the invention

[0004] The present application provides a method, an electronic device, and a storage medium for detecting the performance of a quick application card. The performance evaluation standard for the quick application card is formulated, and the corresponding performance information of the quick application card can be detected for the RPK file of the quick application card that is put on the shelf for review. It can intuitively evaluate whether the performance of the put-on card in terms of memory, power consumption, and latency meets the standards.

[0005] In a first aspect, the present application provides a method for detecting the performance of a quick application card, the method comprising: loading a first quick application card through a JavaScript thread; registering to perform performance monitoring on the first quick application card; at each stage of the first quick application card loading process, triggering the execution of a corresponding preset method function, and obtaining a specific field of the preset method function by calling a preset interface function; performing data parsing on the specific field of the preset method function to obtain multiple performance parameters of the first quick application card; wherein the multiple performance parameters include memory performance parameters, latency performance parameters and / or power consumption performance parameters; determining a performance result of the first quick application card (the performance result is unqualified or qualified) according to the multiple performance parameters of the first quick application card and preset standard parameters; and displaying the multiple performance parameters and the performance result of the first quick application card through a display screen of an electronic device.

[0006] Through the method for detecting the performance of quick application cards provided by the embodiment of the present application, the first quick application card is loaded through a JavaScript thread; the performance monitoring of the first quick application card is registered; at each stage of the first quick application card loading process, the corresponding preset method function is triggered to execute respectively, and the specific fields of the preset method function are obtained by calling the preset interface function; the specific fields of the preset method function are analyzed to obtain multiple performance parameters of the first quick application card, and compared with the preset standard parameters to determine whether the performance result of the first quick application card is qualified or unqualified. This application has formulated performance evaluation standards for quick application cards, and can detect the corresponding performance information of quick application cards for the RPK files of the quick application cards that are listed for review, and can intuitively evaluate whether the listed cards meet the performance standards in terms of memory, power consumption, and latency.

[0007] Among them, the various stages of the first quick application card loading process include card SDK initialization, card VDom parsing, card first screen loading, card full loading, card rendering, card network request, card loading image container, etc.

[0008] Among them, the multiple performance parameters of the first quick application card may include at least one of the following: card VDom parsing time, card first screen loading time, card full loading time, page rendering times / duration, number of network requests, network request data size, maximum single network request time, number of request errors, image container size, number of image requests, PSS before card addition, PSS after card loading is completed, and PSS occupied by card.

[0009] In one possible implementation, the method is applied to an electronic device, and the electronic device is installed with a quick application debugger and a quick application engine. The quick application debugger is used to instruct the quick application engine to load a first quick application card; the quick application engine is used to create a JavaScript thread and load the first quick application card through the JavaScript thread. The quick application debugger is used to register with the quick application engine to monitor the performance of the first quick application card and create a preset interface function.

[0010] This application solution can formulate quick application card performance standards based on actual usage needs, and provide a standardized tool "Quick Application Debugger" program, which can be used to detect the corresponding performance information of the quick application RPK when the quick application RPK is put on the shelf for review. The corresponding performance information of the quick application RPK includes card performance parameters. Through the quick application card performance standards and standardized tools, it is possible to intuitively evaluate whether the power consumption performance of the put-on card meets the standards.

[0011] In a possible implementation, the preset interface function is an onPerformanceCallback interface function, and the preset interface function supports being called by a quick app debugger and a quick app engine.

[0012] Through this application solution, the quick application debugger registers the card performance monitoring with the quick application engine, and adds a performance callback (onPerformanceCallback) interface based on the original card monitoring interface setRenderListener to facilitate obtaining performance parameters at each stage of the card loading process.

[0013] In a possible implementation, each stage of the first quick application card loading process includes a first stage and a second stage, the preset method function corresponding to the first stage is the first method function, and the preset method function corresponding to the second stage is the second method function. In each stage of the first quick application card loading process, the corresponding preset method function is triggered to execute respectively, and the specific field of the preset method function is obtained by calling the preset interface function, including: in the first stage, the quick application engine triggers the execution of the first method function, and calls the preset interface function to call back the specific field of the first method function to the quick application debugger; and, in the second stage, the quick application engine triggers the execution of the second method function, and calls the preset interface function to call back the specific field of the second method function to the quick application debugger.

[0014] It should be noted that the above-mentioned first stage and second stage, first method function and second method function are all exemplary. Each stage of the first quick application card loading process includes two or more stages, not limited to the above-mentioned first stage and second stage. Each stage corresponds to a method function.

[0015] In a possible implementation, the performing of data analysis on a specific field of a preset method function to obtain multiple performance parameters of the first quick app card includes: the quick app debugger performs data analysis on the specific field of the first method function to obtain a first performance parameter of the first quick app card; the quick app debugger performs data analysis on the specific field of the second method function to obtain a second performance parameter of the first quick app card. The multiple performance parameters of the first quick app card include the first performance parameter and the second performance parameter.

[0016] Through the above solution, the quick application debugger parses data according to the action field to obtain the time of each stage of card loading. The quick application debugger can record the parameter values ​​at different stages of the card debugging process and determine the card-related performance information based on the recorded parameter values.

[0017] In one possible implementation, the first method function is the onPerformance(action, key, time) function, and the specific fields of the first method function include action, key, and time; wherein action is the identifier corresponding to each stage of the card loading process, key is the parameter name corresponding to each stage of the card loading process, and time is the time corresponding to each stage of the card loading process.

[0018] In one possible implementation, the second method function is an onPerformance(action,info) function, and the specific fields of the second method function include action and info; wherein action is an identifier corresponding to each stage of the card loading process, and info is performance information corresponding to each stage of the card loading process.

[0019] In a possible implementation, before loading the first quick app card through the JavaScript thread, the method further includes: in response to a user operation, the quick app debugger starts a performance test on the first quick app card and starts timing.

[0020] In one possible implementation, after the quick app debugger starts to perform performance testing on the first quick app card, and before determining the performance result of the first quick app card based on multiple performance parameters of the first quick app card, the method further includes: after the timing duration reaches a preset cycle duration, the quick app debugger stops performing performance testing on the first quick app card.

[0021] In the embodiment of the present application, the preset cycle length may be 15 seconds, which serves as the detection cycle of the quick application card.

[0022] In a possible implementation, the multiple performance parameters include a memory performance parameter, and the memory performance parameter includes a first memory occupancy required for loading the first quick application card.

[0023] After the quick app debugger starts to perform performance testing on the first quick app card, the method further includes: the quick app debugger calls the System.gc() function to perform memory garbage cleaning; the quick app debugger counts the memory size of the first quick app card before loading; after the timing duration reaches a preset cycle duration, the quick app debugger counts the memory size of the first quick app card after loading; the quick app debugger determines the first memory occupancy based on the memory size of the first quick app card before loading and the memory size after loading.

[0024] Among them, before loading the card, the memory garbage is cleared first, the first PSS memory value is counted, and a 15-second delay is performed as the memory statistical period. When the 15-second period is up, the second PSS memory value is counted again, and the memory value-added brought by card loading is calculated based on the difference between the second PSS memory value and the first PSS memory value.

[0025] Through the above solution, after the quick app card is successfully downloaded and installed, if the user clicks the start debugging control in the quick app debugger interface, the quick app debugger can call the System.gc() function to clean up memory garbage. By actively cleaning up memory garbage, the PSS memory size before the card is loaded can be accurately counted.

[0026] In a possible implementation, the above-mentioned multiple performance parameters include latency performance parameters, and the latency performance parameters include card virtual DOM parsing time, card first screen loading time, card full loading time, and / or rendering time.

[0027] The data parsing of the specific field of the preset method function to obtain multiple performance parameters of the first quick application card includes: the quick application debugger obtains the specific field by calling the preset interface function; wherein the specific field includes a first field, a second field and a third field; wherein the first field carries an identifier corresponding to each stage of the card loading process, the second field carries a parameter name corresponding to each stage of the card loading process, and the third field carries the time corresponding to each stage of the card loading process; the quick application debugger parses the specific field to obtain the execution time of each stage of the card loading process, and calculates the time difference based on the execution time of each stage of the card loading process to determine the latency performance parameter.

[0028] Through the above solution, the quick app debugger registers the card performance monitoring callback onPerformanceCallback, and during the card rendering process, calls back the timing and time of the current card rendering. The quick app debugger can parse data based on specific fields called back from the quick app engine to obtain the time of each stage of card loading.

[0029] For example, the following lists the different tags representing different stages: action = 0, representing the start of loading. action = 8, representing the start of VDom parsing. action = 9, representing the completion of VDom parsing. action = 11, representing the first screen rendering. action = 10, representing refresh.

[0030] In one possible implementation, the above-mentioned multiple performance parameters include power consumption performance parameters, and the power consumption performance parameters include the number of network requests, the network request data size, the maximum time consumption of a single network request, the number of request errors, the image container size, and / or the number of image requests.

[0031] The data parsing of the specific field of the preset method function to obtain multiple performance parameters of the first quick application card includes: the quick application debugger obtains the specific field by calling the preset interface function; wherein the specific field includes the first field and the fourth field; wherein the first field carries the identifier corresponding to each stage of the card loading process, and the fourth field carries the performance information corresponding to each stage of the card loading process; the quick application debugger parses the specific field to obtain the power consumption performance parameter.

[0032] Through the above solution, when the card makes a network request, the request URL and current time are used as parameters and are called back to the quick application debugger through the onPerformanceCallback interface. When the network request returns, the message size is calculated based on the response message, and the end time, request URL, request time, and data size are used as parameters and are called back to the quick application debugger through the onPerformanceCallback interface. After receiving the data, the quick application debugger parses and assigns values ​​according to the action field.

[0033] Through the above solution, when the card uses the image component to set the background image, the image URL and the current time are used as parameters to trigger the onPerformance(action, info) method, and the onPerformanceCallback callback is sent to the quick app debugger. After receiving the data, the quick app debugger obtains the number of times the image resource is loaded according to the action field.

[0034] Through the above solution, when the card updates data information, the image URL, current time, image size, and control size are used as parameters to trigger the onPerformance(action, info) method, and the onPerformanceCallback callback is sent to the quick app debugger. After receiving the data, the quick app debugger obtains the image size and container size according to the action field.

[0035] In a possible implementation, determining the performance result of the first quick app card according to multiple performance parameters and preset standard parameters of the first quick app card includes: comparing each performance parameter value in the multiple performance parameters with the corresponding preset standard parameter, and determining a score for each performance parameter in the multiple performance parameters according to the comparison result; determining an overall performance score of the first quick app card according to the scores of all performance parameters in the multiple performance parameters; and determining the performance result of the first quick app card according to a comparison result of the overall performance score of the first quick app card with a preset score threshold.

[0036] In a possible implementation, determining the overall performance score of the first quick app card based on the scores of all performance parameters in the multiple performance parameters includes: performing weighted summation on the scores of all performance parameters in the multiple performance parameters to obtain the overall performance score of the first quick app card; wherein each performance parameter in the multiple performance parameters is preset with a corresponding weight value.

[0037] Through the present application scheme, the quick application debugger calculates and statistics the card performance parameters, and then determines the scores corresponding to the multiple performance parameters of the quick application card, and performs weighted summation on the scores corresponding to the multiple performance parameters of the quick application card to obtain the overall performance score of the quick application card. Based on the comparison result of the overall performance score of the quick application card with the preset score threshold, the performance result of the quick application card is determined, and the performance result is the current cycle detection result. The quick application debugger displays the current cycle detection result, which includes card performance information and debugging results.

[0038] In some embodiments, the debugging result is a pass or a fail.

[0039] In other embodiments, the debugging result is pass, fail, or excellent.

[0040] In a possible implementation, the quick application debugger includes a card software development kit SDK. The acquiring of specific fields of a preset method function by calling a preset interface function includes: the quick application debugger calls a preset interface function through the card SDK to acquire specific fields of the preset method function.

[0041] In one possible implementation, before loading the first quick app card through the JavaScript thread, the method further includes: the electronic device installing and downloading a quick app debugger; the electronic device displaying an application icon of the quick app debugger; in response to a user operation on the application icon of the quick app debugger, the electronic device starting the quick app debugger and loading a quick app engine; the quick app engine includes a quick app RPK file.

[0042] The loading of the first quick app card through the JavaScript thread includes: in response to a user selecting a quick app RPK file corresponding to the first quick app card and triggering an operation to start detection, the electronic device creates a JavaScript thread through a quick app engine and loads the first quick app card.

[0043] In a second aspect, the present application provides a device for detecting the performance of a quick application card, the device comprising a unit for executing the method in the first aspect. The device may correspond to executing the method described in the first aspect, and the relevant description of the unit in the device can refer to the description of the first aspect, which will not be repeated here for the sake of brevity.

[0044] The method described in the first aspect above can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above functions. For example, a processing module or unit, a display module or unit, etc.

[0045] In a third aspect, the present application provides an electronic device, comprising a processor, a computer program or instructions stored in the processor and a memory, wherein the processor is configured to execute the computer program or instructions so that the method in the first aspect is executed.

[0046] In a fourth aspect, the present application provides a computer-readable storage medium on which a computer program (also referred to as instructions or codes) for implementing the method in the first aspect is stored. For example, when the computer program is executed by a computer, the computer can perform the method in the first aspect.

[0047] In a fifth aspect, the present application provides a chip, including a processor. The processor is used to read and execute a computer program stored in a memory to perform the method in the first aspect and any possible implementation thereof. Optionally, the chip also includes a memory, and the memory is connected to the processor via a circuit or wire.

[0048] In a sixth aspect, the present application provides a chip system, including a processor. The processor is used to read and execute a computer program stored in a memory to perform the method in the first aspect and any possible implementation thereof. Optionally, the chip system also includes a memory, and the memory is connected to the processor via a circuit or wire.

[0049] In a seventh aspect, the present application provides a computer program product, which includes a computer program (also referred to as instructions or codes). When the computer program is executed by an electronic device, the electronic device implements the method in the first aspect.

[0050] It can be understood that the beneficial effects of the second to seventh aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 A schematic diagram of an electronic device displaying a quick application card provided by an embodiment of the present application;

[0052] Figure 2 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0053] Figure 3A A schematic diagram of a software architecture of an electronic device provided in an embodiment of the present application Figure 1 ;

[0054] Figure 3B A schematic diagram of a software architecture of an electronic device provided in an embodiment of the present application Figure 2 ;

[0055] Figure 4 A flowchart of a method for detecting the performance of a quick application card provided in an embodiment of the present application;

[0056] Figure 5 A schematic diagram of the performance parameters of the quick application card provided in the embodiment of the present application;

[0057] Figure 6 A schematic diagram of a PSS memory in a method for detecting quick application card performance provided in an embodiment of the present application;

[0058] Fig. 7A and Figure 7B A schematic diagram of an application scenario of the method for detecting the performance of a quick app card provided in an embodiment of the present application;

[0059] Figure 8 A timing diagram of a method for detecting the performance of a quick application card provided in an embodiment of the present application;

[0060] Fig. 9 A timing diagram of another method for detecting the performance of a quick application card provided in an embodiment of the present application;

[0061] Fig.10 A schematic block diagram of an apparatus for detecting quick app card performance provided in an embodiment of the present application. DETAILED DESCRIPTION

[0062] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0063] The term "and / or" in this article is a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The symbol " / " in this article indicates that the associated objects are in an or relationship, for example, A / B means A or B.

[0064] The terms "first" and "second" in the specification and claims herein are used to distinguish different objects rather than to describe a specific order of objects. In the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" refers to two or more than two, for example, multiple processing units refer to two or more processing units, etc.; multiple elements refer to two or more elements, etc.

[0065] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0066] Quick apps are a new type of application. In the past, there were two main types of mobile applications: web pages and native apps. Web pages do not require installation, but the experience is not very good; native apps have a smooth experience, but they need to be downloaded and installed from the app store, making it difficult to reach users in one step. The emergence of quick apps allows users to experience the application content smoothly without downloading and installing, and can be used immediately.

[0067] A quick app card is a page defined in a quick app. It is an information carrier that is embedded in other apps for display. A quick app can correspond to multiple cards, and each card can only correspond to one page. Quick app cards can be embedded and displayed in native apps in various usage scenarios, such as: negative one screen, desktop, quick service center, global search, etc.

[0068] For example, Figure 1 (a) in the figure shows a schematic diagram of displaying the quick application card "Top News List" in the quick service center interface.

[0069] For example, Figure 1 (b) in the figure shows a schematic diagram of displaying the quick application card "Travel Navigation" in the negative one screen interface.

[0070] For example, Figure 1 (c) in the figure shows a schematic diagram of displaying the quick application card "Flight Schedule" in the desktop interface.

[0071] At present, there are many types of quick application cards with different performances. In order to standardize quick application cards, it is necessary to perform performance testing on quick application cards. Only quick application cards that meet the performance standards can be applied to mobile phones. Therefore, a method that can detect whether the performance of quick application cards meets the standards is urgently needed.

[0072] Based on this, the embodiments of the present application provide a method and electronic device for detecting the performance of a quick application card, which improves the user experience by making improvements at the bottom layer of the mobile phone system.

[0073] In order to better understand the embodiments of the present application, the embodiments of the present application are briefly described below:

[0074] The first quick app card is loaded through a JavaScript thread; the performance monitoring of the first quick app card is registered; at each stage of the first quick app card loading process, the corresponding preset method function is triggered to execute respectively, and the specific field of the preset method function is obtained by calling the preset interface function; the specific field of the preset method function is analyzed to obtain multiple performance parameters of the first quick app card; wherein the multiple performance parameters include memory performance parameters, latency performance parameters and / or power consumption performance parameters; according to the multiple performance parameters of the first quick app card and the preset standard parameters, the performance result of the first quick app card is determined (the performance result is unqualified or qualified); and the multiple performance parameters and the performance result of the first quick app card are displayed on the display screen of the electronic device.

[0075] Through the method for detecting the performance of quick application cards provided by the embodiment of the present application, the first quick application card is loaded through a JavaScript thread; the performance monitoring of the first quick application card is registered; at each stage of the first quick application card loading process, the corresponding preset method function is triggered to execute respectively, and the specific fields of the preset method function are obtained by calling the preset interface function; the specific fields of the preset method function are analyzed to obtain multiple performance parameters of the first quick application card, and compared with the preset standard parameters to determine whether the performance result of the first quick application card is qualified or unqualified. This application has formulated performance evaluation standards for quick application cards, and can detect the corresponding performance information of quick application cards for the RPK files of the quick application cards that are listed for review, and can intuitively evaluate whether the listed cards meet the performance standards in terms of memory, power consumption, and latency.

[0076] Hereinafter, an electronic device to which the method for detecting the performance of a quick application card provided in an embodiment of the present application is applied will be described with reference to the accompanying drawings.

[0077] Exemplarily, the electronic device in the embodiments of the present application may be a mobile phone, a tablet computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), a wearable device (such as a smart watch, a smart bracelet), and other devices with voice communication functions. The embodiments of the present application do not impose any special restrictions on the specific form of the electronic device.

[0078] For example, taking the electronic device as a mobile phone, Figure 2 FIG. 1 shows a schematic diagram of the structure of another electronic device provided in an embodiment of the present application. That is, for example, Figure 2 The electronic device shown may be a mobile phone.

[0079] like Figure 2 As shown, the mobile phone may include: a processor 310, an external memory interface 320, an internal memory 321, a universal serial bus (USB) interface 330, a charging management module 340, a power management module 341, a battery 342, an antenna 1, an antenna 2, a mobile communication module 350, a wireless communication module 360, an audio module 370, a speaker 370A, a receiver (i.e., an earpiece) 370B, a microphone 370C, an earphone interface 370D, a sensor module 380, a button 390, a motor 391, an indicator 392, a camera 393, a display screen 394, and a subscriber identification module (SIM) card interface 395, etc.

[0080] Exemplarily, the sensor module may include sensors such as a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, and a bone conduction sensor. In an embodiment of the present application, the electronic device may detect whether the user's ear is close to the receiver through sensors such as a proximity light sensor (i.e., a light sensor) and a distance sensor. For example, the electronic device may detect whether there is an obstruction in front of the front panel (or screen) of the mobile phone, and the distance between the obstruction and the screen through a distance sensor to determine whether the current user's ear is close to the receiver.

[0081] It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the mobile phone. In other embodiments, the mobile phone may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0082] The processor 310 may include one or more processing units, for example, the processor 310 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0083] The processor 310 is used to: load the first quick app card through a JavaScript thread; register to perform performance monitoring on the first quick app card; trigger the execution of the corresponding preset method function at each stage of the first quick app card loading process, and obtain the specific field of the preset method function by calling the preset interface function; perform data analysis on the specific field of the preset method function to obtain multiple performance parameters of the first quick app card; wherein the multiple performance parameters include memory performance parameters, latency performance parameters and / or power consumption performance parameters; determine the performance result of the first quick app card (the performance result is unqualified or qualified) according to the multiple performance parameters of the first quick app card; and instruct the display screen of the electronic device to display the multiple performance parameters and performance results of the first quick app card.

[0084] The controller can be the nerve center and command center of the mobile phone. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.

[0085] The processor 310 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 310 is a cache memory. The memory may store instructions or data that the processor 310 has just used or cyclically used. If the processor 310 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 310, and thus improves the efficiency of the system.

[0086] In some embodiments, the processor 310 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0087] It is understandable that the interface connection relationship between the modules illustrated in this embodiment is only a schematic illustration and does not constitute a structural limitation on the mobile phone. In other embodiments, the mobile phone may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0088] The wireless communication function of the mobile phone can be realized through antenna 1, antenna 2, mobile communication module 350, wireless communication module 360, modem processor and baseband processor.

[0089] The mobile phone can realize the display function through a GPU, a display screen 394, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 394 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 310 may include one or more GPUs, which execute program instructions to generate or change display information. The display screen 394 is used to display images, videos, etc.

[0090] In the embodiment of the present application, the display screen 394 is used to display the application icon of the quick application debugger and the interactive interface of the quick application debugger.

[0091] In the embodiment of the present application, the display screen 394 is also used to display multiple performance parameters and performance results of the first quick app card.

[0092] In an embodiment of the present application, the entrance to the quick application card can be set on different interfaces of the display screen, which can be preset by the system or customized by the user. For example, the quick application card can be displayed on the desktop of the display screen, or on the negative one screen of the display screen, or in the quick service center of the display screen, or in the lock screen interface. For a folding screen electronic device with a small screen, the quick application card can be displayed on the small screen.

[0093] The external memory interface 320 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone. The internal memory 321 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 310 executes various functional applications and data processing of the mobile phone by running the instructions stored in the internal memory 321. For example, in an embodiment of the present application, the processor 310 can execute instructions stored in the internal memory 321, and the internal memory 321 may include a program storage area and a data storage area.

[0094] The mobile phone can realize audio functions such as music playing and recording through the audio module 370, the speaker 370A, the receiver (ie, the handset) 370B, the microphone 370C, the earphone interface 370D, and the application processor.

[0095] The above is a specific description of the embodiments of the present application using an electronic device as an example. It should be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. The electronic device may have more or fewer components than those shown in the figure, may combine two or more components, or may have different component configurations. The various components shown in the figure may be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and / or application specific integrated circuits.

[0096] The electronic device provided in the embodiments of the present application may be a user equipment (UE), for example, a mobile terminal (such as a user's mobile phone), a tablet computer, a desktop computer, a laptop computer, a handheld computer, a netbook, a personal digital assistant (PDA), and the like.

[0097] In addition, an operating system is running on the above hardware. The operating system of the operating system layer can be any one or more computer operating systems that implement business processing through processes, such as Linux operating system, Unix operating system, Android operating system, iOS operating system or Windows operating system, etc. Applications can be installed and run on the operating system.

[0098] The operating system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device.

[0099] Figure 3A It is a software structure block diagram of the electronic device according to an embodiment of the present application.

[0100] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: application layer (applications), application framework layer (application framework), Android runtime (AndroidRuntime) and system library, and kernel layer (kernel).

[0101] The application layer may include a series of application packages. For example, the application layer may include system desktop APP, negative one screen APP, quick service center APP and other applications (applications may be referred to as applications for short), and the present application embodiment does not impose any restrictions on this.

[0102] In the embodiment of the present application, the application layer may also include a quick application debugger APP and a quick application engine APP.

[0103] like Figure 3B As shown, the quick application debugger APP includes a card software development kit (SDK), and the quick application engine APP includes a quick application RPK file, and the suffix of the file is .rpk.

[0104] The quick application engine APP is an application pre-installed in the electronic device, which is used to download, install and update the quick application card. The quick application engine APP is also used to create cards, load cards and load pages. The process of creating cards includes creating JS threads, binding JS services, and binding V8. The quick application engine APP is also used to perform card rendering actions. The quick application engine APP is also used to make network requests for cards.

[0105] In the embodiment of the present application, an onPerformanceCallback callback function is provided between the quick app debugger APP and the quick app engine APP to obtain various performance parameter values ​​of the quick app card.

[0106] Among them, the quick application debugger APP can serve as the host of the quick application engine APP, and is used to obtain the performance parameters corresponding to the quick application RPK file in the quick application engine APP through the onPerformanceCallback callback function provided in the embodiment of the present application.

[0107] Among them, the performance parameters corresponding to the quick application RPK file may include at least one of the following: card VDom parsing time, card first screen loading time, card full loading time, page rendering times, network request times, network request data size, maximum single network request time, request error times, image container size, image request times, PSS before card addition, PSS after card loading, and PSS occupied by card. The details will be described in detail below.

[0108] It should be noted that the above performance parameters are listed for example. It can be understood that in actual implementation, the performance parameters in the embodiments of the present application can also be other possible parameters, which can be determined according to actual usage requirements and are not limited by the embodiments of the present application.

[0109] In the embodiment of the present application, the application layer may also include a context awareness module, a business logic processing module, a business presentation module, etc. The context awareness module, the business logic processing module, and the business presentation module may be independent APPs, or may be integrated in different APPs, or may be integrated in the same APP, which is not limited in the present application.

[0110] Among them, the context awareness module, which runs permanently or in a low-power form, has the ability to perceive external facts or environments. The context awareness module can detect related events and obtain the status of events from other applications in the application layer or the application framework layer or the system layer or the kernel layer through the application programming interface (API), such as detecting Bluetooth connections, network connections, monitoring user text messages, custom timers, etc. In an embodiment of the present application, the main function of the context awareness module is to monitor whether a quick application card is added. The context awareness module can also be used to obtain parameter information of the quick application card. The context awareness module can notify the business logic processing module of the monitored quick application card and parameter information.

[0111] The business logic processing module (such as the computing engine) has business logic processing capabilities, and is used to perform data processing or logic judgment based on the quick application cards and parameter information monitored by the context awareness module and the preset logic algorithm, and determine to display the quick application cards on the desktop or negative one screen interface according to the parameter information.

[0112] The business presentation module (such as YOYO Suggestion) is used to display the quick application card on the screen of the electronic device according to the instructions of the business logic processing module. The recommended service realized by the quick application card has more intuitive information display, more comprehensive service recommendation and more significant relevance.

[0113] The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Figure 3A As shown, the application framework layer may include a window manager, JS (JavaScript) service, a view system, a resource manager, etc., and the embodiments of the present application do not impose any restrictions on this.

[0114] The JS service is used to provide card creation, card rendering and other services for the quick application engine.

[0115] The window manager is used to manage window programs, for example, to manage window programs suggested by YOYO.

[0116] The resource manager provides various resources for applications, such as localized strings, icons, images, maps, etc.

[0117] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. The display interface can be composed of one or more views.

[0118] For example, in an embodiment of the present application, the view system can be used to display a map card on the desktop.

[0119] Android Runtime includes core libraries and virtual machines. Android Runtime is responsible for scheduling and management of the Android system.

[0120] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0121] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0122] The system library can include multiple functional modules, such as surface manager, media libraries, 3D graphics processing library (such as openGL ES), 2D graphics engine (such as SGL), etc. The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.

[0123] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

[0124] For the convenience of explanation, the figure also shows a hardware layer that interacts with the above software structure. For example, the hardware layer may include a display screen.

[0125] It should be noted that although the embodiments of the present application are based on The system is used as an example, but the basic principles are also applicable to or Electronic devices with other operating systems.

[0126] The execution subject of the method for detecting the performance of quick application cards provided in the embodiment of the present application can be the above-mentioned electronic device, or it can be a functional module and / or functional entity in the electronic device that can implement the method for detecting the performance of quick application cards, and the present application scheme can be implemented in hardware and / or software, which can be determined according to actual use requirements, and the embodiment of the present application is not limited. Below, taking an electronic device as an example, the method for detecting the performance of quick application cards provided in the embodiment of the present application is exemplarily described in combination with the accompanying drawings.

[0127] The following will be combined with the accompanying drawings to illustrate the embodiments of the present application through the following multiple exemplary embodiments. The methods in the following embodiments can be implemented in an electronic device with the above hardware structure and software architecture. The hardware structure diagram of the electronic device can be as follows: Figure 2 As shown, the software structure diagram of the electronic device can be as follows Figure 3A For the sake of convenience, the embodiments of the present application are all based on electronic devices as shown in FIG. Figure 2 Take the mobile phone shown as an example.

[0128] The following describes a method for detecting quick app card performance provided by an embodiment of the present application in conjunction with a specific embodiment.

[0129] First of all, it should be noted that the embodiment of the present application can formulate quick application card performance standards according to actual usage requirements, and provide a standardized tool "Quick Application Debugger" program, which can be used to detect the corresponding performance information of the quick application RPK when the quick application RPK is put on the shelf for review. The corresponding performance information of the quick application RPK includes card performance parameters. Through the quick application card performance standards and standardized tools, it is possible to intuitively evaluate whether the power consumption performance of the shelf card meets the standards.

[0130] In one embodiment, the quick application card performance standards are divided into two standards: qualified and excellent.

[0131] The electronic device determines whether each performance parameter of the quick application card is qualified or excellent.

[0132] Among them, "qualified" corresponds to the first score, and "excellent" corresponds to the second score.

[0133] For example, the first score may be defined as 6 points, and the second score may be defined as 10 points.

[0134] In one embodiment, the electronic device may determine an overall performance score of the quick app card based on the scores of all performance parameters of the quick app card.

[0135] In one embodiment, the electronic device may determine whether the quick app card is qualified based on the overall performance score of the quick app card.

[0136] In another embodiment, the electronic device may determine whether the quick app card is qualified or excellent based on the overall performance score of the quick app card.

[0137] It should be noted that the embodiment of the present application uses the classification of qualified and excellent standards as an example for illustrative explanation. It can be understood that in actual implementation, the quick application card performance standards can also be divided into more standards, which can be determined according to actual usage requirements, and the embodiment of the present application is not limited.

[0138] Figure 5 is a flow chart of a method for detecting the performance of a quick application card provided in an embodiment of the present application. Figure 5 As shown, the method includes the following steps S101-S104.

[0139] S101: When the RPK file of the first quick app card is running, a first callback function is called to obtain multiple performance parameters of the first quick app card.

[0140] Among them, the first quick application card is the quick application card that is put on the shelf for review.

[0141] In the embodiment of the present application, when the RPK file of the first quick application card is executed, the electronic device can execute multiple actions and record the time when each action is executed.

[0142] In the embodiment of the present application, multiple actions are marked with different numbers respectively.

[0143] For example, action = 0, indicating that the RPK file of the first quick application card starts to run. At this time, the VDom start running time is recorded.

[0144] For example, action=8 indicates that VDom starts parsing. At this time, the time when VDom starts parsing is recorded.

[0145] For example, action=9 indicates that VDom is completed. At this time, the VDom completion time is recorded.

[0146] For example, action = 10, which means refresh. At this time, the refresh time is recorded.

[0147] For example, action = 11, which means first screen rendering. At this time, the first screen rendering time is recorded.

[0148] It should be noted that the action is exemplarily described here with digital markings, and other character markings may be used in actual implementation, which is not limited in this application. Moreover, the specific value of the digital marking may be set according to actual use requirements, which is not limited in this application embodiment.

[0149] In the embodiments of the present application, Figure 4 As shown in the figure, the performance parameters corresponding to the quick application card include latency performance parameters, power consumption performance parameters, and memory performance parameters.

[0150] Category 1: Delay performance parameters

[0151] In an embodiment of the present application, latency performance parameters may include card VDom parsing time, card first screen loading time, card full loading time, and rendering times.

[0152] (1) Card VDom parsing time

[0153] Card VDom parsing duration refers to the time it takes to complete parsing the card VDom tree.

[0154] VDom refers to virtual Dom, which uses JavaScript objects to describe real Dom, and establishes a one-to-one correspondence between JavaScript objects and real Dom. For changes to Dom, by finding the corresponding object, the corresponding Dom node is found, and then the Dom is updated.

[0155] Exemplarily, card VDom parsing may include the following two actions:

[0156] (a) action = 8, start parsing, time T8;

[0157] (b) action = 9 starts to build the page, time T9;

[0158] The electronic device records the time when action=8 and the time when action=9 through a log.

[0159] The electronic device can calculate the time difference T9-T8 and use the time difference as the card VDom resolution duration.

[0160] It should be noted that if the VDom tree is too complex and the index.js file of the card is too large, the actual rendering time of the card will increase. Therefore, it is necessary to reasonably define the card VDom parsing time.

[0161] For example, if the card VDom parsing time is between [300 milliseconds (ms), 400ms], it is defined as qualified. If the card VDom parsing time is greater than 400ms, it is defined as unqualified.

[0162] For another example, the card VDom parsing time is less than 300ms, which is defined as excellent.

[0163] (2) Card first screen loading time

[0164] The card first screen loading time refers to the time required for the card page to load the first screen, specifically the time from the start of loading the card to the completion of the first VDom tree construction. Therefore, the card first screen loading time is also called the time required to parse the first screen VDom.

[0165] In the embodiment of the present application, loading the first screen of a card may include the following two actions:

[0166] (a) action = 9 starts to build the page, time T9;

[0167] (b) action=11 page creation completed, time T11;

[0168] The electronic device records the time when action=9 and the time when action=11 through a log.

[0169] The electronic device can calculate the time difference T11-T9 and use the time difference as the loading time of the first screen of the card.

[0170] It should be noted that if the loading time of the card first screen is too long, the actual rendering time of the card will be increased, so the card VDom parsing time needs to be reasonably defined.

[0171] For example, if the first screen VDom parsing time is between [50 milliseconds (ms), 100ms], it is defined as qualified. If the first screen VDom parsing time is greater than 100ms, it is defined as unqualified.

[0172] For another example, the first screen VDom parsing time is less than 50ms, which is defined as excellent.

[0173] (3) How long does it take to load all the cards?

[0174] The card loading time refers to the time required for the card to be loaded completely, specifically the time from the start of loading the card to the completion of all card content.

[0175] In the embodiment of the present application, loading all cards may include the following two actions:

[0176] (a) action = 0 loading starts, time T0;

[0177] (b) action=11 page creation completed, time T11;

[0178] The electronic device records the time when action=0 and the time when action=11 through a log.

[0179] The electronic device can calculate the time difference T11-T0 and use the time difference as the total loading time of the card.

[0180] In the embodiment of the present application, loading all cards may include the following two actions:

[0181] (a) action = 0 to start loading, time T0;

[0182] (b) action = 10 page refresh, time T10;

[0183] The electronic device records the time when action=0 and the time when action=10 through a log.

[0184] The electronic device can calculate the time difference T10-T0 and use the time difference as the total loading time of the card.

[0185] It should be noted that if there are many network requests and network images, the loading completion time of the card will seriously exceed the standard. Therefore, it is necessary to reasonably define the total loading time of the card.

[0186] For example, if the time it takes to load all cards is within the range of [500ms, 1000ms], it is defined as qualified. If the time it takes to load all cards is greater than 1000ms, it is defined as unqualified.

[0187] For another example, if the loading time of all cards is less than 500ms, it is defined as excellent.

[0188] (4) Number of card renderings;

[0189] The number of card renderings refers to the number of times the card page is refreshed. Specifically, it refers to the number of times the page creation is executed from the beginning of loading the card to the completion of loading all the card content.

[0190] In the embodiment of the present application, card rendering may include the following two actions:

[0191] (a) action = 10 page refresh;

[0192] (b) action=11 Page creation completed.

[0193] The electronic device records the number of page creation times executed during action=11 and action=10 through a log, and the recorded number is the number of card rendering times.

[0194] It should be noted that if the card is rendered more times when loading, the UI content of the card will flash more times, which will increase the card loading completion time accordingly. Therefore, the number of card rendering times needs to be reasonably defined.

[0195] For example, if the card rendering times is equal to 2, it is defined as qualified. If the card rendering times is greater than 2, it is defined as unqualified.

[0196] For another example, the card rendering times equals 1, which is defined as excellent.

[0197] Category 2: Power consumption performance parameters

[0198] In an embodiment of the present application, power consumption performance parameters may include network request parameters and image parameters.

[0199] The network request parameters may include the number of network requests, the size of network request data, the maximum time taken for a single network request, and the number of request errors. The image parameters may include the image container size and the number of image requests.

[0200] (1)Number of network requests

[0201] For example, if the number of network requests is equal to 2, it is defined as qualified.

[0202] For another example, the number of network requests is equal to 1, which is defined as excellent.

[0203] (2) Network request data size

[0204] For example, a network request data size less than or equal to 100KB is defined as qualified.

[0205] (3) Maximum time taken for a single network request

[0206] For example, the maximum duration of a single network request is within the range of [200ms, 400ms], which is defined as qualified.

[0207] For another example, the maximum duration of a single network request is less than 200ms, which is defined as excellent.

[0208] (4) Number of request errors

[0209] For example, if the number of request errors is equal to 0, it is defined as qualified.

[0210] (5) Number of image requests

[0211] For example, if the number of image requests is equal to 2, it is defined as qualified.

[0212] For another example, the number of image requests is equal to 1, which is defined as excellent.

[0213] (6) Image size;

[0214] For example, if the width and height of an image are less than or equal to the width and height of its container, it is defined as qualified. Here, the container refers to the control used to place the image.

[0215] The following is an example of the log of network request related parameters:

[0216] Request interface: action = 100;

[0217] Return result: action = 200, info:Bundle[{key_url = interface path, key_time = timestamp, key_response_data_size = bytes, key_response_time = time consumed}];

[0218] Failed: action=201.

[0219] The following is an example of the logs related to image request and image loading:

[0220] Request image: action=600;

[0221] Image loading: action = 601, info: Bundle [{key_url = interface path, key_time = timestamp, key_image = [image style, image height, container width, container height]}].

[0222] Category 3: Memory performance parameters

[0223] In an embodiment of the present application, memory performance parameters may include PSS before the card is added, PSS after the card is loaded, and PSS occupied by the card.

[0224] Among them, Figure 6 As shown in the figure, PSS (proportional set size) is the physical memory actually occupied by a single process when it is running (including the memory occupied by proportionally allocated shared libraries). The shared library memory in PSS is calculated proportionally. If a shared library is used by N processes, the size of the library proportionally allocated to PSS is: 1 / N.

[0225] PSS can clearly indicate the actual usage of a single process in the total system memory.

[0226] It should be noted that the embodiment of the present application uses PSS as an example for illustrative description. In actual implementation, other parameters can also be used to measure memory consumption.

[0227] (1) PSS before adding the card. The electronic device records the PSS memory size before the card SDK is initialized.

[0228] (2) The card is loaded with PSS. The electronic device records the PSS memory size after the card is loaded.

[0229] (3) The card occupies PSS.

[0230] Among them, the PSS occupied by the card is obtained by subtracting the PSS before the card is added from the PSS after the card is loaded.

[0231] For example, the PSS is 2MB before the card is added, the PSS is 3MB after the card is loaded, and the PSS occupied by the card is 1MB.

[0232] For example, taking a 2×2 card as an example, a PSS within [4.5MB, 4MB] is defined as qualified, and a PSS less than 4MB is defined as excellent.

[0233] It should be noted that the above exemplary lists of multiple performance parameters of quick application cards, in actual implementation, other performance parameters may also be used, and this application does not limit them. The above Table 1 exemplarily gives standard indicators of multiple performance parameters of quick application cards.

[0234] Table 1

[0235]

[0236] In the embodiment of the present application, the detection cycle of the quick application card can be preset.

[0237] For example, in the embodiment of the present application, the preset detection period of the quick application card is 15 seconds. The timing starts from the time when the user clicks the start debugging control, and when the 15 seconds are up, the quick application debugger will stop detecting.

[0238] S102: Determine scores corresponding to a plurality of performance parameters of the first quick app card.

[0239] As mentioned above, the performance standards of the quick application card are divided into two standards: qualified and excellent. The electronic device determines qualified or excellent for each performance parameter of the quick application card.

[0240] Among them, "qualified" corresponds to the first score, and "excellent" corresponds to the second score. For example, the first score can be defined as 6 points, and the second score can be defined as 10 points.

[0241] S103: Perform a weighted sum of the scores corresponding to the multiple performance parameters of the first quick app card to obtain an overall performance score of the first quick app card.

[0242] The electronic device may determine an overall performance score of the first quick app card based on the scores of all performance parameters of the quick app card.

[0243] In the embodiment of the present application, corresponding scoring weights may be preset for multiple performance parameters of the quick app card. Table 1 above shows the preset scoring weights for multiple performance parameters of the quick app card.

[0244] For example, the first quick app includes three performance parameters A1, A2, and A2, and the preset scoring weights of the three performance parameters A1, A2, and A2 are B1, B2, and B3 respectively. If the scores calculated for the three performance parameters A1, A2, and A2 are C1, C2, and C3 respectively, then the overall performance score of the first quick app card is: B1*C1+B2*C2+B3*C3.

[0245] In some embodiments, B1, B2, and B3 are in the range of [0, 1], and B1 + B2 + B3 = 1. For example, B1, B2, and B3 are 0.3, 0.5, and 0.2, respectively.

[0246] In some other embodiments, the values ​​of B1, B2, and B3 are greater than or equal to 1. For example, B1, B2, and B3 are 3, 5, and 2, respectively.

[0247] S104: Determine a performance result of the first quick app card according to a comparison result between the overall performance score of the first quick app card and a preset score threshold.

[0248] Among them, the preset score threshold can be set according to actual usage requirements.

[0249] In some embodiments, when the sum of the preset score weights of the performance parameters of the quick app card is equal to 1, the preset score threshold may be preset as a percentage value or a decimal value.

[0250] For example, the preset score threshold may be preset to 60%.

[0251] For example, the preset score threshold may be preset to 0.6.

[0252] In other embodiments, when the sum of the preset score weights of the performance parameters of the quick app card is greater than 1, the preset score threshold may be preset as an integer value greater than 1.

[0253] For example, the preset score threshold may be preset to 60 points.

[0254] In the embodiment of the present application, the electronic device can compare the overall performance score of the quick app card with a preset score threshold to determine whether the quick app card is qualified.

[0255] If the overall performance score of the quick application card is greater than or equal to 60 points, 60%, or 0.6, the electronic device may determine that the quick application card is qualified.

[0256] If the overall performance score of the quick application card is less than 60 points or 60% or 0.6, the electronic device may determine that the quick application card is unqualified.

[0257] That is, the performance result of the first quick application card is unqualified or qualified.

[0258] In the embodiment of the present application, the electronic device can compare the overall performance score of the quick app card with a preset score threshold to determine whether the quick app card is unqualified, qualified, or excellent.

[0259] The preset score thresholds include score threshold 1 and score threshold 2, and score threshold 2 is greater than score threshold 1.

[0260] For example, score threshold 1 may be preset to 60 points, and score threshold may be preset to 90 points.

[0261] If the overall performance score of the quick app card is greater than or equal to 60 points and less than 90 points, the electronic device may determine that the quick app card is qualified.

[0262] If the overall performance score of the quick app card is greater than or equal to 90 points, the electronic device may determine that the quick app card is excellent.

[0263] If the overall performance score of the quick application card is less than 60 points, the electronic device may determine that the quick application card is unqualified.

[0264] That is, the performance result of the first quick application card is unqualified, qualified, or excellent.

[0265] In an embodiment of the present application, the quick app debugger can display the performance result of the first quick app card, wherein the performance result of the first quick app card includes card performance information and a debugging result, and the debugging result is pass, fail, or excellent.

[0266] The above describes in detail the performance parameters of the quick app card and the process of determining the performance result of the quick app card according to the performance parameters of the quick app card. The following is a schematic diagram of the interface interaction when the method for detecting the performance of the quick app card provided by the embodiment of the present application is applied to an electronic device in conjunction with the accompanying drawings.

[0267] First, the electronic device installs the quick application debugger. Specifically, the quick application debugger APK can be downloaded to the electronic device first, and then the user installs it by clicking to install or using an adb command.

[0268] like Fig. 7A As shown in (a), when the electronic device successfully installs the quick application debugger APK, the electronic device displays the application icon 11 of the quick application debugger in the desktop interface.

[0269] It should be noted that the pre-tested card RPK has been pre-downloaded and installed in the quick application engine of the electronic device.

[0270] The electronic device receives an operation of the user on the application icon 11 of the quick application debugger, and in response to the operation, the electronic device runs the quick application debugger.

[0271] like Fig. 7A As shown in (b) of FIG. 1 , the electronic device jumps from the desktop interface to the interface 12 of the quick application debugger, and the interface 12 of the quick application debugger includes an application mode and a card mode. Fig. 7A As shown in (b) in the figure, the quick app debugger is in "card mode".

[0272] The electronic device receives the user's operation on the "local installation" control 13 in the interface 12 of the quick application debugger. Fig. 7A As shown in (c) in FIG. 1 , in response to the operation, the quick application debugger loads the card that has been downloaded and installed by the quick application engine, and the display interface of the electronic device jumps from the interface 12 of the quick application debugger to the RPK file selection interface 14 .

[0273] The electronic device receives the user's operation of selecting the pre-tested card RPK file "card.rpk". Fig. 7A As shown in (d) in FIG. 1 , the electronic device displays a card preview control 15 and a card performance control 16 in response to the operation. The card preview control 15 is used to trigger the enlarged display of the quick application card for preview. The card performance control 16 is used to trigger the performance test of the quick application card.

[0274] The electronic device receives the user's operation on the card performance control 16. Fig. 7A As shown in (e), the electronic device responds to the operation by jumping the display page to the card performance display interface 17.

[0275] The card performance display interface 17 displays a start detection control 18, a re-detection control 19, a remove card control 20, a card thumbnail 21, and a list 22 of various card performance parameters.

[0276] The start detection control 18 is used to trigger the start of performance detection of the pre-tested card.

[0277] The re-detection control 19 is used to re-trigger the performance detection of the pre-tested card.

[0278] The remove card control 20 is used to trigger the removal of the pre-tested card.

[0279] The quick app card thumbnail 21 is used to show the display effect after the card is loaded.

[0280] The card performance parameter list 22 includes statistics of memory, network, image, rendering and other dimensions. For example, the card performance parameters may include the card VDom parsing time, the card first screen loading time, the card full loading time, the number of renderings, the number of network requests, the network request data size, the maximum single network request time, the number of request errors, the image container size, the number of image requests, the PSS before the card is added, the PSS after the card is loaded, and the PSS occupied by the card.

[0281] It should be noted that, before the detection starts, the performance parameters in the card performance parameter list 22 are empty.

[0282] The electronic device receives the user's operation on the start detection control 18. Fig. 7A As shown in (f), the electronic device responds to the operation and starts to perform performance testing on the pre-tested card. The testing time is, for example, 15 seconds. When the performance testing is completed, the corresponding performance parameters are displayed in the card performance parameter list 22.

[0283] In other embodiments, Figure 7B As shown, the card performance display interface also displays a comprehensive card score of 23, which is used to indicate that the card debugging result is unqualified, qualified, or excellent.

[0284] The electronic device can load the quick application card into a host application of the electronic device. In the embodiment of the present application, the quick application card can be added and displayed in the host application. Among them, the host application can be the negative one screen, desktop, quick service center, global search, etc.

[0285] First implementation example

[0286] Figure 8 The diagram shows the interaction sequence between the quick application debugger and the quick application engine when debugging a quick application card in the first embodiment.

[0287] S201: The quick application engine downloads and installs the quick application card, and the quick application engine can be used to update the quick application card.

[0288] S202: The user clicks the application icon of the quick application debugger to trigger the quick application debugger to start.

[0289] S203-S206, the quick application debugger is started, triggering the quick application engine initialization. After the quick application engine is initialized, it supports running the quick application RPK file.

[0290] S207-S208, in response to the user clicking the start debugging control, the quick app debugger instructs the quick app engine to create a card.

[0291] S209: The quick application engine creates a JS thread, binds a JS service, and binds a V8 engine based on the instruction of the quick application debugger, thereby creating a quick application card.

[0292] S210: The quick application debugger instructs the quick application engine to load the quick application card.

[0293] S211, the quick application debugger instructs the quick application engine to load the page.

[0294] S212, the quick application engine executes programs related to loading quick application cards and loading pages based on the instructions of the quick application debugger, and each program has a corresponding tag action=0, ..., action=8, action=9, action=10, action=11, etc.

[0295] S213: After the quick application engine finishes executing programs related to loading the quick application card and loading the page, the quick application engine returns a completion message to the quick application debugger.

[0296] S214, the quick application debugger instructs the quick application engine to initiate a card network request.

[0297] S215 , the quick application engine sends a network request through an upload / fetch interface based on the instruction of the quick application debugger to perform a card network request detection.

[0298] S216, after the quick application engine completes the card network request detection, the quick application engine loads the image component.

[0299] S217: The quick application engine returns a completion message to the quick application debugger.

[0300] Thus, the quick app debugger interacts with the quick app engine to complete the debugging of the quick app card.

[0301] Second embodiment

[0302] The following is a specific implementation of the method for detecting the performance of a quick application card provided by an embodiment of the present application in conjunction with the accompanying drawings. Among them, a quick application debugger and a quick application engine are installed in the electronic device. The quick application engine is a pageless application program for implementing card download, installation, and update. The quick application debugger is used to detect the performance of the quick application or the performance of the quick application card.

[0303] It should be noted that the quick app debugger can be considered as the host of the quick app engine. The quick app debugger interacts with the quick app engine to implement quick app card performance testing.

[0304] Fig. 9 The following is a timing diagram of the interaction between the quick application debugger and the quick application engine in the method for detecting the performance of the quick application card provided in the second embodiment of the present application. In order to more clearly reflect the improvement of the present application relative to the first embodiment, Fig. 9 The bold and black text in the figure indicates the improvement of the second embodiment of the present application compared with the first embodiment.

[0305] S301: The quick application engine downloads and installs the quick application card, and the quick application engine can be used to update the quick application card.

[0306] S302: The user clicks the application icon of the quick application debugger to trigger the startup of the quick application debugger.

[0307] S303-S306, the quick application debugger is started, triggering the quick application engine initialization. After the quick application engine is initialized, it supports running the quick application RPK file.

[0308] The implementation process of S301 - S306 of the second embodiment of the present application is the same as that of S201 - S206 of the first embodiment.

[0309] S307-S309, in response to the user clicking operation on the start debugging control, the quick application debugger clears memory garbage and counts the PSS memory before the card is loaded.

[0310] The difference from the first embodiment is that in the second embodiment of the present application, after the quick application card is successfully downloaded and installed, if the user clicks the start debugging control in the quick application debugger interface, the quick application debugger can call the System.gc() function to clean up memory garbage. By actively cleaning up memory garbage, the PSS memory size before the card is loaded can be accurately counted.

[0311] In the embodiment of the present application, the detection cycle of the quick application card can be preset.

[0312] For example, 15 seconds is preset as a detection cycle.

[0313] For example, the detection period of the quick app card can be set by setting the function handler.sendEmptyMessageDelayed(1000,15000ms), where the tag field is 1000 and the delay is 15000ms, i.e. 15 seconds.

[0314] In the embodiment of the present application, the timer starts from the moment the user clicks the start debugging control. When 15 seconds are up, the quick application debugger stops the detection and displays the current cycle detection results. The current cycle detection results include card performance information and debugging results, and the debugging results are pass, fail, or excellent.

[0315] S310-S311, the quick application debugger instructs the quick application engine to create a card. Based on the instructions of the quick application debugger, the quick application engine creates a JS thread, binds the JS service, and binds the V8 engine, thereby creating a quick application card.

[0316] S312, the quick application debugger registers card performance monitoring with the quick application engine.

[0317] The difference from the first embodiment is that in the second embodiment of the present application, the quick application debugger registers the card performance monitoring with the quick application engine, and adds a performance callback (onPerformanceCallback) interface based on the original card monitoring interface setRenderListener.

[0318] In this way, after the quick application debugger registers the card performance monitor, when the quick application engine executes VDom parsing, first screen rendering, loading, and refreshing, the card SDK of the quick application debugger can obtain the card performance data from the quick application engine through the onPerformanceCallback interface, and call back the card performance data to the quick application debugger.

[0319] S313-S315, the quick application debugger instructs the quick application engine to load the quick application card, and the quick application debugger instructs the quick application engine to load the page. Based on the instructions of the quick application debugger, the quick application engine executes programs related to loading the quick application card and loading the page, and each program has a corresponding tag action=0, ..., action=8, action=9, action=10, action=11, etc.

[0320] For example, the following lists the different stages represented by the various tags:

[0321] action=0, indicating the start of loading.

[0322] action=8, indicating that VDom starts parsing.

[0323] action=9, indicating that VDom parsing is complete.

[0324] action=11, indicating first screen rendering.

[0325] action=10, indicating refresh.

[0326] S316, the quick application engine parses the VDom and triggers the onPerformance(action, key, time) function to run. The quick application engine calls back the parameter value of the onPerformance(action, key, time) function to the quick application debugger through the onPerformanceCallback interface.

[0327] Among them, the parameters of the onPerformance(action,key,time) function include action, key and time.

[0328] The parameter action is an identifier, and different values ​​of action are used to represent different stages in the card debugging process. For example, the values ​​are 0, 1, ..., 8, 9, 10, 11, ...

[0329] The parameter key indicates the name of the parameter with different attributes.

[0330] The parameter time indicates the specific execution time corresponding to the parameters of different attributes.

[0331] The difference from the first embodiment is that in the second embodiment of the present application, when the quick application engine is performing VDom parsing and executing the application change action (applyChangeAction) method, the quick application engine triggers the onPerformance(action, key, time) function, and the quick application engine calls back the parameter values ​​of the onPerformance(action, key, time) function to the quick application debugger through the onPerformanceCallback interface. The quick application debugger can record these parameter values ​​and determine the card-related performance information based on the recorded parameter values.

[0332] S317, the quick application debugger records action=8, the timing and time when VDom starts parsing.

[0333] S318, the quick application debugger records action=9, the time when VDom resolution is completed.

[0334] S319, the quick application debugger records action=11, the first screen rendering time.

[0335] S320, the quick application debugger records action=10, refreshing time.

[0336] The difference from the first embodiment is that in the second embodiment of the present application, the quick application debugger performs data parsing according to the action field to obtain the time of each stage of card loading. The quick application debugger can record the parameter values ​​at different stages of the card debugging process and determine the card-related performance information based on the recorded parameter values.

[0337] The following is an exemplary description of the process of determining card-related performance information such as card VDom parsing time, card first screen loading time, and card full loading time based on the recorded parameter values.

[0338] Card-related performance information: Card VDom parsing time

[0339] In the embodiment of the present application, card VDom parsing may include the following two actions:

[0340] (a) action = 8, start parsing, time T8;

[0341] (b) action = 9 starts to build the page, time T9;

[0342] The quick application debugger records the time when action = 8 and the time when action = 9 in the log.

[0343] The quick app debugger can calculate the time difference T9-T8 and use the time difference as the card VDom resolution duration.

[0344] Card-related performance information: card first screen loading time

[0345] In the embodiment of the present application, loading the first screen of a card may include the following two actions:

[0346] (a) action = 9 starts to build the page, time T9;

[0347] (b) action=11 page creation completed, time T11;

[0348] The quick application debugger records the time when action = 9 and the time when action = 11 in the log.

[0349] The quick app debugger can calculate the time difference T11-T9 and use the time difference as the loading time of the first screen of the card.

[0350] Card-related performance information: How long it takes to load all the cards

[0351] In the embodiment of the present application, loading all cards may include the following two actions:

[0352] (a) action = 0 loading starts, time T0;

[0353] (b) action=11 page creation completed, time T11;

[0354] The quick application debugger records the time when action = 0 and the time when action = 11 in the log.

[0355] The quick app debugger can calculate the time difference T11-T0 and use the time difference as the total loading time of the card.

[0356] Alternatively, in the embodiment of the present application, loading all cards may include the following two actions:

[0357] (a) action = 0 starts loading, time T0.

[0358] (b) action=10 page refresh, time T10.

[0359] The quick application debugger records the time when action = 0 and the time when action = 10 through logs.

[0360] The quick app debugger can calculate the time difference T10-T0 and use this time difference as the total loading time of the card.

[0361] S321, the quick application debugger instructs the quick application engine to initiate a card network request.

[0362] S322: The quick application engine sends a network request based on the instruction of the quick application debugger by calling the upload / fetch interface to perform card network request detection.

[0363] S323, when the card starts and ends calling the quick application engine network request, the quick application engine determines the current time and the request end time, returns the message size as the info parameter, triggers the running of the onPerformance(action,info) function, and calls the onPerformanceCallback interface to call back the parameter value of the onPerformance(action,info) function to the quick application debugger.

[0364] The parameters of the onPerformance(action,info) function include action and info. The parameter info can be used to indicate the message size.

[0365] S324, the quick application debugger calls back the number of network requests starting from the network request, and counts the number of network requests.

[0366] S325, the quick application debugger records the network request result, which includes the data packet size, the number of request errors, the request time, etc.

[0367] S326, the quick application engine calls the setSource method and the updateImageInfo method through the Image control to load the image.

[0368] S327, when the image control calls the setSource method, the quick application engine triggers the onPerformance(action,info) function, and calls back the parameter value of the onPerformance(action,info) function to the quick application debugger through the onPerformanceCallback interface.

[0369] For example, action = 600. info is used to indicate the loading status of image resources.

[0370] S328, the quick application debugger counts the number of times the image resource is loaded according to action=600.

[0371] The quick app debugger parses data based on the action field to obtain the number of times the image resource is loaded.

[0372] S329, when the image control calls the updateImageInfo method, the quick application engine triggers the onPerformance(action,info) function, and calls back the parameter value of the onPerformance(action,info) function to the quick application debugger through the onPerformanceCallback interface.

[0373] For example, action = 601. info is used to indicate the size of the current picture and the size of the image control.

[0374] S330, the quick application debugger calculates the size of the current picture and the size of the image control according to action=601.

[0375] The quick app debugger parses data based on the action field to obtain the size of the current image and the size of the image control.

[0376] The image control refers to a container used to carry images.

[0377] S331, when the 15-second period is reached, the quick application debugger calculates the PSS memory after the card is loaded.

[0378] The timer starts from the moment the user clicks the Start Debugging control. When 15 seconds are up, the quick app debugger stops detecting.

[0379] S332, the quick application debugger displays the current cycle detection result.

[0380] In the embodiment of the present application, as described above, the quick application debugger calculates and statistically obtains the card performance parameters, and then determines the scores corresponding to the multiple performance parameters of the quick application card, and performs weighted summation on the scores corresponding to the multiple performance parameters of the quick application card to obtain the overall performance score of the quick application card. Based on the comparison result of the overall performance score of the quick application card with the preset score threshold, the performance result of the quick application card is determined, and the performance result is the detection result of the current cycle.

[0381] The quick app debugger displays the current cycle test results, which include card performance information and debugging results. The debugging results are passed, failed, or excellent.

[0382] As a result, the quick app debugger interacts with the quick app engine to complete the performance test of the quick app card.

[0383] This application solution is based on the current quick application alliance card rendering, network traffic and image loading process to improve, and can detect the corresponding performance information of the quick application RPK. This application solution includes the following four aspects of improvement:

[0384] 1) Card loading: Register the card performance monitoring callback onPerformanceCallback. During the card rendering process, call back the timing and time of the current card rendering. The quick app debugger parses the data based on the action field to obtain the time of each stage of card loading.

[0385] 2) Network: When the card makes a network request, the request URL and current time are used as parameters and called back to the quick app debugger through the onPerformanceCallback interface.

[0386] When the network request returns, the message size is calculated based on the response message, and the end time, request URL, request time, and data size are used as parameters and called back to the quick application debugger through the onPerformanceCallback interface.

[0387] After receiving the data, the quick app debugger parses and assigns values ​​according to the action field.

[0388] 3) Memory: Before loading the card, clear the memory garbage, count the first PSS memory value, and delay for 15 seconds as the memory statistical period. When the 15-second period is up, count the second PSS memory value again, and calculate the memory value added brought by card loading based on the difference between the second PSS memory value and the first PSS memory value.

[0389] 4) Image: When a card uses an image component to set a background image, the image URL and current time are used as parameters to trigger the onPerformance(action, info) method, and the method is called back to the quick app debugger through onPerformanceCallback. After receiving the data, the quick app debugger obtains the number of times the image resource is loaded based on the action field.

[0390] When the card updates data information, the image URL, current time, image size, and control size are used as parameters to trigger the onPerformance(action, info) method, and the onPerformanceCallback callback is sent to the quick app debugger. After receiving the data, the quick app debugger obtains the image size and container size based on the action field.

[0391] The embodiment of the present application can formulate a quick application card performance standard according to actual use requirements, and provide a standardized tool "Quick Application Debugger" program, which can be used to detect the corresponding performance information of the quick application RPK when the quick application RPK is put on the shelf for review. Through the quick application card performance standard and standardized tools, it is possible to intuitively evaluate whether the power consumption performance of the put-on card meets the standard.

[0392] In actual implementation, major manufacturers can use the standardized tools provided in the embodiments of the present application as a self-test and acceptance tool for card performance when putting quick application cards on the shelves.

[0393] It should be noted that, in the embodiments of the present application, "greater than" can be replaced by "greater than or equal to", "less than or equal to" can be replaced by "less than", or "greater than or equal to" can be replaced by "greater than", and "less than" can be replaced by "less than or equal to".

[0394] The various embodiments described herein may be independent solutions or may be combined according to internal logic, and all of these solutions fall within the protection scope of this application.

[0395] The above mainly describes the solution provided by the embodiment of the present application from the perspective of method steps. It is understandable that, in order to achieve the above functions, the electronic device implementing the method includes a hardware structure and / or software module corresponding to the execution of each function. Those skilled in the art should be aware that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware 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 exceed the scope of protection of the present application.

[0396] The embodiment of the present application can divide the functional modules of the electronic device according to the above method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other feasible division methods in actual implementation. The following is an example of dividing each functional module corresponding to each function.

[0397] Fig.10 A schematic block diagram of an apparatus 400 for detecting the performance of a quick app card provided in an embodiment of the present application. The apparatus 400 can be used to perform the actions performed by the electronic device in the above method embodiment. The apparatus 400 includes a processing unit 410 and a display unit 420.

[0398] The processing unit 410 is configured to load a first quick app card through a JavaScript thread; register to perform performance monitoring on the first quick app card; trigger execution of a corresponding preset method function at each stage of the first quick app card loading process, and obtain a specific field of the preset method function by calling a preset interface function; perform data analysis on the specific field of the preset method function to obtain multiple performance parameters of the first quick app card; wherein the multiple performance parameters include memory performance parameters, latency performance parameters, and / or power consumption performance parameters; determine a performance result of the first quick app card according to the multiple performance parameters of the first quick app card and preset standard parameters, and the performance result is unqualified or qualified;

[0399] The display unit 420 is configured to display the multiple performance parameters and the performance result of the first quick app card.

[0400] Through the device for detecting the performance of quick application cards provided by the embodiment of the present application, the first quick application card is loaded through a JavaScript thread; the performance monitoring of the first quick application card is registered; at each stage of the first quick application card loading process, the corresponding preset method function is triggered to execute respectively, and the specific field of the preset method function is obtained by calling the preset interface function; the specific field of the preset method function is analyzed to obtain multiple performance parameters of the first quick application card, and compared with the preset standard parameters to determine whether the performance result of the first quick application card is qualified or unqualified. This application has formulated a performance evaluation standard for quick application cards, which can detect the corresponding performance information of quick application cards based on the RPK files of the quick application cards that are listed for review, and can intuitively evaluate whether the listed cards meet the performance standards in terms of memory, power consumption, and latency.

[0401] According to the embodiment of the present application, the device 400 may correspond to executing the method described in the embodiment of the present application, and the above and other operations and / or functions of the units in the device 400 are respectively for implementing the corresponding processes of the method, which will not be repeated here for the sake of brevity.

[0402] The present application also provides a chip, which is coupled to a memory and is used to read and execute computer programs or instructions stored in the memory to execute the methods in the above embodiments.

[0403] The present application also provides an electronic device, which includes a chip, and the chip is used to read and execute a computer program or instruction stored in a memory, so that the method in each embodiment is executed.

[0404] This embodiment also provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the method for detecting the performance of the quick application card in the above-mentioned embodiment.

[0405] This embodiment also provides a computer program product, in which a computer-readable storage medium stores program code. When the computer program product is run on a computer, the computer executes the above-mentioned related steps to implement the method for detecting the performance of a quick application card in the above-mentioned embodiment.

[0406] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory to enable the chip to execute the method for detecting the performance of the quick application card in the above-mentioned method embodiments.

[0407] Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here.

[0408] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, 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.

[0409] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for detecting the performance of a quick application card, characterized in that: The method comprises: Load the first quick app card through the JavaScript thread; Registering to monitor the performance of the first quick app card; At each stage of the first quick app card loading process, trigger the execution of the corresponding preset method function respectively, and obtain the specific field of the preset method function by calling the preset interface function; Data is parsed on specific fields of the preset method function to obtain multiple performance parameters of the first quick application card; wherein the multiple performance parameters include memory performance parameters, latency performance parameters and / or power consumption performance parameters; the latency performance parameters include card virtual Dom parsing time, card first screen loading time, card full loading time, and / or rendering time; the power consumption performance parameters include the number of network requests, network request data size, single maximum time consumption of network requests, number of request errors, image container size, and / or number of image requests; Determine, according to the multiple performance parameters of the first quick app card and preset standard parameters, a performance result of the first quick app card, wherein the performance result is unqualified or qualified; The multiple performance parameters and the performance result of the first quick app card are displayed on a display screen of the electronic device.

2. The method according to claim 1, characterized in that: The method is applied to the electronic device, which is equipped with a quick application debugger and a quick application engine; The quick application debugger is used to instruct the quick application engine to load the first quick application card; The quick application engine is used to create the JavaScript thread and load the first quick application card through the JavaScript thread; The quick app debugger is further used to register with the quick app engine to monitor the performance of the first quick app card and create the preset interface function.

3. The method according to claim 2, characterized in that The various stages of the first quick app card loading process include a first stage and a second stage, the preset method function corresponding to the first stage is a first method function, and the preset method function corresponding to the second stage is a second method function; The triggering and executing of the corresponding preset method function at each stage of the first quick app card loading process, and obtaining the specific field of the preset method function by calling the preset interface function, includes: In the first stage, the quick application engine triggers execution of the first method function, and calls the preset interface function to call back specific fields of the first method function to the quick application debugger; and In the second stage, the quick application engine triggers the execution of the second method function, and calls the preset interface function to call back specific fields of the second method function to the quick application debugger.

4. The method according to claim 3, characterized in that: The performing data parsing on the specific field of the preset method function to obtain multiple performance parameters of the first quick app card includes: The quick app debugger performs data parsing on a specific field of the first method function to obtain a first performance parameter of the first quick app card; The quick app debugger performs data parsing on a specific field of the second method function to obtain a second performance parameter of the first quick app card; The multiple performance parameters of the first quick application card include the first performance parameter and the second performance parameter.

5. The method according to claim 3, characterized in that: The first method function is the onPerformance(action, key, time) function, and the specific fields of the first method function include the action, the key and the time; wherein the action is the identifier corresponding to each stage of the card loading process, the key is the parameter name corresponding to each stage of the card loading process, and the time is the time corresponding to each stage of the card loading process.

6. The method according to claim 3, characterized in that The second method function is the onPerformance(action,info) function, and the specific fields of the second method function include action and info; wherein the action is the identifier corresponding to each stage of the card loading process, and the info is the performance information corresponding to each stage of the card loading process.

7. The method according to any one of claims 2 to 6, characterized in that The preset interface function is an onPerformanceCallback interface function, and the preset interface function supports being called by the quick app debugger and the quick app engine.

8. The method according to any one of claims 2 to 6, characterized in that Before loading the first quick app card through the JavaScript thread, the method further includes: In response to the user operation, the quick app debugger starts performance detection of the first quick app card and starts timing.

9. The method according to claim 8, characterized in that After the quick app debugger starts to perform performance detection on the first quick app card, and before determining the performance result of the first quick app card according to the multiple performance parameters of the first quick app card, the method further includes: After the timing duration reaches a preset cycle duration, the quick application debugger stops performing performance detection on the first quick application card.

10. The method according to any one of claims 2 to 6, characterized in that The multiple performance parameters include the memory performance parameter, and the memory performance parameter includes a first memory occupancy required for loading the first quick application card; After the quick app debugger starts to perform performance detection on the first quick app card, the method further includes: The quick application debugger calls the System.gc() function to perform memory garbage cleaning; The quick application debugger counts the memory size of the first quick application card before loading; After the timing duration reaches a preset period duration, the quick application debugger counts the memory size of the first quick application card after loading; The quick app debugger determines the first memory usage according to the memory size of the first quick app card before loading and the memory size of the first quick app card after loading.

11. The method according to any one of claims 2 to 6, characterized in that The plurality of performance parameters include a delay performance parameter; The performing data parsing on the specific field of the preset method function to obtain multiple performance parameters of the first quick app card includes: The quick application debugger obtains a specific field by calling the preset interface function; wherein the specific field includes a first field, a second field and a third field; wherein the first field carries an identifier corresponding to each stage of the card loading process, the second field carries a parameter name corresponding to each stage of the card loading process, and the third field carries a time corresponding to each stage of the card loading process; The quick application debugger parses the specific field to obtain the execution time of each stage of the card loading process, and calculates the time difference based on the execution time of each stage of the card loading process to determine the latency performance parameter.

12. The method according to any one of claims 2 to 6, characterized in that The plurality of performance parameters include a power consumption performance parameter; The performing data parsing on the specific field of the preset method function to obtain multiple performance parameters of the first quick app card includes: The quick application debugger obtains a specific field by calling the preset interface function; wherein the specific field includes a first field and a fourth field; wherein the first field carries an identifier corresponding to each stage of the card loading process, and the fourth field carries performance information corresponding to each stage of the card loading process; The quick application debugger parses the specific field to obtain the power consumption performance parameter.

13. The method according to any one of claims 2 to 6, characterized in that The determining the performance result of the first quick app card according to the multiple performance parameters and preset standard parameters of the first quick app card includes: Comparing each performance parameter value of the plurality of performance parameters with a corresponding preset standard parameter, and determining a score of each performance parameter of the plurality of performance parameters according to the comparison result; Determining an overall performance score of the first quick app card according to the scores of all performance parameters in the multiple performance parameters; The performance result of the first quick app card is determined according to a comparison result of the overall performance score of the first quick app card and a preset score threshold.

14. The method according to claim 13, characterized in that The determining, according to the scores of all performance parameters in the multiple performance parameters, an overall performance score of the first quick app card includes: Taking a weighted sum of the scores of all performance parameters in the multiple performance parameters to obtain an overall performance score of the first quick app card; Each of the multiple performance parameters is preset with a corresponding weight value.

15. The method according to any one of claims 2 to 6, characterized in that The quick application debugger includes a card software development kit SDK; The acquiring of the specific fields of the preset method function by calling the preset interface function includes: The quick application debugger calls the preset interface function through the card SDK to obtain specific fields of the preset method function.

16. The method according to any one of claims 2 to 6, characterized in that Before loading the first quick app card through the JavaScript thread, the method further includes: The electronic device installs and downloads the quick application debugger; The electronic device displays an application icon of the quick application debugger; In response to a user's operation on an application icon of the quick application debugger, the electronic device starts the quick application debugger and loads the quick application engine; the quick application engine includes a quick application RPK file; The step of loading the first quick app card through the JavaScript thread includes: In response to the user selecting the quick app RPK file corresponding to the first quick app card and triggering the operation of starting detection, the electronic device creates the JavaScript thread through the quick app engine and loads the first quick app card.

17. An electronic device, characterized in that: The electronic device comprises a processor, a memory, and a computer program stored in the memory, wherein the processor is configured to execute the computer program so that the electronic device implements the method according to any one of claims 1 to 16.

18. A chip system, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, characterized in that: The processor is configured to execute the computer program to implement the method according to any one of claims 1 to 16.

19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 16.