Performance monitoring method and device for television application and electronic equipment
By saving the monitoring items of Android TV as a configuration table, and using bytecode instrumentation technology to generate mixed function classes, dynamically determine the target function classes, the problem of high cost and low efficiency of changing the performance monitoring logic in the existing technology is solved, and efficient performance monitoring and compatibility with different Android versions is achieved.
Patent Information
- Application Number
- CN202411708650.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-18
AI Technical Summary
In the prior art, changing the performance monitoring logic of Android TV is cost-effective and inefficient, and it is necessary to change the monitoring class or monitoring method corresponding to the monitoring item.
By saving the monitoring items of the TV application in the form of a configuration table, and combining bytecode insertion technology, a hybrid function class or mixed function method and a function set are generated, and the target function class or target function method are dynamically determined to achieve performance monitoring.
Improve the development efficiency of changing performance monitoring logic, reduce development costs, and achieve flexible performance monitoring configuration and compatibility with different Android versions.
Smart Images

Figure CN119653178A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of smart televisions, and in particular to a method, device and electronic equipment for monitoring the performance of television applications. Background Art
[0002] With the popularity of Android TV, users are not only satisfied with watching TV programs, but also hope to have a richer, smoother and more personalized user experience. The increasing demand for various functions and application scenarios also puts higher requirements on the performance of applications. In the process of using smart TV, performance problems such as delays, crashes and crashes often occur, which seriously affect the user's viewing experience. Performance problems may be caused by many factors, including defects in the application itself, insufficient system resources, fluctuations in the network environment, etc. Therefore, performance monitoring of Android TV is particularly important.
[0003] In the prior art, performance monitoring of Android TV generally requires a separately customized set of monitoring classes or monitoring methods. When the monitoring logic corresponding to the performance monitoring item is changed, the monitoring class or monitoring method corresponding to the monitoring item needs to be changed, which results in the problem of high cost and low efficiency in changing the performance monitoring logic. Summary of the invention
[0004] To this end, the present invention provides a performance monitoring method, device and electronic device for a television application to solve the problem of high cost and low efficiency in changing the performance monitoring logic in the prior art.
[0005] In a first aspect, a method for monitoring performance of a television application is provided, the method comprising:
[0006] On the server side, all monitoring items of the TV application are saved in the form of a configuration summary table;
[0007] The monitoring items in the configuration summary table are combined with bytecode plugging to obtain a hybrid function class or a hybrid function method and a function set; the function set stores a mapping relationship between the monitoring items and the corresponding hybrid function class or hybrid function method;
[0008] Selecting the required monitoring items and the corresponding hybrid function classes or hybrid function methods and the function set from the configuration master table and sending them to the TV application terminal;
[0009] At the TV application end, taking the received monitoring item as a target monitoring item;
[0010] Determining the required target function class or target function method according to the target monitoring item and the function set;
[0011] Performing performance monitoring on the television application through the target function class or target function method to obtain monitoring data;
[0012] Arranging, filtering and aggregating the monitoring data to obtain target monitoring data;
[0013] The target monitoring data is uploaded to the server.
[0014] Furthermore, the monitoring items in the configuration summary table are combined with bytecode instrumentation to obtain a hybrid function class or a hybrid function method and a function set, including:
[0015] Encapsulate the class and method corresponding to the monitoring item to obtain the function class or function method of the monitoring item;
[0016] Inserting the function code corresponding to the monitoring item into the function class or function method through bytecode insertion to obtain a target function class or target function method;
[0017] The mapping relationship between the monitoring item, the corresponding function class or function method and the corresponding target function class or target function method is saved in the function set.
[0018] Further, the target monitoring item is application startup; and the monitoring data is obtained by monitoring the performance of the television application through the target function class or target function method, including:
[0019] The time point when the first method is executed when the TV application is started is marked as the first starting point of the application startup, and the time point when the window obtains the focus is marked as the first end point of the application startup, and the difference between the first starting point and the first end point is used as the application startup time;
[0020] Collect TV's maximum memory, remaining memory, CPU usage and other performance data;
[0021] The performance data and the application startup time are combined and stored to obtain the monitoring data.
[0022] Further, the target monitoring item is page startup; the monitoring data is obtained by monitoring the performance of the television application through the target function class or target function method, including:
[0023] Through the Android life cycle callback, the time point when the page is created is marked as the second starting point of the page startup, the time point when the window obtains the focus is marked as the second end point, and the difference between the second starting point and the second end point is used as the page startup time;
[0024] Collecting page information and call stack information of the page;
[0025] The page information, the call stack information and the page startup time are combined and stored to obtain the monitoring data.
[0026] Furthermore, the target monitoring item is fluency monitoring; and the monitoring data is obtained by monitoring the performance of the television application through the target function class or target function method, including:
[0027] Insert a target task into the head of the input callback queue of the main thread choreographer in the TV application to monitor the generation time of the next frame;
[0028] When the drawing task starts, the target task records the start time and start status;
[0029] When the drawing task is finished, the target task records the end time and end status;
[0030] Obtain the generation duration through the start time, start status, end time and end status;
[0031] Re-insert a target task into the head of the input callback queue to continue monitoring the generation duration of subsequent frames;
[0032] The generation duration corresponding to each frame is used as monitoring data.
[0033] Further, the target monitoring item is network monitoring; and the monitoring data is obtained by monitoring the performance of the television application through the target function class or target function method, including:
[0034] Insert a custom network interceptor into the network framework, and obtain the network request address, uplink and downlink data, response code, and request duration through the network interceptor;
[0035] The network request address, uplink and downlink data, response code and request duration are combined and stored to obtain monitoring data.
[0036] Further, the target monitoring item is freeze monitoring; the monitoring data is obtained by monitoring the performance of the TV application through the target function class or target function method, including:
[0037] Get the message execution time of the main thread through the Android message mechanism;
[0038] The execution time of the message is used as monitoring data.
[0039] Furthermore, the bytecode instrumentation adopts an ASM bytecode framework.
[0040] In a second aspect, a performance monitoring device for a television application is provided, the device comprising:
[0041] The configuration item module is used to save all monitoring items of the TV application in the form of a configuration summary table;
[0042] A bytecode plugging module, used for combining the monitoring items in the configuration master table with the bytecode plugging to obtain a hybrid function class or a hybrid function method and a function set; the function set stores a mapping relationship between the monitoring items and the corresponding hybrid function class or hybrid function method;
[0043] A sending module, used to select required monitoring items and corresponding hybrid function classes or hybrid function methods and the function set from the configuration master table and send them to the TV application end;
[0044] A receiving module, used for taking the received monitoring item as a target monitoring item;
[0045] A monitoring function confirmation module, used to determine the required target function class or target function method according to the target monitoring item and the function set;
[0046] A data monitoring module, used to perform performance monitoring on the television application through the target function class or target function method to obtain monitoring data;
[0047] It is also used to sort, filter and aggregate the monitoring data to obtain target monitoring data;
[0048] An uploading module is used to upload the target monitoring data to the server.
[0049] In a third aspect, an electronic device is provided, including:
[0050] at least one processor; and
[0051] a memory communicatively connected to the at least one processor; wherein,
[0052] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform any of the above-mentioned monitoring methods.
[0053] The present invention adopts the above technical solution and has at least the following beneficial effects:
[0054] Provided are a performance monitoring method, device and electronic device for a television application. Monitoring items of the television application are combined with bytecode plugging to obtain a hybrid function class or a hybrid function method and a function set. After the required monitoring items are selected, the required target function class or target function method is found in the function set. The television application is performance monitored through the target function class or target function method to obtain monitoring data. When the performance monitoring logic needs to be modified, due to the combination of bytecode plugging technology, the performance monitoring logic can be changed by simply inserting the modified function code into the function class or function method corresponding to the original monitoring item, thereby effectively improving development efficiency and reducing development costs.
[0055] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0057] Figure 1 is a flow chart of a method for monitoring performance of a television application according to an exemplary embodiment of the present invention;
[0058] Figure 2 is a schematic block diagram of a performance monitoring device for a television application shown in an exemplary embodiment of the present invention;
[0059] Figure 3 It is a schematic block diagram of an electronic device shown in an exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0061] In the prior art, since there are many low-version Android TV devices, the performance monitoring logic required by multiple versions is incompatible and needs to be modified to adapt to the corresponding version. However, each modification requires underlying modifications to the function class or function method corresponding to the performance monitoring item, resulting in high cost and low efficiency.
[0062] The embodiments of the present application provide a performance monitoring method, device and electronic device for a television application, which can flexibly select the configuration to be monitored through configuration items to meet personalized needs; when adapting to different Android versions, bytecode plug-in technology is combined, and there is no need to make underlying modifications to the function class or function method corresponding to the performance monitoring item, which effectively improves development efficiency and saves costs.
[0063] The monitoring method and device in this application are described below through specific examples.
[0064] See also Figure 1 , Figure 1 is a flowchart of a method for monitoring the performance of a television application according to an exemplary embodiment of the present invention. Figure 1 , the method comprising:
[0065] Step S11, saving all monitoring items of the television application in the form of a configuration summary table;
[0066] Step S12: combining the monitoring items in the configuration summary table with the bytecode plug-in to obtain a hybrid function class or a hybrid function method and a function set; the function set stores a mapping relationship between the monitoring items and the corresponding hybrid function class or hybrid function method;
[0067] Step S13, selecting the required monitoring items and the corresponding hybrid function classes or hybrid function methods and function sets from the configuration master table and sending them to the TV application end;
[0068] Step S14: taking the received monitoring item as the target monitoring item;
[0069] Step S15: Determine the required target function class or target function method according to the target monitoring item and the function set;
[0070] Step S16: Monitor the performance of the TV application through the target function class or target function method to obtain monitoring data;
[0071] Step S17: sorting, filtering and aggregating the monitoring data to obtain target monitoring data;
[0072] Step S18: Upload the target monitoring data to the server.
[0073] It should be noted that the technical solution provided in this embodiment can realize the performance monitoring function in the form of a small program or in the form of an independent application in specific practice, and the applicable scenarios include but are not limited to: TV applications and other functional scenarios that require performance monitoring.
[0074] It can be understood that the monitoring method provided in this embodiment combines the monitoring items of the TV application with bytecode instrumentation to obtain a hybrid function class or a hybrid function method and a function set. After selecting the required monitoring items, the required target function class or target function method is found in the function set, and the TV application is performance monitored through the target function class or target function method to obtain monitoring data. When it is necessary to modify the performance detection logic, due to the combination of bytecode instrumentation technology, it is only necessary to insert the modified function code into the function class or function method corresponding to the original monitoring item to change the performance monitoring logic, which effectively improves development efficiency and thereby reduces development costs.
[0075] In specific practice, the monitoring items in step S11 "saving all monitoring items of the TV application in the form of a configuration summary table" are generally: application startup, page startup, crash detection, application unresponsiveness detection, fluency detection, network monitoring, log capture, and freeze monitoring.
[0076] In specific practice, step S12 "combining the monitoring items in the configuration summary table with bytecode instrumentation to obtain a hybrid function class or a hybrid function method and a function set" includes: encapsulating the classes and methods corresponding to the detection items to obtain the function class or function method of the monitoring items; inserting the function code corresponding to the monitoring items into the function class or function method through bytecode instrumentation to obtain the target function class or target function method; saving the mapping relationship between the monitoring items, the corresponding function class or function method and the corresponding target function class or target function method to the function set.
[0077] It should be noted that there is no need to perform bytecode instrumentation for filtering blacklists, empty methods, and regular methods in the monitoring items.
[0078] It can be understood that the technical solution provided in this embodiment, when the performance detection logic needs to be modified, due to the combination of bytecode insertion technology, it is only necessary to insert the modified function code into the function class or function method corresponding to the original monitoring item to change the performance monitoring logic.
[0079] In specific practice, step S16 "monitoring the performance of the TV application by the target function class or target function method to obtain monitoring data" includes:
[0080] The target monitoring item is application startup. The time point when the first method is executed when the TV application is started is marked as the first starting point of the application startup. The time point when the window obtains the focus is marked as the first end point of the application startup. The difference between the first starting point and the first end point is taken as the application startup time.
[0081] It should be noted that, for Android TV's Launcher application, application startup refers to the process from launching the application when the device is turned on to the main interface of the application being displayed on the screen. Using the bytecode instrumentation method, the first method executed when the application is started is marked as the starting point of the application startup, and the end point when the window gets the focus is marked as the end point. The difference between the two is the application startup time. At the same time, in order to analyze the application startup situation, the device performance, maximum memory, remaining memory, and event occurrence time are also collected. It is also analyzed whether it is the first startup or whether it is a slow startup.
[0082] The target monitoring item is page startup. Through the Android life cycle callback, the time point when the page is created is marked as the second starting point of the page startup, the time point when the window gets the focus is marked as the second end point, and the difference between the second starting point and the second end point is used as the page startup time; the page information and call stack information of the page are collected; the page information, call stack information and page startup time are combined and stored to obtain monitoring data. The maximum memory, remaining memory, CPU usage and other performance data of the TV are collected; the performance data and application startup time are combined and stored to obtain monitoring data.
[0083] It should be noted that page startup refers to the process from page creation to page display in front of the user. It is essential to provide a smooth and responsive user experience. Using the Android lifecycle callback, the page creation is marked as the starting point of page startup, and the window is marked as the end point when it gets the focus. The difference between the two is the page startup time. Page startup adds page information and call stack information based on application startup.
[0084] The target monitoring item is crash detection, which is the phenomenon that the application cannot be executed normally due to unhandled exceptions or errors during operation, resulting in the application being forced to close. This crash is usually caused by some errors or improper operations in the program, such as null pointer exceptions, array out-of-bounds exceptions, class conversion exceptions, etc. Through the uncaught exception handler, the unhandled exceptions of the application can be captured and the exception information can be collected. The specific process is: 1) If the TV application crashes, the unhandled exceptions of the application can be captured through the uncaught exception handler. 2) Start collecting crash information, including exception stack information, current memory information, thread information, etc. 3) Organize the captured crash information into a log file, including timestamp, exception type, stack information, device information, etc. 4) Save the log file locally for subsequent processing. 5) After the device restarts, if the network is normal, upload the crash log to the server; if the network is abnormal, retry uploading when the application is started next time.
[0085] The target monitoring item is smoothness detection. A target task is inserted into the head of the input callback queue of the main thread choreographer in the TV application to monitor the generation time of the next frame; when the drawing task starts, the target task records the start time and start status; when the drawing task ends, the target task records the end time and end status; the generation time is obtained through the start time, start status, end time and end status; a target task is re-inserted into the head of the input callback queue to continue to monitor the generation time of subsequent frames; the generation time corresponding to each frame is used as monitoring data.
[0086] It should be noted that the smoothness detection is the frame rate detection, which indicates the number of times the screen is updated or rendered per second. A higher frame rate means that the video screen is more coherent, and the audience can feel a smoother visual effect when watching. On the contrary, the lower the frame rate, the slower the screen update, and there may be freezes, delays, and other phenomena, affecting the user experience. For high-version Android TV devices, the system provides a corresponding way to directly monitor the frame rate. For low-version Android TV devices, the frame rate cannot be directly monitored. Through the main thread monitor to monitor each message of the main thread, by obtaining the choreographer of the main thread (the introduction of the choreographer provides a stable opportunity for the rendering of the upper-layer application, and uniformly manages the execution of the application's input, animation, drawing and other tasks), insert a marking task in front of each task queue, calculate the time consumption of each task, and after processing the message of the drawing task, re-insert the task to the head of the queue to continue to monitor the time consumption of the next frame. The specific steps are: 1) Insert a task to the head of the "input" callback queue of the main thread choreographer to monitor the starting point of the next frame. 2) When drawing for the first time or the View changes, it will request to receive the vertical synchronization signal and wait for it to be received. 3) After receiving the system vertical synchronization signal, the input task will be executed first. 4) Since the inserted input task is at the head of the queue, it will be executed first, and the start time and status of the input task will be recorded. 5) Similarly, tasks are also inserted into the head of the callback queue of the animation and drawing tasks, and the start status, start time, end status, and end time of the tasks are recorded respectively, so that the time consumption of the three stages is obtained. 6) After processing the message of the drawing task, the task is reinserted into the head of the input callback queue to continue monitoring the time consumption of the next frame.
[0087] The target monitoring item is ANR detection. ANR refers to the inability of an application to respond to user operations or system events for a period of time, causing the system to pop up a dialog box to ask the user whether to forcefully close the application. By starting an asynchronous thread, in a loop, using the main thread's message queue to send a message, the thread sleeps for a specified time of 5 seconds. When the thread wakes up, if the sent message has not been executed by the main thread, it is considered that the main thread has an ANR.
[0088] The target monitoring item is network monitoring. A custom network interceptor is inserted into the network framework. The network request address, uplink and downlink data, response code and request duration are obtained through the network interceptor. The network request address, uplink and downlink data, response code and request duration are combined and stored to obtain monitoring data.
[0089] It should be noted that network monitoring refers to real-time tracking, recording and analysis of all network requests occurring in the network environment, so as to timely discover and deal with potential problems, including performance bottlenecks, security threats, network failures, etc. Its purpose is to ensure the availability, stability and security of the network, and improve user experience and business continuity. Through bytecode instrumentation, a custom network interceptor is inserted into the network framework, and the network request address, uplink and downlink data, response code, request time, etc. are analyzed through the network interceptor. At the same time, the network request status is intuitively displayed through flexible data aggregation configuration. The specific process is: 1) Check the configuration, such as the detection item switch, collection size, and whether it is a blacklist. 2) Filter out the network requests that need to be processed according to the configured blacklist rules. 3) Record the time when the network request starts, the request address, the request parameters and other information. 4) Initiate a network request. 5) Record the time when the request ends, the response code and other information. 6) Sort out the data of a complete request, such as the network request address, uplink and downlink data, response code, request time and other information and insert the data. 7) Analyze, aggregate and store the data in the data pipeline.
[0090] The target monitoring item is log capture, which refers to the process of capturing and collecting log information generated during the operation of the system or application on an Android TV device. These log information are important tools for developers, testers, and system administrators to diagnose problems, optimize performance, and understand application behavior. Execute a specific string command in the application. This method starts a new process to execute the command and returns a process that can be used to control the process and obtain relevant information about the process, and saves it as log information.
[0091] The target monitoring item is jam monitoring, which obtains the message execution time of the main thread through the Android message mechanism; the message execution time is used as the monitoring data.
[0092] It should be noted that jam monitoring refers to the process of real-time monitoring and analysis of page response delays or jams that occur when an application is running. By using the Android message mechanism, the printer polled by the main thread is replaced, and calculation logic is added to monitor the execution time of the message to determine whether a jam has occurred.
[0093] In specific practice, step S17 "organize, filter and aggregate the monitoring data to obtain the target monitoring data" is specifically as follows: the data in the aforementioned data collector will be stored in the data storage pipeline, and the data will be organized, filtered, aggregated, etc., and the first-in-first-out principle will be used to ensure the effectiveness and accuracy of the data.
[0094] See also Figure 2 , Figure 2 is a schematic block diagram of a performance monitoring device for a television application according to an exemplary embodiment of the present invention, see Figure 2 , the performance monitoring device 100 of the television application comprises:
[0095] The configuration item module 101 is used to save all monitoring items of the TV application in the form of a configuration summary table;
[0096] The bytecode instrumentation module 102 is used to combine the monitoring items in the configuration summary table with the bytecode instrumentation to obtain a hybrid function class or a hybrid function method and a function set; the function set stores a mapping relationship between the monitoring items and the corresponding hybrid function class or hybrid function method;
[0097] The sending module 103 is used to select the required monitoring items and the corresponding hybrid function classes or hybrid function methods and function sets from the configuration master table and send them to the TV application end;
[0098] The receiving module 104 is used to use the received monitoring item as a target monitoring item;
[0099] A monitoring function confirmation module 105 is used to determine the required target function class or target function method according to the target monitoring item and the function set;
[0100] The data monitoring module 106 is used to monitor the performance of the TV application through the target function class or target function method to obtain monitoring data;
[0101] It is also used to organize, filter and aggregate monitoring data to obtain target monitoring data;
[0102] The uploading module 107 is used to upload the target monitoring data to the server.
[0103] It should be noted that the technical solution provided in this embodiment can be applied in specific practice to scenarios including, but not limited to: television applications and other functional scenarios that require performance monitoring.
[0104] It can be understood that the device provided in this embodiment combines the monitoring items of the TV application with bytecode insertion to obtain a hybrid function class or a hybrid function method and a function set. After selecting the required monitoring items, the required target function class or target function method is found in the function set, and the TV application is performance monitored through the target function class or target function method to obtain monitoring data. When it is necessary to modify the performance detection logic, due to the combination of bytecode insertion technology, it is only necessary to insert the modified function code into the function class or function method corresponding to the original monitoring item to change the performance monitoring logic, which effectively improves development efficiency and then reduces development costs.
[0105] See also Figure 3 , Figure 3 is a schematic block diagram of an electronic device according to an exemplary embodiment of the present invention, see Figure 3 , an electronic device 200, comprising:
[0106] at least one processor 202; and
[0107] A memory 201 is communicatively connected to at least one processor 202; wherein,
[0108] The memory 201 stores instructions that can be executed by at least one processor 202. The instructions are executed by the at least one processor 202 so that the at least one processor 202 can perform any of the above monitoring methods.
[0109] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
[0110] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0111] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0112] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for monitoring the performance of a television application, characterized in that: include: On the server side, all monitoring items of the TV application are saved in the form of a configuration summary table; The monitoring items in the configuration summary table are combined with bytecode plugging to obtain a hybrid function class or a hybrid function method and a function set; the function set stores a mapping relationship between the monitoring items and the corresponding hybrid function class or hybrid function method; Selecting the required monitoring items and the corresponding hybrid function classes or hybrid function methods and the function set from the configuration master table and sending them to the TV application terminal; At the TV application end, taking the received monitoring item as a target monitoring item; Determining the required target function class or target function method according to the target monitoring item and the function set; Performing performance monitoring on the television application through the target function class or target function method to obtain monitoring data; Arranging, filtering and aggregating the monitoring data to obtain target monitoring data; The target monitoring data is uploaded to the server.
2. The performance monitoring method according to claim 1, characterized in that: The monitoring items in the configuration summary table are combined with bytecode plugging to obtain a hybrid function class or a hybrid function method and a function set, including: Encapsulate the class and method corresponding to the monitoring item to obtain the function class or function method of the monitoring item; Inserting the function code corresponding to the monitoring item into the function class or function method through bytecode insertion to obtain a target function class or target function method; The mapping relationship between the monitoring item, the corresponding function class or function method and the corresponding target function class or target function method is saved in the function set.
3. The performance monitoring method according to claim 2, characterized in that: The target monitoring item is application startup; the monitoring data is obtained by monitoring the performance of the television application through the target function class or target function method, including: The time point when the first method is executed when the TV application is started is marked as the first starting point of the application startup, and the time point when the window obtains the focus is marked as the first end point of the application startup, and the difference between the first starting point and the first end point is used as the application startup time; Collect TV's maximum memory, remaining memory, CPU usage and other performance data; The performance data and the application startup time are combined and stored to obtain the monitoring data.
4. The performance monitoring method according to claim 2, characterized in that: The target monitoring item is page startup; the monitoring data is obtained by monitoring the performance of the television application through the target function class or target function method, including: Through the Android life cycle callback, the time point when the page is created is marked as the second starting point of the page startup, the time point when the window obtains the focus is marked as the second end point, and the difference between the second starting point and the second end point is used as the page startup time; Collecting page information and call stack information of the page; The page information, the call stack information and the page startup time are combined and stored to obtain the monitoring data.
5. The performance monitoring method according to claim 2, characterized in that: The target monitoring item is fluency monitoring; The step of performing performance monitoring on the television application through the target function class or target function method to obtain monitoring data includes: Insert a target task into the head of the input callback queue of the main thread choreographer in the TV application to monitor the generation time of the next frame; When the drawing task starts, the target task records the start time and start status; When the drawing task is finished, the target task records the end time and end status; Obtain the generation duration through the start time, start status, end time and end status; Re-insert a target task into the head of the input callback queue to continue monitoring the generation duration of subsequent frames; The generation duration corresponding to each frame is used as monitoring data.
6. The performance monitoring method according to claim 2, characterized in that: The target monitoring item is network monitoring; The step of performing performance monitoring on the television application through the target function class or target function method to obtain monitoring data includes: Insert a custom network interceptor into the network framework, and obtain the network request address, uplink and downlink data, response code, and request duration through the network interceptor; The network request address, uplink and downlink data, response code and request duration are combined and stored to obtain monitoring data.
7. The performance monitoring method according to claim 2, characterized in that: The target monitoring item is freeze monitoring; The step of performing performance monitoring on the television application through the target function class or target function method to obtain monitoring data includes: Get the message execution time of the main thread through the Android message mechanism; The message execution time is used as monitoring data.
8. The performance monitoring method according to claim 1, characterized in that: The bytecode instrumentation adopts the ASM bytecode framework.
9. A performance monitoring device for a television application, characterized in that: The device comprises: The configuration item module is used to save all monitoring items of the TV application in the form of a configuration summary table; A bytecode plugging module, used for combining the monitoring items in the configuration master table with the bytecode plugging to obtain a hybrid function class or a hybrid function method and a function set; the function set stores a mapping relationship between the monitoring items and the corresponding hybrid function class or hybrid function method; A sending module, used to select required monitoring items and corresponding hybrid function classes or hybrid function methods and the function set from the configuration master table and send them to the TV application end; A receiving module, used for taking the received monitoring item as a target monitoring item; A monitoring function confirmation module, used to determine the required target function class or target function method according to the target monitoring item and the function set; A data monitoring module, used to perform performance monitoring on the television application through the target function class or target function method to obtain monitoring data; It is also used to sort, filter and aggregate the monitoring data to obtain target monitoring data; An uploading module is used to upload the target monitoring data to the server.
10. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the monitoring method according to any one of claims 1 to 8.
Citation Information
Cited By
Digital television strategy configuration method based on self-adaptive low-end equipment
CN121194007A