Method, device, equipment, medium and program product for obtaining application performance data
By presenting analysis functions and establishing a communication connection in the first application, performance data from the second application can be directly obtained and displayed, solving the problems of cumbersome operation and low efficiency in the existing technology, and realizing efficient performance data acquisition and analysis.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU TENCENT TECH CO LTD
- Filing Date
- 2021-09-09
- Publication Date
- 2026-05-12
AI Technical Summary
Existing technologies are cumbersome and inefficient when acquiring and analyzing application performance data, requiring multiple button clicks and data transfer via data cables or file transfer tools.
The analysis function items are presented in the interface of the first application, a communication connection is established with the second application, and the performance data of the second application is obtained and displayed through the communication connection, simplifying the operation process.
It improves the efficiency of performance data acquisition and analysis, allowing the performance data of the second application to be directly displayed through the first application, simplifying the operation process and improving analysis efficiency.
Smart Images

Figure CN115794568B_ABST
Abstract
Description
Technical Field
[0001] This application relates to computer technology, and more particularly to a method, apparatus, device, computer-readable storage medium, and computer program product for acquiring application performance data. Background Technology
[0002] When running a second application, such as a mini-program or client, on a first terminal, performance issues such as lag or slow loading may occur. Developers need to locate the cause by using the first application, which is configured on the first terminal for analyzing performance data. Related technologies often require recording performance data using the debugging functions provided by the second application running on the first terminal. This recorded data is then transferred to the first terminal via a data cable or other file transfer tool. The first terminal then imports the performance data into the first application for analysis of the second application's performance data.
[0003] However, this method requires multiple button clicks to obtain performance data when recording performance data on the first terminal, which is cumbersome. Furthermore, after obtaining performance data on the first terminal, it is still necessary to transfer the performance data to the first terminal via a data cable or file transfer tool before importing it into the first application for analysis, resulting in low efficiency. Summary of the Invention
[0004] This application provides a method, apparatus, device, computer-readable storage medium, and computer program product for acquiring application performance data, which can improve the efficiency of performance data acquisition and analysis.
[0005] The technical solution of this application embodiment is implemented as follows:
[0006] This application provides a method for obtaining application performance data, including:
[0007] The application interface of the first application presents analysis function items for analyzing the performance data of the second application;
[0008] In response to a trigger operation for the analysis function item, a communication connection is established between the first application and the second application, and a performance analysis interface corresponding to the second application is presented;
[0009] In response to a data acquisition command triggered by the performance analysis interface, performance data of the second application is acquired via the communication connection, and
[0010] The performance analysis interface displays the performance data of the second application for performance analysis.
[0011] This application provides an application performance data acquisition device, including:
[0012] The first presentation module is used to present analysis function items for analyzing the performance data of the second application in the application interface of the first application.
[0013] The first processing module is configured to, in response to a trigger operation for the analysis function item, establish a communication connection between the first application and the second application, and present a performance analysis interface corresponding to the second application.
[0014] The second processing module is configured to, in response to a data acquisition command triggered based on the performance analysis interface, acquire performance data of the second application via the communication connection, and
[0015] The performance analysis interface displays the performance data of the second application for performance analysis.
[0016] In the above scheme, the first presentation module is also used to present an application selection function item for making application selection;
[0017] In response to a trigger operation for the application selection function item, an application selection interface including at least one candidate application is presented;
[0018] In response to the selection operation for the candidate application, the selected application is identified as the second application, and the analysis function items corresponding to the second application are presented.
[0019] In the above scheme, the first processing module is further configured to present a graphical code corresponding to the second application in response to a trigger operation for the analysis function item;
[0020] When a recognition operation for the graphic code is received from the target device and the target device is running the second application, a communication connection is established between the first application and the second application running on the target device.
[0021] In the above scheme, before presenting the graphic code corresponding to the second application, the device further includes:
[0022] The image code acquisition module is used to create and start a local area network server and obtain the server address and port information of the local area network server.
[0023] Obtain the network address of the second application, and based on the server address and port information, encode the network address of the second application to obtain the graphic code of the second application.
[0024] In the above scheme, the first processing module is further configured to receive a first connection request for requesting to establish a communication connection, wherein the first connection request is generated by the target device when running the second application in response to the identification operation;
[0025] Based on the first connection request, when it is determined that the target device has connection permission, a communication connection is established between the first application and the second application running on the target device.
[0026] In the above scheme, the first processing module is further configured to present connection prompt information to prompt the target device to request the establishment of a communication connection;
[0027] In response to a connection confirmation operation triggered based on the connection prompt information, a communication connection is established between the first application and the second application running on the target device.
[0028] In the above scheme, the first processing module is further configured to, in response to a trigger operation for the analysis function item, obtain the graphic code of the second application from a wide area network server storing the graphic code corresponding to the second application, and present the graphic code of the second application in the application interface of the first application.
[0029] In the above scheme, the first processing module is also used to present a device selection function item for making device selection;
[0030] In response to a trigger operation on the device selection function item, a device selection interface is presented, including at least one candidate device running the second application;
[0031] In response to the selection operation for a target device among the at least one candidate devices, a second connection request for requesting the establishment of a communication connection is sent to the target device;
[0032] When a connection confirmation instruction is received from the target device based on the second connection request, a communication connection is established between the first application and the second application running on the target device.
[0033] In the above scheme, the first processing module is further configured to present the performance analysis interface of the corresponding second application obtained by jumping from the application interface of the first application; or,
[0034] In the application interface of the first application, the performance analysis interface of the corresponding second application is presented via a pop-up window; or,
[0035] The performance analysis interface corresponding to the second application is presented. The performance analysis interface is a sub-interface independent of the application interface of the first application.
[0036] In the above scheme, before obtaining the performance data of the second application through the communication connection, the device further includes:
[0037] The instruction receiving module is used to present, in the performance analysis interface, options for at least one performance data corresponding to the second application, and acquisition function items for acquiring performance data;
[0038] In response to a selection operation for a target option, the target type of the performance data corresponding to the target option is determined;
[0039] In response to a trigger operation for the acquisition function item, a data acquisition instruction for the target type of performance data is received;
[0040] The second processing module is further configured to acquire performance data of the target type corresponding to the second application through the communication connection.
[0041] In the above scheme, the performance analysis interface includes a type selection area and a device information display area;
[0042] The instruction receiving module is also used to present, in the type selection area of the performance analysis interface, an option for at least one performance data corresponding to the second application, and a function item for obtaining performance data;
[0043] The device further includes:
[0044] The device information display module is used to display device information of the device running the second application in the device information display area.
[0045] In the above scheme, the first processing module is further configured to, when the second application is a subroutine application, obtain at least one of the following performance data of the subroutine application through the communication connection:
[0046] Heap snapshots for analyzing the memory usage of the subroutine application, and CPU configuration data for analyzing the script execution time of the subroutine application.
[0047] In the above scheme, the second processing module is further configured to send the data acquisition instruction to the second application through the communication connection, so that the second application can acquire the performance data of the second application based on the data acquisition instruction, and return the performance data of the second application through the communication connection;
[0048] Receive the performance data returned by the second application.
[0049] In the above scheme, before obtaining the performance data of the second application through the communication connection, the instruction receiving module is also used to present the acquisition function item for obtaining performance data in the performance analysis interface;
[0050] In response to a trigger operation for the acquisition function item, the data acquisition instruction is received, the data acquisition instruction carrying the target duration for acquiring performance data;
[0051] The second processing module is further configured to acquire performance data of the target duration corresponding to the second application through the communication connection.
[0052] In the above scheme, before obtaining the performance data of the second application through the communication connection, the instruction receiving module is further configured to present a start function item and an end function item for controlling the acquisition of performance data;
[0053] In response to a trigger operation for the start function item, the data acquisition instruction is received;
[0054] The second processing module is further configured to send the data acquisition instruction to the second application through the communication connection, so that the second application records the performance data of the second application based on the data acquisition instruction;
[0055] During the recording of performance data in the second application, in response to the trigger operation for the end function item, a data stop acquisition instruction corresponding to the second application is received, and the data stop acquisition instruction is sent to the second application through the communication connection, so that the second application stops recording the performance data of the second application based on the data stop acquisition instruction, and returns the recorded performance data of the second application through the communication connection;
[0056] Receive the performance data returned by the second application.
[0057] This application provides an electronic device, including:
[0058] Memory, used to store executable instructions;
[0059] The processor, when executing executable instructions stored in the memory, implements the method for obtaining application performance data provided in the embodiments of this application.
[0060] This application provides a computer-readable storage medium storing executable instructions for inducing a processor to execute and implement the application performance data acquisition method provided in this application.
[0061] This application provides a computer program product, including a computer program or instructions, which, when executed by a processor, implement the application performance data acquisition method provided in this application.
[0062] The embodiments of this application have the following beneficial effects:
[0063] The application interface of the first application presents analysis functions for analyzing the performance data of the second application. In response to a trigger operation on these analysis functions, a communication connection is established between the first and second applications, and the corresponding performance analysis interface for the second application is presented. In response to a data acquisition command triggered based on the performance analysis interface, the performance data of the second application is acquired through the communication connection and displayed in the performance analysis interface for performance analysis. Thus, by triggering a data acquisition command based on the performance analysis interface presented by the first application, the performance data of the second application can be acquired and displayed in the first application. This achieves the goal of analyzing the performance of the second application using the performance data displayed by the first application. The operation is simple, improves the efficiency of performance data acquisition, and consequently improves the efficiency of performance analysis for the second application. Attached Figure Description
[0064] Figure 1 A schematic diagram of the architecture of the application performance data acquisition system 100 provided in this application embodiment;
[0065] Figure 2 This is a schematic diagram of the structure of the electronic device 500 provided in the embodiments of this application;
[0066] Figure 3 A flowchart illustrating the method for obtaining application performance data provided in this application embodiment;
[0067] Figure 4 A schematic diagram of the display interface for the analysis function items provided in the embodiments of this application;
[0068] Figure 5 A schematic diagram of the display interface for the analysis function items provided in the embodiments of this application;
[0069] Figure 6 This is a diagram illustrating the communication connection implementation interface provided in an embodiment of this application.
[0070] Figure 7 This is a diagram illustrating the communication connection implementation interface provided in an embodiment of this application.
[0071] Figure 8 This is a schematic diagram of the performance analysis interface provided in an embodiment of this application;
[0072] Figure 9This is a schematic diagram illustrating the performance data provided in the embodiments of this application;
[0073] Figure 10 This is a schematic diagram illustrating the performance data provided in the embodiments of this application;
[0074] Figure 11 This is a data flow diagram illustrating the method for obtaining application performance data provided in the embodiments of this application.
[0075] Figure 12 A flowchart illustrating the method for obtaining application performance data provided in this application embodiment;
[0076] Figure 13 This is a schematic diagram of the structure of the device for acquiring application performance data provided in the embodiments of this application. Detailed Implementation
[0077] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0078] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0079] In the following description, the terms “first, second…” are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that “first, second…” may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0080] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0081] In the implementation of this application, the collection and processing of relevant data should strictly comply with the requirements of relevant laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.
[0082] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.
[0083] 1) Applications: Applications that run on a terminal to provide various services, such as clients or applets. Clients are software that needs to be downloaded and installed on a user's terminal (e.g., a smartphone or computer) to be used, such as video playback clients, social networking clients, instant messaging clients, etc.
[0084] Subroutine applications, such as mini-programs or web programs, are programs developed using front-end-oriented languages (e.g., JavaScript) that provide services within Hyper Text Markup Language (HTML) pages. They are downloaded by clients (e.g., browsers or any client with an embedded browser engine) via a network (e.g., the internet) and interpreted and executed within the client's browser environment, saving the step of installation on the client side. For example, a mini-program can be downloaded and run in a social network client to provide a confirmation service for notification messages.
[0085] 2) In response, used to indicate the conditions or states on which the operation performed depends. When the conditions or states on which it depends are met, one or more operations performed may be performed in real time or with a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations are performed.
[0086] See Figure 1 , Figure 1 This is a schematic diagram of the architecture of the application performance data acquisition system 100 provided in this application embodiment. To support an exemplary application, the architecture includes: a first terminal 200-1, a second terminal 200-2, and a network server 300. The second terminal 200-2 and the first terminal 200-1 communicate through the network server 300. The network provided by the network server 300 can be a wide area network (WAN), a local area network (LAN), or a combination of both, using a wireless link for data transmission. The second terminal 200-2 or the first terminal 200-1 can be various types of user terminals such as smartphones, tablets, in-vehicle terminals, and smart wearable devices.
[0087] In some embodiments, the second terminal 200-2 and the first terminal 200-1 implement the application performance data acquisition method provided in this application embodiment by running a computer program. The computer program can be a native program or software module in the operating system; it can be a local application (APP, Application), that is, a program that needs to be installed in the operating system to run; it can also be a mini-program, that is, a program that only needs to be downloaded to the browser environment to run; or it can be an instant messaging mini-program that can be embedded in any APP. In short, the above-mentioned computer program can be any form of application, module or plugin.
[0088] For example, a second application, such as a mini-program or client, runs on the second terminal 200-2. A first application, used to analyze the second application running on the second terminal 200-2, runs on the first terminal 200-1. The second terminal 200-2 presents analysis functions for analyzing the performance data of the second application in the application interface of the first application. In response to a trigger operation on the analysis functions, a communication connection is established between the first application and the second application running on the second terminal 200-2, and a performance analysis interface corresponding to the second application is presented. In response to a data acquisition command triggered based on the performance analysis interface, a data acquisition command is sent to the second application running on the second terminal 200-2 through the established communication connection. Based on the data acquisition command, the second application running on the second terminal 200-2 calls the data recording interface of the second application and records the performance data of the second application through the data recording interface to obtain the performance data of the second application. The obtained performance data of the second application is then returned to the first application running on the first terminal 200-1 through the established communication connection, and the performance data of the second application is displayed in the performance analysis interface presented on the first application for performance analysis of the second application.
[0089] In some embodiments, the first application and the second application may also run on the same terminal. In actual implementation, the terminal presents an analysis function item for analyzing the performance data of the second application in the application interface of the first application; in response to the trigger operation of the analysis function item, a communication connection is established between the first application and the second application, and the corresponding performance analysis interface of the second application is presented; in response to the data acquisition command triggered based on the performance analysis interface, the terminal sends a data acquisition command to the second application through the established communication connection; the second application calls the data recording interface of the second application based on the data acquisition command, and records the performance data of the second application through the data recording interface to obtain the performance data of the second application, and returns the obtained performance data of the second application to the first application through the established communication connection, and displays the performance data of the second application in the performance analysis interface presented on the first application for performance analysis of the second application.
[0090] The embodiments of this application can be implemented with the help of cloud technology, which refers to a hosting technology that unifies a series of resources such as hardware, software, and network within a wide area network or local area network to realize the computation, storage, processing, and sharing of data.
[0091] Cloud technology is a general term encompassing network technology, information technology, integration technology, management platform technology, and application technology based on the cloud computing business model. It can form resource pools, allowing for on-demand use with flexibility and convenience. Cloud computing technology will become a crucial support. The backend services of cloud computing systems require substantial computing and storage resources.
[0092] As an example, a web server can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms, but it is not limited to these.
[0093] See Figure 2 , Figure 2 This is a schematic diagram of the structure of the electronic device 500 provided in the embodiments of this application. In practical applications, the electronic device 500 can be... Figure 1 The first terminal 200-1, the second terminal 200-2, or the network server 2300 are electronic devices. Figure 1 Taking the first terminal 200-1 shown as an example, an electronic device implementing the application performance data acquisition method of this application embodiment will be described. Figure 2 The illustrated electronic device 500 includes at least one processor 510, a memory 550, at least one network interface 520, and a user interface 530. The various components in the electronic device 500 are coupled together via a bus system 540. It is understood that the bus system 540 is used to implement communication between these components. In addition to a data bus, the bus system 540 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 2 The general labeled all buses as Bus System 540.
[0094] The processor 510 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.
[0095] User interface 530 includes one or more output devices 531 that enable the presentation of media content, including one or more speakers and / or one or more visual displays. User interface 530 also includes one or more input devices 532, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
[0096] The memory 550 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 550 may optionally include one or more storage devices physically located away from the processor 510.
[0097] The memory 550 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 550 described in this application embodiment is intended to include any suitable type of memory.
[0098] In some embodiments, memory 550 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.
[0099] Operating system 551 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks;
[0100] The network communication module 552 is used to reach other computing devices via one or more (wired or wireless) network interfaces 520, exemplary network interfaces 520 including: Bluetooth, WiFi, and Universal Serial Bus (USB), etc.
[0101] Presentation module 553 is used to enable the presentation of information (e.g., user interface for operating peripheral devices and displaying content and information) via one or more output devices 531 (e.g., display screen, speaker, etc.) associated with user interface 530.
[0102] The input processing module 554 is used to detect and translate one or more user inputs or interactions from one or more input devices 532.
[0103] In some embodiments, the application performance data acquisition device provided in this application can be implemented in software. Figure 2 A device 555 for acquiring application performance data stored in memory 550 is shown. It may be software in the form of programs and plug-ins, including the following software modules: a first presentation module 5551, a first processing module 5552, and a second processing module 5553. These modules are logical and can therefore be arbitrarily combined or further divided according to the functions they implement. The functions of each module will be described below.
[0104] In other embodiments, the application performance data acquisition device provided in this application embodiment can be implemented in hardware. As an example, the application performance data acquisition device provided in this application embodiment can be a processor in the form of a hardware decoding processor, which is programmed to execute the application performance data acquisition method provided in this application embodiment. For example, the processor in the form of a hardware decoding processor can be one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0105] Based on the above description of the application performance data acquisition system provided in the embodiments of this application, the application performance data acquisition method provided in the embodiments of this application will be described below. In actual implementation, this method can be... Figure 1 The first terminal 200-1, the second terminal 200-2, or the network server 300 shown can be implemented individually, or can be implemented by... Figure 1 The second terminal 200-2, the first terminal 200-1, and the network server 300 are implemented collaboratively. The following will combine... Figure 1 and Figure 3 , Figure 3 This is a flowchart illustrating the method for obtaining application performance data provided in the embodiments of this application. Figure 1 The method for obtaining application performance data provided in this application embodiment is illustrated using the first terminal 200-1 shown as an example.
[0106] Step 101: The first terminal displays analysis function items for analyzing the performance data of the second application in the application interface of the first application.
[0107] Here, the first application, also known as a performance analysis tool, is a tool used to detect and analyze the performance data of the second application, such as mini-programs and clients. In practical applications, the first and second applications can run on the same terminal, such as the second application also running on the first terminal, or they can run on different terminals, such as the second application running on a second terminal different from the first terminal. For example, the first terminal is a computer, and the second terminal is a smartphone, that is, the first application runs on the computer, and the second application runs on the smartphone.
[0108] In practical applications, when a user opens the first application on the first terminal, the first terminal displays the application interface of the first application, and the analysis function items are displayed in the application interface, or in the "Tools" menu bar of the application interface. When the analysis function items are in the Tools menu bar, the user can send the analysis function items in the "Tools" menu bar to the application interface, and they will be displayed in the application interface in a shortcut form. In this way, it is convenient for users to quickly find the analysis function items, which helps to shorten the operation path and improve the operation efficiency.
[0109] See Figure 4 , Figure 4 This is a schematic diagram of the display interface of the analysis function item provided in the embodiment of this application. The application interface 401 of the first application presents a "Tools" menu bar. When the user triggers the "Tools" option, an analysis function item 402 including at least "Performance Analysis Tool" is presented. When the user selects the analysis function item 402, subsequent processing operations such as obtaining or analyzing performance data can be performed.
[0110] In some embodiments, the first terminal may also present analysis function items for analyzing performance data of the second application in the following manner:
[0111] Presents an application selection function for application selection; in response to a trigger operation on the application selection function, presents an application selection interface including at least one candidate application; in response to a selection operation on a candidate application, identifies the selected application as the second application and presents the analysis function corresponding to the second application.
[0112] Understandably, the first application can be used to analyze the performance data of multiple different second applications. Therefore, the application interface of the first application can present an application selection function. When the user triggers (such as clicking, double-clicking, swiping, dragging, etc.) the application selection function, the terminal responds to the triggering operation and presents multiple candidate applications to choose from. When the user selects the target application from the multiple candidate applications, the terminal responds to the selection operation, takes the selected target application as the second application to be analyzed, and presents the corresponding analysis function.
[0113] See Figure 5 , Figure 5 This is a schematic diagram of the display interface of the analysis function provided in the embodiment of this application. In the application interface 501 of the first application, the application selection function 502 is presented. In response to the trigger operation of the application selection function 502, the terminal presents the application selection interface 503, and presents multiple candidate applications that can be selected, such as candidate application 504 and candidate application 505. When the user selects candidate application 505, the terminal responds to the selection operation and presents the analysis function 506 corresponding to candidate application 505 (i.e., the second application). When the user selects the analysis function 506, the terminal responds to the selection operation and can perform subsequent processing operations such as obtaining or analyzing performance data of candidate application 505.
[0114] Step 102: In response to the trigger operation for the analysis function item, establish a communication connection between the first application and the second application, and present the performance analysis interface of the corresponding second application.
[0115] In practical applications, when both the first and second applications run on the same terminal (i.e., the first terminal), for data exchange between them to be achieved, the first terminal must be connected to the internet to establish a communication connection between them. This established connection ensures data exchange between the first and second applications. Conversely, when the first and second applications run on different terminals (e.g., assuming the second application runs on a second terminal), for data exchange to occur, both terminals must establish a communication connection through the same network server. This shared network server then ensures data exchange between the first and second applications.
[0116] In some embodiments, the first terminal may establish a communication connection between the first application and the second application in response to a trigger operation for an analysis function item by: presenting a graphic code corresponding to the second application in response to a trigger operation for an analysis function item; and establishing a communication connection between the first application and the second application running on the target device when a recognition operation for the graphic code is received from the target device and the target device is running the second application.
[0117] Specifically, when both the first and second applications run on the same terminal, the target device is the first terminal, and the recognition operation is the recognition operation performed by the first terminal in response to a long press operation on the graphic code. When the first and second applications run on different terminals, the target device is the second terminal, and the recognition operation is the scanning operation of the graphic code by the second terminal. When the target device performs the recognition operation on the graphic code and the recognition is successful, the target device obtains the code package corresponding to the graphic code and runs the code package, that is, runs the second application. After running the second application, a communication connection can be established between the first application and the second application running on the target device.
[0118] In some embodiments, before presenting the graphic code corresponding to the second application, the first terminal may obtain the graphic code in the following manner: create and start a local area network server, obtain the server address and port information of the local area network server; obtain the network address of the second application, and encode the network address of the second application based on the server address and port information to obtain the graphic code of the second application.
[0119] Here, when a user triggers the analysis function, the first terminal responds to the trigger operation. The first application running on the first terminal creates and starts a local area network server. After startup, the server address and port information of the local area network server are encoded and added to the network address of the second application to obtain the code package of the second application. The encoded code package of the second application is then uploaded. After the code package of the second application is uploaded, the application interface of the first application will display a graphic code previewing the second application. The graphic code can be a QR code, barcode, etc.
[0120] In some embodiments, the first terminal may establish a communication connection between the first application and the second application running on the target device in the following manner: receiving a first connection request for requesting the establishment of a communication connection, wherein the first connection request is generated by the target device when running the second application in response to an identification operation; and, based on the first connection request, determining that the target device has connection permissions, establishing a communication connection between the first application and the second application running on the target device.
[0121] Here, when the graphical code corresponding to the second application is presented in the application interface of the first application, if the target device recognizes the displayed graphical code, the second application in the target device can obtain the server address and port information of the local area network server written by the first application. It then passes this information to the application base library. After obtaining this information, the application base library initiates a first connection request to the first application to establish a communication connection through the server address and port information. After the first application receives the first connection request and confirms that a local area network communication connection has been established with the target device, it determines that the first application in the target device has the permission to connect to the second application. Thus, a communication connection can be established between the first application and the second application running on the target device, and the performance analysis interface of the corresponding second application can be presented.
[0122] See Figure 6 , Figure 6 The communication connection implementation interface diagram provided in this application embodiment shows that when the user triggers the analysis function item 601 for performance analysis of the second application, the terminal responds to the trigger operation and presents the graphic code 602 corresponding to the second application. After ensuring that the target device and the first terminal are on the same local area network, if the target device scans the graphic code 602 and runs the second application, a communication connection can be established between the first application and the second application running on the target device, and the performance analysis interface 603 corresponding to the second application can be presented.
[0123] In some embodiments, the first terminal may also establish a communication connection between the first application and the second application running on the target device by: presenting a connection prompt message to prompt the target device to request the establishment of a communication connection; and establishing a communication connection between the first application and the second application running on the target device in response to a connection determination operation triggered based on the connection prompt message.
[0124] In practical applications, when the target device recognizes the graphic code displayed in the application interface of the first application, the second application in the target device can obtain the server address and port information of the local area network server encoded and written by the first application. The second application passes this information to the application base library. After obtaining this information, the application base library sends a connection prompt message to the first application through the server address and port information to request the establishment of a communication connection. The first application receives the connection prompt message and displays the connection prompt message in the application interface of the first application to decide whether to allow the establishment of a communication connection with the second application.
[0125] For example, see Figure 7 , Figure 7This is a diagram illustrating the communication connection implementation interface provided in this application embodiment. When the target device recognizes the graphic code 700 displayed in the application interface of the first application, while displaying connection prompt information 701 in the application interface of the first application, it can also display a "confirm" function 702 and a "reject" function 703 for establishing a communication connection. When the user on the first terminal side allows the establishment of a communication connection with the second application based on the connection prompt information 701, the connection confirmation operation can be triggered by clicking the "confirm" function 702. In response to the connection confirmation operation, the first terminal establishes a communication connection between the first application and the second application running on the target device, and displays the corresponding performance analysis interface 704 of the second application. When the user on the first terminal side does not allow the establishment of a communication connection with the second application based on the connection prompt information, the connection rejection operation can be triggered by clicking the "reject" function 703. In response to the connection rejection operation, the first terminal prohibits the establishment of a communication connection between the first application and the second application running on the target device, and still displays the graphic code of the second application in the application interface of the first application.
[0126] In some embodiments, the first terminal may establish a communication connection between the first application and the second application in response to a trigger operation for an analysis function item by: obtaining the graphic code of the second application from a wide area network server storing the graphic code corresponding to the second application, and presenting the graphic code of the second application in the application interface of the first application.
[0127] Here, when the first application and the second application run on different terminals, such as the first application running on the first terminal and the second application running on a second terminal different from the first terminal, and the first terminal and the second terminal are not in the same local area network, such as the first terminal communicating through a broadband network and the second terminal communicating through a mobile network (i.e., the second terminal is not connected to the same broadband network as the first terminal), the communication connection between the two can be achieved through a wide area network server.
[0128] In practice, the first terminal creates and starts a WAN server. Based on its server address and port information, the WAN server encodes the network address of the second application to obtain its graphical code, which is then stored. When a user triggers an analysis function, the first terminal responds by retrieving the graphical code of the second application from the WAN server and displaying it in its application interface. When the second terminal recognizes the graphical code displayed in the first application's interface, the second application within it obtains the WAN server's server address and port information. This information is then passed to the application library. After the application library receives this information and runs the second application, it initiates a first connection request to the WAN server using the server address and port information. The WAN server forwards this first connection request to the first application. Once the first application receives the first connection request and confirms the establishment of a WAN communication connection with the second terminal, it can establish a communication connection between itself and the second application running on the second terminal via the WAN server, displaying the corresponding performance analysis interface. Conversely, after acquiring performance data, the second application transmits its performance data to the first application via the WAN server.
[0129] In some embodiments, the first terminal may establish a communication connection between the first application and the second application by: presenting a device selection function for selecting a device; in response to a trigger operation on the device selection function, presenting a device selection interface including at least one candidate device running the second application; in response to a selection operation on a target device among the at least one candidate device, sending a second connection request to the target device to request the establishment of a communication connection; and establishing a communication connection between the first application and the second application running on the target device when a confirmation connection instruction is received from the target device based on the second connection request.
[0130] Here, when the second application is not running on the first terminal, the first terminal responds to the trigger operation for the analysis function item by presenting a device selection function item in the application interface of the first application. In response to the trigger operation for the device selection function item, a device selection interface with multiple candidate devices is presented. The candidate devices are terminal devices located on the same local area network as the first terminal and running the second application. The device selection interface can be presented in various ways, such as through a pop-up window within the application interface of the first application, or by page navigation from the application interface of the first application to the device selection interface, etc. When a user on the first terminal selects a target device from the multiple candidate devices, the first application on the first terminal sends a second connection request or connection prompt information to the target device. The user on the target device can decide whether to establish a communication connection with the second application based on the second connection request or connection prompt information. When the user decides to establish a communication connection with the second application based on the second connection request or connection prompt information, the target device returns a confirmation connection command to the first terminal and establishes a communication connection between the first application and the second application running on the target device.
[0131] In some embodiments, the first terminal may present the performance analysis interface of the corresponding second application in the following ways: presenting the performance analysis interface of the corresponding second application obtained by jumping from the application interface of the first application; or, presenting the performance analysis interface of the corresponding second application in the application interface of the first application by means of a pop-up window; or, presenting the performance analysis interface of the corresponding second application, wherein the performance analysis interface is a sub-interface independent of the application interface of the first application.
[0132] Here, when a communication connection is established between the first application and the second application, the performance analysis interface of the second application presented by the first terminal can be presented in various ways, such as by jumping from the application interface of the first application to the performance analysis interface, or by presenting it in the application interface of the first application in the form of a pop-up window, or by presenting it in a sub-interface that is independent of the application interface of the first application, etc., thus enriching the product's presentation.
[0133] Step 103: In response to the data acquisition command triggered by the performance analysis interface, acquire the performance data of the second application through the communication connection, and display the performance data of the second application in the performance analysis interface for performance analysis of the second application.
[0134] In practical applications, the performance analysis interface contains buttons or options for obtaining performance data. The first terminal responds to the trigger operation of the button or option, receives the data acquisition instruction for obtaining performance data, and sends the data acquisition instruction to the second application through the established communication connection. This allows the second application to obtain the performance data of the second application based on the data acquisition instruction and return it to the first application for display in the performance analysis interface presented on the first terminal. Users can then analyze the performance of the second application based on the displayed performance data.
[0135] In some embodiments, before the first terminal obtains the performance data of the second application through a communication connection, it may receive a data acquisition instruction in the following manner: In the performance analysis interface, options for at least one performance data corresponding to the second application and an acquisition function item for acquiring performance data are presented; in response to a selection operation for a target option, the target type of the performance data corresponding to the target option is determined; in response to a trigger operation for the acquisition function item, a data acquisition instruction for the performance data of the target type is received; accordingly, the first terminal may obtain the performance data of the second application through the communication connection in the following manner: The target type of the performance data corresponding to the second application is obtained through the communication connection.
[0136] In practical applications, performance data includes, but is not limited to, memory usage and distribution data during the operation of the second application, script execution time data, etc. Therefore, the performance analysis interface for analyzing the performance of the second application presents options for various performance data corresponding to the second application, such as memory options and script options. When the user selects a target option from multiple options, the terminal responds to the selection operation, determines the target type of performance data corresponding to the selected target option, and then when the user triggers the retrieval function, the terminal responds to the trigger operation, receives a data retrieval instruction for retrieving performance data of the target type, and retrieves the performance data of the target type. For example, when the user selects the memory option, the type of performance data corresponding to the memory option is determined to be memory, and the corresponding data retrieval instruction is used to retrieve memory-related performance data, such as memory distribution and memory usage performance data. Based on this, the memory performance of the second application can be analyzed.
[0137] In some embodiments, the performance analysis interface includes a type selection area and a device information display area. The first terminal can present options for at least one performance data corresponding to the second application and acquisition function items for obtaining performance data in the performance analysis interface in the following manner: In the type selection area of the performance analysis interface, options for at least one performance data corresponding to the second application and acquisition function items for obtaining performance data are presented; correspondingly, in the device information display area, device information of the device running the second application is displayed.
[0138] See Figure 8 , Figure 8 This is a schematic diagram of the performance analysis interface provided in an embodiment of this application. The performance analysis interface 801 includes a type selection area 802 and a device information display area 803. In the type selection area 802, multiple selectable performance data options corresponding to the second application are presented, such as memory analysis (Memory) 804 and script analysis (JavaScriptProfiler) 805. Memory analysis 804 is an analysis tool for analyzing memory, and script analysis 805 is an analysis tool for analyzing script execution. In the device information display area 803, device information of the device running the second application can be displayed, such as device model, operating system, version of the second application, basic library version, connection method, etc.
[0139] When a user selects the memory analysis option 804, various performance data options corresponding to this memory type are further presented, such as the heap snapshot option, the allocation instrumentation on timeline option, the allocation sampling option, and the acquisition function item 806 for obtaining performance data. Among them, the heap snapshot option prints a heap snapshot, which displays the memory allocation between the page's JavaScript objects and related document (DOM) nodes; the memory allocation on timeline option records memory information on a timeline, i.e., records memory information as it changes over time; the memory sampling option records memory allocation using a sampling method. This profile type has minimal performance overhead and can be used for long-running operations, providing a good approximation of the allocation by the JavaScript execution stack. Users can select the option they want to analyze to obtain the corresponding performance data.
[0140] For example, when a user selects the heap snapshot as the target option and triggers the retrieval function 806, the first terminal receives a data retrieval instruction for the heap snapshot and retrieves the heap snapshot of the corresponding second application through the communication connection. If the second application is a subroutine application (such as a mini-program application), the heap snapshot of the subroutine application's memory usage is retrieved and analyzed, and the obtained performance data of this type (heap snapshot) is displayed in the performance analysis interface. See [link to relevant documentation]. Figure 9 , Figure 9 This is a schematic diagram illustrating the performance data provided in the embodiments of this application. Users can use it based on... Figure 9 The performance data shown allows for analysis of the memory distribution and memory usage of subroutine applications, and can propose targeted improvement measures.
[0141] When the user selects the "Script Analysis 805" option, a start and stop function can be presented to control the acquisition of performance data on script execution time. When the user clicks the start function, a data acquisition command for the script execution time of the corresponding second application is triggered. The first terminal receives this command and acquires the CPU configuration data for the script execution time of the corresponding second application via a communication connection. The acquisition stops when the user clicks the cancel function, and the acquired performance data is displayed in the performance analysis interface. For example, when the second application is a subroutine application (such as a mini-program), after acquiring the CPU configuration data for analyzing the script execution time of the subroutine application, this type of performance data (CPU configuration data for script execution time) is displayed in the performance analysis interface. See [link to relevant documentation]. Figure 10 , Figure 10 This is a schematic diagram illustrating the performance data provided in the embodiments of this application. Users can use it based on... Figure 10 The performance data shown can be used to analyze the CPU configuration data of the script execution time of subroutine applications, and targeted improvement measures can be proposed.
[0142] In some embodiments, the first terminal may obtain the performance data of the second application through a communication connection in the following manner: sending a data acquisition instruction to the second application through the communication connection, so that the second application acquires the performance data of the second application based on the data acquisition instruction, and returns the performance data of the second application through the communication connection; and receiving the returned performance data of the second application.
[0143] Here, when the first terminal receives a data acquisition instruction, it can send the instruction to the second application through the established communication connection. When the second application receives the instruction, it calls the data recording interface and records the performance data of the second application. The recorded performance data is then returned to the first application through the established communication connection. After receiving the returned performance data, the first application displays the performance data in its performance analysis interface for users to analyze the performance of the second application.
[0144] In some embodiments, before the first terminal obtains the performance data of the second application through the communication connection, it may receive a data acquisition instruction in the following manner: in the performance analysis interface, an acquisition function item for obtaining performance data is presented; in response to the trigger operation for the acquisition function item, a data acquisition instruction carrying the target duration of the performance data is received; accordingly, the first terminal may obtain the performance data of the second application through the communication connection in the following manner: obtain the performance data of the target duration corresponding to the second application through the communication connection.
[0145] Here, the data acquisition item is used to acquire performance data for a target duration. When the user triggers this data function item, the data acquisition instruction received by the first terminal carries the target duration corresponding to the performance data to be acquired. Based on this data acquisition instruction, the performance data for the target duration can be acquired.
[0146] In some embodiments, before acquiring performance data of the second application via a communication connection, the first terminal may receive a data acquisition instruction in the following manner: presenting a start function item and an end function item for controlling the acquisition of performance data; receiving the data acquisition instruction in response to a trigger operation for the start function item; correspondingly, the first terminal may acquire performance data of the second application via the communication connection in the following manner: sending a data acquisition instruction to the second application via the communication connection, so that the second application records performance data based on the data acquisition instruction; during the recording of performance data by the second application, in response to a trigger operation for the end function item, receiving a corresponding data stop acquisition instruction for the second application, and sending the data stop acquisition instruction to the second application via the communication connection, so that the second application stops recording performance data based on the data stop acquisition instruction, and returns the recorded performance data of the second application via the communication connection; receiving the returned performance data of the second application.
[0147] Here, the "Start" function triggers a data acquisition command to obtain performance data, and the "End" function triggers a data stop command to stop obtaining performance data. When the first terminal receives the data acquisition command, it sends the command to the second application through the established communication connection. When the second application receives the command, it calls its data recording interface and records the application's performance data. If the user clicks the "End" function during recording, the terminal receives the data stop command and sends it to the second application through the established communication connection. When the second application receives the command, it stops recording performance data and returns the recorded performance data to the first application through the established communication connection. After receiving the returned performance data, the first application displays the second application's performance data in its performance analysis interface for the user to analyze the application's performance.
[0148] The above method can obtain performance data of any duration, making it convenient for users to obtain performance data of appropriate duration according to actual conditions, so as to analyze the performance of the second application and improve the adaptability of the first application.
[0149] It should be noted that the second application can run independently on the terminal device or rely on other clients on the terminal device. For example, when the second application is a subprogram application (such as a mini-program application), the subprogram application can run independently on the terminal device or rely on an instant messaging client on the terminal device. When the second application relies on other clients, when the second application receives a data acquisition instruction, it can call the data recording interface provided by the other client on which the second application relies, and record the performance data of the second application through the data recording interface. After the recording is completed, the recorded performance data is returned to the first application for display, so that users can analyze the performance of the second application.
[0150] In this manner, after receiving a data acquisition command triggered by the performance analysis interface presented by the first application, the first terminal sends the data acquisition command to the second application through the established communication connection with the second application. This allows the second application to automatically record its performance data based on the data acquisition command and automatically return the recorded performance data to the first application. The performance data is then displayed in the performance analysis interface of the first application for performance analysis. Thus, by sending the data acquisition command to the second application through the communication connection between the first and second applications, the second application automatically records and returns performance data to the first application, achieving automatic recording and return of performance data. This simplifies the operation, improves the efficiency of performance data acquisition, and consequently enhances the efficiency of performance analysis for the second application.
[0151] The following will describe an exemplary application of the embodiments of this application in a real-world application scenario. Taking a mini-program application (hereinafter referred to as a mini-program) as the second application, a performance analysis tool for performing performance analysis on the mini-program as the first application, a computer as the first terminal, and a mobile phone as the second terminal, the method for obtaining application performance data provided by the embodiments of this application will be further described.
[0152] In practical applications, mini-programs can run independently on mobile phones or be embedded in mobile clients (such as instant messaging clients). When a mini-program encounters performance issues such as lag or slow loading, developers need to analyze performance data to pinpoint the cause. One approach, where a mini-program runs on an instant messaging client, involves developers recording performance data on the client using its debugging features. This data is then transferred to a computer via data cable or file transfer before being imported into a performance analysis tool. However, this method is cumbersome, requiring multiple clicks on the phone to obtain the data. Furthermore, transferring the data from the phone to the computer via data cable or file transfer tool is still inefficient.
[0153] Therefore, this application provides a method, apparatus, device, and computer-readable storage medium for acquiring application performance data, in order to at least solve the above-mentioned problems.
[0154] See Figure 11 , Figure 11 This is a data flow diagram illustrating the application performance data acquisition method provided in this application embodiment. In practical applications, a performance analysis tool runs on a computer, an instant messaging client runs on a mobile phone, and the mini-program runs on the instant messaging client on the mobile phone. The computer and mobile phone establish a communication connection through a local area network server. The performance analysis tool sends a data acquisition command to the mini-program's basic library through the established communication connection. After receiving the data acquisition command, the mini-program's basic library automatically calls the performance data recording interface provided by the instant messaging client to record the mini-program's performance data and automatically returns the recorded performance data to the performance analysis tool for display, so that users can analyze the performance of the mini-program.
[0155] See Figure 12 , Figure 12 This is a flowchart illustrating the method for obtaining application performance data provided in this application embodiment, so as to be... Figure 1 Taking the collaborative implementation of the second terminal 200-2 (mobile phone) and the first terminal 200-1 (computer) shown, with both establishing a communication connection through the network server 300 (local area network server) as an example, the method for obtaining application performance data provided in this application embodiment will continue to be described. The method includes:
[0156] Step 201: The first terminal displays the analysis function items in the application interface of the performance analysis tool.
[0157] Here, when a user opens the performance analysis tool on the first terminal, the terminal displays the application interface of the performance analysis tool, and the analysis function item "Performance Analysis Tool" is displayed in the "Tools" menu bar of the application interface. This analysis function item is used to analyze the performance data of the mini program.
[0158] Step 202: In response to the triggered operation for the analysis function item, display the corresponding mini-program's graphic code.
[0159] In actual implementation, when a user clicks the analysis function, the performance analysis tool on the first terminal responds to the click operation by creating and starting a local area network server. After startup, the server address and port information of the local area network server are encoded and added to the network address of the mini-program to obtain the mini-program code package, which is then uploaded. Once the mini-program code package is uploaded, the application interface of the performance analysis tool will display a graphic code previewing the mini-program. The graphic code can be a QR code, barcode, etc.
[0160] Step 203: The second terminal generates a communication connection request in response to the scanning operation of the graphic code.
[0161] Step 204: The second terminal sends a communication connection request to the first terminal.
[0162] Here, the user can use the QR code scanning function on the instant messaging client of the second terminal to scan the graphic code displayed on the first terminal. The instant messaging client in the second terminal responds to the scanning operation, obtains the server address and port information of the local area network server encoded and written by the performance analysis tool, and passes this information to the mini program base library. After obtaining this information, the mini program base library runs the mini program and sends a communication connection request to the performance analysis tool to establish a communication connection through the server address and port information.
[0163] Step 205: When the first terminal determines to establish a local area network communication connection with the second terminal based on the communication connection request, the performance analysis interface of the corresponding mini-program is displayed.
[0164] Here, after receiving the first connection request, the performance analysis tool in the first terminal checks whether it is on the same local area network as the first terminal. Once it is confirmed that the second terminal and the first terminal have established a local area network communication connection, it can determine whether to establish a communication connection between the performance analysis tool on the first terminal and the applet running on the second terminal, and present the performance analysis interface of the corresponding applet.
[0165] Step 206: The first terminal responds to the trigger operation for the function item in the performance analysis interface and receives the data acquisition instruction.
[0166] Step 207: The first terminal sends a data acquisition command to the second terminal through the established communication connection.
[0167] In practical applications, the performance analysis interface contains acquisition functions for obtaining performance data, such as buttons for "Get Heap Snapshot", "Start" or "Stop". The first terminal responds to the trigger operation for the acquisition function, receives the data acquisition instruction for obtaining performance data, and sends the data acquisition instruction to the applet in the second terminal through the established communication connection.
[0168] Step 208: The second terminal obtains the performance data of the mini-program based on the data acquisition command.
[0169] Here, the first terminal sends a data acquisition command to the mini-program base library in the second terminal. After receiving the data acquisition command, the mini-program base library calls the data recording interface provided by the instant messaging client and records the performance data of the mini-program during its operation through the data recording interface to obtain the performance data of the mini-program.
[0170] Step 209: The second terminal sends the performance data of the mini-program to the first terminal through the established communication connection.
[0171] Here, the performance data of the mini-program obtained by the mini-program base library in the second terminal is returned to the performance analysis tool in the first terminal through the established communication connection.
[0172] Step 210: The first terminal displays the performance data of the mini-program in the performance analysis interface.
[0173] After receiving the performance data of the mini-program returned by the second terminal, the performance analysis tool displays the performance data of the mini-program in the performance analysis interface so that users can analyze the performance of the mini-program.
[0174] The above method establishes a communication connection between the performance analysis tool on the computer and the mini-program on the mobile phone via a local area network server. Through this connection, the performance analysis tool directly sends data acquisition commands to the mini-program's basic library. Upon receiving the commands, the library automatically calls the performance data recording interface provided by the instant messaging client to record the mini-program's performance data and automatically returns it to the performance analysis tool for display. This allows users to analyze the mini-program's performance without having to click multiple buttons on their phones, greatly simplifying the data acquisition process and improving the efficiency of performance data acquisition and performance problem analysis.
[0175] The following description continues to illustrate the exemplary structure of the application performance data acquisition device 555 provided in the embodiments of this application as a software module. In some embodiments, see [link to relevant documentation]. Figure 13 , Figure 13 This is a schematic diagram of the structure of the application performance data acquisition device provided in the embodiments of this application, stored in... Figure 2 The software module in the application performance data acquisition device 555 of the memory 550 may include:
[0176] The first presentation module 5551 is used to present analysis function items for analyzing the performance data of the second application in the application interface of the first application.
[0177] The first processing module 5552 is used to respond to the trigger operation for the analysis function item, establish a communication connection between the first application and the second application, and present a performance analysis interface corresponding to the second application.
[0178] The second processing module 5553 is configured to, in response to a data acquisition command triggered based on the performance analysis interface, acquire performance data of the second application through the communication connection, and
[0179] The performance analysis interface displays the performance data of the second application for performance analysis.
[0180] In some embodiments, the first presentation module is further configured to present an application selection function item for making an application selection;
[0181] In response to a trigger operation for the application selection function item, an application selection interface including at least one candidate application is presented;
[0182] In response to the selection operation for the candidate application, the selected application is identified as the second application, and the analysis function items corresponding to the second application are presented.
[0183] In some embodiments, the first processing module is further configured to present a graphical code corresponding to the second application in response to a trigger operation for the analysis function item;
[0184] When a recognition operation for the graphic code is received from the target device and the target device is running the second application, a communication connection is established between the first application and the second application running on the target device.
[0185] In some embodiments, before presenting the graphic code corresponding to the second application, the apparatus further includes:
[0186] The image code acquisition module is used to create and start a local area network server and obtain the server address and port information of the local area network server.
[0187] Obtain the network address of the second application, and based on the server address and port information, encode the network address of the second application to obtain the graphic code of the second application.
[0188] In some embodiments, the first processing module is further configured to receive a first connection request for requesting to establish a communication connection, wherein the first connection request is generated by the target device when running the second application in response to the identification operation;
[0189] Based on the first connection request, when it is determined that the target device has connection permission, a communication connection is established between the first application and the second application running on the target device.
[0190] In some embodiments, the first processing module is further configured to present connection prompt information to prompt the target device to request the establishment of a communication connection;
[0191] In response to a connection confirmation operation triggered based on the connection prompt information, a communication connection is established between the first application and the second application running on the target device.
[0192] In some embodiments, the first processing module is further configured to, in response to a trigger operation for the analysis function item, obtain the graphical code of the second application from a wide area network server storing the graphical code corresponding to the second application, and present the graphical code of the second application in the application interface of the first application.
[0193] In some embodiments, the first processing module is further configured to present a device selection function item for making a device selection;
[0194] In response to a trigger operation on the device selection function item, a device selection interface is presented, including at least one candidate device running the second application;
[0195] In response to the selection operation for a target device among the at least one candidate devices, a second connection request for requesting the establishment of a communication connection is sent to the target device;
[0196] When a connection confirmation instruction is received from the target device based on the second connection request, a communication connection is established between the first application and the second application running on the target device.
[0197] In some embodiments, the first processing module is further configured to present a performance analysis interface corresponding to the second application, obtained by navigation from the application interface of the first application; or...
[0198] In the application interface of the first application, the performance analysis interface of the corresponding second application is presented via a pop-up window; or,
[0199] The performance analysis interface corresponding to the second application is presented. The performance analysis interface is a sub-interface independent of the application interface of the first application.
[0200] In some embodiments, before acquiring the performance data of the second application via the communication connection, the apparatus further includes:
[0201] The instruction receiving module is used to present, in the performance analysis interface, options for at least one performance data corresponding to the second application, and acquisition function items for acquiring performance data;
[0202] In response to a selection operation for a target option, the target type of the performance data corresponding to the target option is determined;
[0203] In response to a trigger operation for the acquisition function item, a data acquisition instruction for the target type of performance data is received;
[0204] The second processing module is further configured to acquire performance data of the target type corresponding to the second application through the communication connection.
[0205] In some embodiments, the performance analysis interface includes a type selection area and a device information display area;
[0206] The instruction receiving module is also used to present, in the type selection area of the performance analysis interface, an option for at least one performance data corresponding to the second application, and a function item for obtaining performance data;
[0207] The device further includes:
[0208] The device information display module is used to display device information of the device running the second application in the device information display area.
[0209] In some embodiments, the first processing module is further configured to, when the second application is a subroutine application, obtain at least one of the following performance data of the subroutine application through the communication connection:
[0210] Heap snapshots used to analyze the memory usage of the subroutine, and CPU configuration data used to analyze the script execution time of the subroutine.
[0211] In some embodiments, the second processing module is further configured to send the data acquisition instruction to the second application through the communication connection, so that the second application can acquire the performance data of the second application based on the data acquisition instruction, and return the performance data of the second application through the communication connection;
[0212] Receive the performance data returned by the second application.
[0213] In some embodiments, before obtaining the performance data of the second application through the communication connection, the instruction receiving module is further configured to present a function item for obtaining performance data in the performance analysis interface;
[0214] In response to a trigger operation for the acquisition function item, the data acquisition instruction is received, the data acquisition instruction carrying the target duration for acquiring performance data;
[0215] The second processing module is further configured to acquire performance data of the target duration corresponding to the second application through the communication connection.
[0216] In some embodiments, before acquiring the performance data of the second application through the communication connection, the instruction receiving module is further configured to present a start function item and an end function item for controlling the acquisition of performance data;
[0217] In response to a trigger operation for the start function item, the data acquisition instruction is received;
[0218] The second processing module is further configured to send the data acquisition instruction to the second application through the communication connection, so that the second application records the performance data of the second application based on the data acquisition instruction;
[0219] During the recording of performance data in the second application, in response to the trigger operation for the end function item, a data stop acquisition instruction corresponding to the second application is received, and the data stop acquisition instruction is sent to the second application through the communication connection, so that the second application stops recording the performance data of the second application based on the data stop acquisition instruction, and returns the recorded performance data of the second application through the communication connection;
[0220] Receive the performance data returned by the second application.
[0221] This application provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the application performance data acquisition method described in this application embodiment.
[0222] This application provides a computer-readable storage medium storing executable instructions, wherein the executable instructions are executed by a processor, causing the processor to execute the application performance data acquisition method provided in this application.
[0223] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.
[0224] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0225] As an example, executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple collaborating files (e.g., a file that stores one or more modules, subroutines, or code sections).
[0226] As an example, executable instructions can be deployed to execute on a single computing device, or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.
[0227] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.
Claims
1. A method for acquiring application performance data, characterized in that, The method includes: The application interface of the first application presents analysis function items for analyzing the performance data of the second application; wherein the first application and the second application run on the same terminal, or the first application and the second application run on different terminals; In response to a trigger operation for the analysis function item, a graphical code of the second application is presented in the application interface of the first application, wherein the graphical code is obtained by encoding the network address of the second application based on the address and port information of the local area network server. When a recognition operation for the graphic code is received from the target device and the target device is running the second application, a local area network communication connection is established between the first application and the second application running on the target device, and a performance analysis interface corresponding to the second application is presented, which is obtained by jumping from the application interface of the first application; or, the performance analysis interface corresponding to the second application is presented in the application interface of the first application via a pop-up window; or, the performance analysis interface corresponding to the second application is presented, wherein the performance analysis interface is a sub-interface independent of the application interface of the first application. Wherein, when the first application and the second application run on the same terminal, the target device is the terminal running the first application; when the first application and the second application run on different terminals, the target device is another terminal different from the terminal running the first application. In response to a data acquisition command triggered by the performance analysis interface, and in response to a start function item that controls the acquisition of performance data, the data acquisition command is sent to the second application via the local area network communication connection, so that the second application records the performance data of the second application based on the data acquisition command. During the recording of performance data in the second application, in response to the triggering operation of the end function item that controls the acquisition of performance data, a data stop acquisition command is sent to the second application through the local area network communication connection; The performance data recorded by the second application is obtained through the local area network communication connection, and The performance analysis interface displays the performance data of the second application for performance analysis.
2. The method as described in claim 1, characterized in that, The analytical functions presented for analyzing performance data of the second application include: Presents an application selection function for making application choices; In response to a trigger operation for the application selection function item, an application selection interface including at least one candidate application is presented; In response to the selection operation for the candidate application, the selected application is identified as the second application, and the analysis function items corresponding to the second application are presented.
3. The method as described in claim 1, characterized in that, Establishing a local area network communication connection between the first application and the second application running on the target device includes: A first connection request is received to request the establishment of the local area network communication connection. The first connection request is generated by the target device when it runs the second application in response to the identification operation. Based on the first connection request, when it is determined that the target device has connection permissions, a local area network communication connection is established between the first application and the second application running on the target device.
4. The method as described in claim 1, characterized in that, Establishing a local area network communication connection between the first application and the second application running on the target device includes: A connection prompt message is displayed to indicate to the target device that it requests to establish the local area network communication connection; In response to a connection confirmation operation triggered based on the connection prompt information, a local area network communication connection is established between the first application and the second application running on the target device.
5. The method as described in claim 1, characterized in that, Before obtaining the performance data recorded by the second application through the local area network communication connection, the method further includes: The performance analysis interface presents options for at least one performance data corresponding to the second application, as well as a function item for obtaining performance data. In response to a selection operation for a target option, the target type of the performance data corresponding to the target option is determined; In response to a trigger operation for the acquisition function item, a data acquisition instruction for the target type of performance data is received; The step of obtaining the performance data recorded by the second application through the local area network communication connection includes: The performance data of the target type recorded by the second application is obtained through the local area network communication connection.
6. The method as described in claim 5, characterized in that, The performance analysis interface includes a type selection area and a device information display area; The performance analysis interface presents options for at least one performance data corresponding to the second application, as well as functions for obtaining performance data, including: In the type selection area of the performance analysis interface, options for at least one performance data corresponding to the second application and a function item for obtaining performance data are presented. The method further includes: The device information display area displays device information for the device running the second application.
7. The method as described in claim 1, characterized in that, The step of obtaining the performance data recorded by the second application through the local area network communication connection includes: When the second application is a subroutine application, at least one of the following performance data of the subroutine application is obtained through the local area network communication connection: Heap snapshots for analyzing the memory usage of the subroutine application, and CPU configuration data for analyzing the script execution time of the subroutine application.
8. An application performance data acquisition device, characterized in that, The device includes: The first presentation module is used to present analysis function items for analyzing the performance data of the second application in the application interface of the first application; wherein the first application and the second application run on the same terminal, or the first application and the second application run on different terminals. The first processing module is configured to, in response to a trigger operation on the analysis function item, present the graphical code of the second application in the application interface of the first application. When a recognition operation for the graphic code is received from the target device and the target device is running the second application, a local area network communication connection is established between the first application and the second application running on the target device, and a performance analysis interface corresponding to the second application is presented, which is obtained by jumping from the application interface of the first application; or, the performance analysis interface corresponding to the second application is presented in the application interface of the first application via a pop-up window; or, the performance analysis interface corresponding to the second application is presented, wherein the performance analysis interface is a sub-interface independent of the application interface of the first application. Wherein, when the first application and the second application run on the same terminal, the target device is the terminal running the first application; when the first application and the second application run on different terminals, the target device is another terminal different from the terminal running the first application. The graphic code acquisition module is used to encode the network address of the second application based on the address and port information of the local area network server to obtain the graphic code; The second processing module is configured to respond to a data acquisition command triggered based on the performance analysis interface, and to respond to the triggering operation of a start function item that controls the acquisition of performance data. The data acquisition instruction is sent to the second application through the local area network communication connection, so that the second application records the performance data of the second application based on the data acquisition instruction; During the recording of performance data in the second application, in response to the triggering operation of the end function item that controls the acquisition of performance data, a data stop acquisition command is sent to the second application through the local area network communication connection; The performance data recorded by the second application is obtained through the local area network communication connection, and The performance analysis interface displays the performance data of the second application for performance analysis.
9. The apparatus according to claim 8, characterized in that, The first presentation module is also used to present an application selection function item for making an application selection; In response to a trigger operation for the application selection function item, an application selection interface including at least one candidate application is presented; In response to the selection operation for the candidate application, the selected application is identified as the second application, and the analysis function items corresponding to the second application are presented.
10. The apparatus according to claim 8, characterized in that, The first processing module is further configured to receive a first connection request for requesting to establish the local area network communication connection, wherein the first connection request is generated by the target device when running the second application in response to the identification operation; Based on the first connection request, when it is determined that the target device has connection permissions, a local area network communication connection is established between the first application and the second application running on the target device.
11. The apparatus according to claim 8, characterized in that, The first processing module is further configured to present connection prompt information to the target device requesting the establishment of the local area network communication connection; In response to a connection confirmation operation triggered based on the connection prompt information, a local area network communication connection is established between the first application and the second application running on the target device.
12. The apparatus according to claim 8, characterized in that, The device further includes: The instruction receiving module is used to present, in the performance analysis interface, options for at least one performance data corresponding to the second application, and acquisition function items for acquiring performance data; In response to a selection operation for a target option, the target type of the performance data corresponding to the target option is determined; In response to a trigger operation for the acquisition function item, a data acquisition instruction for the target type of performance data is received; The second processing module is further configured to acquire performance data of the target type recorded by the corresponding second application through the local area network communication connection.
13. The apparatus according to claim 12, characterized in that, The performance analysis interface includes a type selection area and a device information display area; The instruction receiving module is also used to present, in the type selection area of the performance analysis interface, an option for at least one performance data corresponding to the second application, and a function item for obtaining performance data; The device information display module is used to display device information of the device running the second application in the device information display area.
14. The apparatus according to claim 8, characterized in that, The first processing module is further configured to, when the second application is a subroutine application, obtain at least one of the following performance data of the subroutine application through the local area network communication connection: Heap snapshots for analyzing the memory usage of the subroutine application, and CPU configuration data for analyzing the script execution time of the subroutine application.
15. An electronic device, characterized in that, include: Memory, used to store executable instructions; A processor, when executing executable instructions stored in the memory, implements the method for acquiring application performance data as described in any one of claims 1 to 7.
16. A computer-readable storage medium, characterized in that, It stores executable instructions for use by a processor to implement the method for obtaining application performance data as described in any one of claims 1 to 7.
17. A computer program product comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by the processor, they implement the method for obtaining application performance data as described in any one of claims 1 to 7.