Display device and system performance optimization method
By using hook function sets to analyze user behavior in smart TVs, the memory layout of hot functions is identified and optimized, resolving stuttering and latency caused by missing memory access pages, and improving system performance and operating efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2026-03-10
AI Technical Summary
When smart TVs have limited resources, page misses in memory access can cause lag or response delays, affecting system efficiency and performance. Existing optimization methods, such as killing processes and keeping preset system libraries running, have limitations and cannot dynamically adjust resource allocation.
By capturing user operation behavior data through hook function sets, identifying hot scene items, executing function sampling, copying hot functions to contiguous memory and modifying reference addresses, establishing virtual address mapping, preloading hot function sets, and optimizing memory access.
Reduce memory page misses, improve system performance, ensure smooth user operation, resolve operation lag and response latency issues, and improve system operating efficiency.
Smart Images

Figure CN121644899A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of display device technology, and in particular to a method for optimizing the performance of a display device and system. Background Technology
[0002] Display devices such as smart TVs serve as crucial terminals for home entertainment and information access. They not only offer traditional TV program playback but also support a wide range of applications for download and installation via their built-in smart operating systems. For example, display devices can encompass online video playback, gaming, online shopping, and educational applications. This multi-functional integration enriches the user's viewing experience. However, as software features are increasingly added to the system, the pace of hardware performance improvement lags far behind the demands of software functionality. Because the growth rate of software functionalities in smart TVs exceeds the rate of hardware performance improvement, users may encounter issues such as page misses in memory access, inefficient code execution, and response time issues caused by repeated memory reads and writes, thus impacting system efficiency and performance.
[0003] To address the aforementioned issues, optimization can be achieved by either killing processes or maintaining a resident preset system library. Killing processes releases system resources by automatically or manually terminating non-critical processes when system resources are scarce, thus reducing memory usage. Maintaining a resident preset system library involves pre-loading frequently used library files or functional modules into memory during system startup for faster subsequent access. While both methods can alleviate performance issues caused by resource constraints in smart TVs to some extent, they still have limitations. While killing processes can temporarily release resources, frequent process termination may result in the loss of data from applications the user is currently using, affecting the continuity of the user experience. Furthermore, mistakenly killing critical processes may lead to system instability or crashes. While maintaining a resident preset system library can improve the response speed of specific operations, it cannot dynamically adjust according to the user's actual usage habits and needs. For functions that users do not use frequently, a resident library can actually lead to resource waste.
[0004] Furthermore, with limited resources on smart TVs, if the executed code is not in memory, a page fault will be triggered, forcing the CPU to load data from slow storage devices such as disks, severely impacting execution efficiency. Frequent memory read and write operations can also increase system response time, especially during complex operations such as video fast-forwarding. In summary, display devices, when dealing with resource allocation and performance optimization, are prone to stuttering or response delays due to page faults in memory access under limited resource conditions, affecting system efficiency and performance. Summary of the Invention
[0005] Some embodiments of this application provide a method for optimizing the performance of a display device and system, in order to solve problems affecting the operating efficiency and system performance of the display device system.
[0006] In a first aspect, some embodiments of this application provide a display device, including:
[0007] The monitor is configured to display the user interface;
[0008] The controller is configured as follows:
[0009] Hotspot scenario items are determined based on a set of hook functions and user operation behavior data; the set of hook functions is used to capture user interaction events in the operation behavior data; the interaction events include multiple event items; the hotspot scenario items are event items whose cumulative usage time exceeds a threshold duration.
[0010] Sampling is performed on the processes in the aforementioned hotspot scenario projects to obtain function sampling results;
[0011] The hotspot function is determined based on the preset sampling ratio and the sampling results of the function.
[0012] The hot functions are copied to pre-allocated contiguous memory, and the reference addresses of the copied hot functions are modified to merge the hot functions to obtain a set of hot functions;
[0013] Map a preset virtual address to the hotspot function set, and store the hotspot function set through the preset virtual address.
[0014] Secondly, some embodiments of this application provide a system performance optimization method, which can be applied to the display device of the first aspect, the display device including a display and a controller, the method including:
[0015] Hotspot scenario items are determined based on a set of hook functions and user operation behavior data; the set of hook functions is used to capture user interaction events in the operation behavior data; the interaction events include multiple event items; the hotspot scenario items are event items whose cumulative usage time exceeds a threshold duration.
[0016] Sampling is performed on the processes in the aforementioned hotspot scenario projects to obtain function sampling results;
[0017] The hotspot function is determined based on the preset sampling ratio and the sampling results of the function.
[0018] The hot functions are copied to pre-allocated contiguous memory, and the reference addresses of the copied hot functions are modified to merge the hot functions to obtain a set of hot functions;
[0019] Map a preset virtual address to the hotspot function set, and store the hotspot function set through the preset virtual address.
[0020] As can be seen from the above technical solutions, some embodiments of this application provide a method for optimizing the performance of a display device and system. The method includes: determining hot-spot scene items based on a set of hooked functions and user operation behavior data; sampling the processes within the hot-spot scene items to obtain function sampling results; determining hot-spot functions based on a preset sampling ratio and the function sampling results; copying the hot-spot functions to pre-allocated contiguous memory and modifying the reference addresses of the copied hot-spot functions to merge them into a hot-spot function set; and mapping a preset virtual address to the hot-spot function set. This method can identify hot-spot scene items based on user interaction statistical analysis, identify hot-spot functions and hot-spot access files, ensure the smoothness of user operations by merging hot-spot functions and preloading hot-spot access files, reduce page misses in memory access, improve system performance, and solve the problem of operation lag or response delay caused by page misses in memory access, thereby improving system operating efficiency and system performance. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in some embodiments of this application or in the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a schematic diagram illustrating an operational scenario between a display device and a control device provided in some embodiments of this application;
[0023] Figure 2 This is a schematic diagram of the hardware configuration of a display device provided in some embodiments of this application;
[0024] Figure 3 This is a schematic diagram of the software configuration of a display device provided in some embodiments of this application;
[0025] Figure 4 A flowchart illustrating a system performance optimization method for a display device provided in some embodiments of this application;
[0026] Figure 5 A timing diagram illustrating the system performance optimization method performed by a display device according to some embodiments of this application;
[0027] Figure 6 A schematic diagram of the architecture of a display device performing a system performance optimization method provided in some embodiments of this application;
[0028] Figure 7 A schematic diagram illustrating a scenario where a display device performs a system performance optimization method according to some embodiments of this application;
[0029] Figure 8 A schematic diagram illustrating the process of determining a hotspot function based on a preset sampling ratio and function sampling results in a display device provided in some embodiments of this application;
[0030] Figure 9 A flowchart illustrating the offset information and hotspot function set for centralized management of hotspot functions in display devices, provided in some embodiments of this application;
[0031] Figure 10 A schematic diagram illustrating the process of adding markers to a foreground application using a display device provided in some embodiments of this application;
[0032] Figure 11 This is a schematic diagram illustrating the process of preloading files for a display device provided in some embodiments of this application. Detailed Implementation
[0033] The embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described below do not represent all embodiments consistent with this application. They are merely examples of systems and methods consistent with some aspects of this application as detailed in the claims.
[0034] It should be noted that the brief descriptions of terms in this application are only for the convenience of understanding the embodiments described below, and are not intended to limit the embodiments of this application. Unless otherwise stated, these terms should be understood in their ordinary and common meaning.
[0035] The terms “comprising” and “having”, and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device that includes a range of components is not necessarily limited to all of the components that are clearly listed, but may include other components that are not clearly listed or that are inherent to such product or device.
[0036] The term "module" refers to any known or subsequently developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and / or software code that is capable of performing the functions associated with that element.
[0037] In this embodiment, the display device 200 generally refers to a device with screen display and data processing capabilities. For example, the display device 200 includes, but is not limited to, smart TVs, mobile terminals, computers, monitors, advertising screens, wearable devices, virtual reality devices, augmented reality devices, etc.
[0038] Figure 1 This is a schematic diagram illustrating an operational scenario between a display device and a control device provided in some embodiments of this application. For example... Figure 1 As shown, a user can operate the display device 200 via touch operation, a mobile terminal 300, and a control device 100. The control device 100 receives user input commands and converts them into control commands that the display device 200 can recognize and respond to. For example, the control device 100 can be a remote control, a stylus, a gamepad, etc.
[0039] The mobile terminal 300 can function as a control device for human-computer interaction between the user and the display device 200. It can also function as a communication device for establishing a communication connection with the display device 200 and exchanging data. In some embodiments, the mobile terminal 300 can have software applications installed on it and communicate with the display device 200 via network communication protocols to achieve one-to-one control and data communication. Furthermore, it can transmit audio and video content displayed on the mobile terminal 300 to the display device 200 for synchronized display.
[0040] In some embodiments, the mobile terminal 300 or other electronic devices may also simulate the functions of the control device 100 by running an application that controls the display device 200.
[0041] like Figure 1 The diagram also shows that the display device 200 communicates with the server 400 via various communication methods. This allows the display device 200 to communicate via a local area network (LAN), a wireless local area network (WLAN), and other networks.
[0042] Display device 200 can provide broadcast television reception function, and can also be equipped with intelligent network television function that provides computer support, including but not limited to network television, smart television, Internet Protocol television (IPTV), etc.
[0043] Figure 2 Provided for some embodiments of this application Figure 1 Hardware configuration block diagram of display device 200.
[0044] In some embodiments, the display device 200 may include at least one of a tuner 210, a communication device 220, a detector 230, a device interface 240, a controller 250, a display 260, an audio output device 270, a memory, a power supply, and a user input interface 280.
[0045] In some embodiments, detector 230 is used to acquire signals from the external environment or to interact with the outside world. For example, detector 230 includes a light receiver, a sensor for acquiring ambient light intensity; or, detector 230 includes an image acquisition device, such as a camera, which can be used to acquire external environmental scenes, user attributes, or user interaction gestures; or, detector 230 includes a sound acquisition device, such as a microphone, for receiving external sounds.
[0046] In some embodiments, the display 260 includes display function components for presenting images and driving components for driving image display. The display 260 is used to receive and display image signals output from the controller 250. For example, the display 260 can be used to display video content, image content, menu control interface components, and user control UI interfaces, etc.
[0047] In some embodiments, the communication device 220 is a component used to communicate with external devices or the server 400 according to various communication protocol types. The display device 200 may have multiple communication devices 220 depending on the supported communication methods. For example, when the display device 200 supports wireless network communication, it may have a communication device 220 with WiFi functionality. When the display device 200 supports Bluetooth connectivity, it needs to have a communication device 220 with Bluetooth functionality.
[0048] The communication device 220 enables the display device 200 to communicate with external devices or the server 400 via wireless or wired connections. Wired connections utilize data cables, interfaces, or other components to connect the display device 200 to external devices. Wireless connections utilize wireless signals or wireless networks. The display device 200 can directly establish a connection with external devices or indirectly through gateways, routers, or other connection devices.
[0049] In some embodiments, the controller 250 may include at least one of a central processing unit, a video processor, an audio processor, a graphics processor, and a power processor, and a first to an nth interface for input / output. The controller 250 controls the operation of the display device and responds to user operations through various software control programs stored in memory. The controller 250 controls the overall operation of the display device 200.
[0050] In some embodiments, the controller 250 and the tuner 210 may be located in different separate devices, that is, the tuner 210 may also be located in an external device of the main device where the controller 250 is located, such as an external set-top box.
[0051] In some embodiments, a user can input user commands through a graphical user interface (GUI) displayed on a display 260, and the user input interface receives user input commands through the graphical user interface (GUI).
[0052] In some embodiments, the audio output device 270 can be a built-in speaker of the display device 200 or an external audio output device connected to the display device 200. For the external audio output device connected to the display device 200, the display device 200 may also be provided with an external audio output terminal, through which the audio output device can be connected to the display device 200 to output sound from the display device 200.
[0053] In some embodiments, the user input interface 280 can be used to receive instructions from user input.
[0054] To enable user interaction, in some embodiments, the display device 200 may run an operating system. The operating system is a computer program used to manage and control the hardware and software resources of the display device 200. The operating system can control the display device to provide a user interface; for example, the operating system can directly control the display device to provide a user interface, or it can provide a user interface by running an application. The operating system also allows users to interact with the display device 200.
[0055] It should be noted that the operating system can be a native operating system based on a specific operating platform, a third-party operating system that is deeply customized based on a specific operating platform, or an independent operating system specifically developed for display devices.
[0056] An operating system can be divided into different modules or levels based on the functions it implements, for example... Figure 3 As shown, in some embodiments, the system is divided into four layers, from top to bottom: the Applications layer (referred to as the "Application Layer"), the Application Framework layer (referred to as the "Framework Layer"), the System Library layer, and the Kernel layer.
[0057] In some embodiments, the application layer provides services and interfaces for applications, enabling the display device 200 to run applications and interact with the user based on the applications. The application layer may contain at least one application, which may be a built-in Windows program, system settings program, or clock program of the operating system; or it may be an application developed by a third-party developer. In specific implementations, the application packages in the application layer are not limited to the examples above.
[0058] The framework layer provides application programming interfaces (APIs) and a programming framework for applications. The application framework layer includes predefined functions. It acts as a central processing unit, determining the actions taken by applications within the application layer. Through the API, applications can access system resources and obtain system services during execution.
[0059] like Figure 3 As shown, the application framework layer in this embodiment includes a view system, managers, and content providers. The view system designs and implements the application's interface and interactions, and includes lists, grids, text boxes, and buttons. The managers include at least one of the following modules: an activity manager for interacting with all running activities in the system; a location manager for providing system services or applications with access to system location services; a package manager for retrieving various information related to application packages currently installed on the device; a notification manager for controlling the display and clearing of notification messages; and a window manager for managing icons, windows, toolbars, wallpapers, and desktop widgets on the user interface.
[0060] In some embodiments, the Activity Manager manages the lifecycle of individual applications and common navigation and back functions, such as controlling application exit, opening, and back actions. The Window Manager manages all window programs, such as obtaining the screen size, determining if a status bar is present, locking the screen, capturing the screen, and controlling changes to the display window, such as shrinking the display window, shaking the display, or distorting the display.
[0061] In some embodiments, the system runtime library layer can provide support for the framework layer. When the framework layer is used, the operating system runs the instruction library contained in the system runtime library layer, such as the C / C++ instruction library, to implement the functions to be performed by the framework layer.
[0062] In some embodiments, the kernel layer is a functional layer situated between the hardware and software of the display device 200. The kernel layer can implement functions such as hardware abstraction, multitasking, and memory management. For example, ... Figure 3As shown, hardware drivers can be configured in the kernel layer. The drivers included in the kernel layer can be at least one of the following: audio driver, display driver, Bluetooth driver, camera driver, WIFI driver, USB driver, HDMI driver, sensor driver (such as fingerprint sensor, temperature sensor, pressure sensor, etc.), and power driver, etc.
[0063] It should be noted that the above examples are merely a simple division of operating system functions and do not limit the specific form of the operating system of the display device 200 in this application embodiment. Depending on the function of the display device, the type of operating system, and other factors, the number of levels and the specific level type of the operating system may be expressed in other forms.
[0064] Display device 200 is a smart device capable of presenting a user interface and supporting user interaction. Taking a smart TV as an example, a smart TV is a display device based on Internet application technology, possessing an open operating system and chip, an open application platform, and enabling two-way human-computer interaction. A smart TV can integrate multiple functions such as audio-visual entertainment and data to meet diverse and personalized user needs. For example, users can watch various movies, TV series, variety shows, etc., through a smart TV.
[0065] Display devices 200, such as smart TVs, serve as important terminals for home entertainment and information access. They not only possess traditional TV program playback capabilities but also support a wide range of application downloads and installations through built-in smart operating systems like Android. These applications can cover multiple areas, including online video playback, gaming, online shopping, and education. This multi-functional integration enriches the user's viewing experience but also places higher demands on the hardware and software performance of smart TVs. Especially when users frequently switch between applications or perform complex operations, such as fast-forwarding, pausing, and switching between online videos, the smart TV's system resource allocation and response speed will impact the user experience.
[0066] For example, as the system gradually adds software features, the improvement rate of hardware performance lags far behind the functional requirements of the software. Because the growth rate of software functional requirements in smart TVs exceeds the improvement rate of hardware performance, users may encounter problems such as page misses in memory access, inefficient code execution, and response time issues caused by multiple memory reads and writes. This, in turn, affects system operating efficiency and performance. In other words, it can lead to operational lag or response delays when users are using smart TVs due to insufficient system resources.
[0067] In some embodiments, to address the aforementioned issues, optimization can be achieved by either killing processes or maintaining pre-defined system libraries. Killing processes releases system resources by automatically or manually terminating non-critical processes when system resources are scarce, thereby reducing memory usage. Maintaining pre-defined system libraries involves pre-loading frequently used library files or functional modules into memory during system startup for rapid subsequent access.
[0068] While the two methods mentioned above can alleviate performance issues caused by resource constraints in smart TVs to some extent, they still have limitations. Although process-killing strategies can temporarily free up resources, frequent process termination may lead to the loss of data in applications the user is currently using, affecting the continuity of the user experience. Furthermore, mistakenly killing critical processes may cause system instability or crashes. While resident preset system libraries can improve the response speed of specific operations, they cannot be dynamically adjusted according to the user's actual usage habits and needs. For functions that users do not use frequently, resident libraries can easily lead to resource waste. In addition, when smart TV resources are limited, if the executing code is not in memory, it will trigger a page fault, causing the CPU to load data from slow storage devices such as disks, severely impacting execution efficiency. Frequent memory read and write operations can also increase system response time, especially when performing complex operations such as video fast-forwarding.
[0069] In summary, when dealing with resource allocation and performance optimization, the display device 200, under limited resource conditions, may experience issues such as page misses when accessing memory pages, leading to operational lag or response delays, which affect system operating efficiency and system performance.
[0070] To address issues affecting the system operating efficiency and performance of the display device 200, certain embodiments of this application provide a display device 200, comprising a display 260 and a controller 250. The display 260 is configured to display a user interface, and the controller 250, by running an application, enables the display device 200 to execute system performance optimization methods. The display device 200 can analyze hotspot scenarios based on user interaction statistics, identify hotspot functions and hotspot access files, and ensure smooth user operation by merging hotspot functions and preloading hotspot access files. This reduces page misses in memory access, improves system performance, and resolves issues such as operation lag or response delays caused by page misses in memory access, thereby enhancing system operating efficiency and performance.
[0071] To facilitate understanding of the technical solutions in some embodiments of this application, the steps are described in detail below with reference to some specific embodiments and accompanying drawings. Figure 4This is a flowchart illustrating a system performance optimization method for a display device provided in some embodiments of this application, such as... Figure 4 As shown, in some embodiments, when the display device 200 performs the system performance optimization method, it may include the following steps S1-S5, the specific contents of which are as follows:
[0072] Step S1: Display device 200 determines hot spot scene items based on hook function set and user operation behavior data.
[0073] Figure 5 This is a timing diagram illustrating the system performance optimization method performed by a display device according to some embodiments of this application. Figure 6 This is a schematic diagram of the architecture of a display device performing a system performance optimization method according to some embodiments of this application, combined with Figure 5 and Figure 6 In some embodiments, the display device 200 may include a statistics module. When a user accesses the television system, the statistics module can generate operation behavior data based on the user's actions. For example, the statistics module can collect statistics on system events, which may include, but are not limited to, button events, voice wake-up events, playback status events, and application switching events. Specifically, button events record the number or type of buttons pressed by the user; voice wake-up events detect and record user actions via voice commands; playback status events track changes in video or audio playback progress, pause, fast forward, etc.; and application switching events record the frequency and pattern of user switching between different applications. By collecting statistics on these system events, the display device 200 can generate user operation behavior data, providing a data foundation for identifying hotspot scenarios.
[0074] To identify hotspot scene items, in some embodiments, the display device 200 may set a set of hook functions, capture user interaction events in operation behavior data using the hook function set, parse the interaction events at preset intervals, calculate the cumulative usage time of multiple event items based on the parsing results, and then determine the hotspot scene items among the event items based on the cumulative usage time and a threshold duration. Specifically, the hook function set is used to capture user interaction events in operation behavior data, and the interaction events include multiple event items; hotspot scene items are event items whose cumulative usage time exceeds the threshold duration.
[0075] For example, Figure 7 This is a schematic diagram illustrating a scenario where a display device performs a system performance optimization method according to some embodiments of this application, such as... Figure 7As shown, in some embodiments, the standard framework of a television system may include core functional modules such as application management, event handling, power management, window management, and connection management. These modules together constitute the basic architecture of the Android operating system, providing necessary support and services for upper-layer applications.
[0076] In order to accurately perform statistical analysis on user hotspot scenarios, this application inserts a set of hook functions into the standard Android framework. In some embodiments, the set of hook functions can be standard system hook points. The settings of system hook points are not limited to basic event capture, but can also cover all levels of user interaction, from basic button operations to complex voice commands, to real-time status monitoring of video players and subtle changes in the network environment.
[0077] See also Figure 7 The system's hook points can capture interactive events such as key presses, application launches, power on / off events, player status monitoring, network change detection, and voice wake-up. For key presses, by monitoring these events, the system can accurately record every key pressed by the user while operating the smart TV, including but not limited to channel switching, volume adjustment, and menu navigation. This helps analyze user operating habits and frequently used functions. When a key press occurs, the system can automatically capture and record relevant information, such as key type and press duration. For application launches, by monitoring application launch and switching behavior, the system can understand which applications users tend to use during which time periods, thereby optimizing the launch speed and operating efficiency of these applications. For power on / off events, by monitoring the TV's power on and off events, the system can analyze user viewing time and usage patterns, providing a basis for optimizing power on / off speed and processes. For player status monitoring events, the system can monitor the video player's status in real time (such as playing, paused, stopped, etc.), understanding the user's specific behavior while watching videos, in order to optimize the video playback experience. For network change detection events, changes in network status (such as switching from Wi-Fi to mobile data) can be monitored to adjust video playback quality or application behavior in a timely manner, ensuring a good user experience even in poor network conditions. For voice wake-up events, user voice commands can be captured to understand user preferences and usage frequency for voice interaction, thereby optimizing the performance of voice recognition and voice interaction.
[0078] See also Figure 7In some embodiments, the display device 200 may include a scene statistics and analysis module. After capturing key events, application launch events, power on / off events, player status monitoring events, network change detection events, and voice wake-up events through system hook points, the captured events can be transmitted to the scene statistics and analysis module. The scene statistics and analysis module can analyze user and device interaction behaviors based on the captured events, such as key operations, voice wake-up, voice command input, application launch, media playback, and gaming activities. By monitoring and analyzing these interaction behaviors, information such as user behavior patterns, preferences, and device performance can be understood, thereby optimizing the user experience or making relevant decisions. In other words, by setting hook function sets such as system hook points, the display device 200 can comprehensively capture various user operations on the smart TV, and then perform precise statistical analysis on hot-spot scene items.
[0079] To ensure the timeliness and accuracy of data related to monitored interactive events, in some embodiments, the display device 200 can set a preset interval for capturing interactive events and a threshold duration for judging hot-spot scenarios. For example, the preset interval can be set to 10 minutes and the threshold duration can be set to 1 hour. Then, the display device 200 can perform data analysis on interactive events every 10 minutes to identify time periods and applications where users spend more than 1 hour per day, as well as related event items, thereby defining event items with a cumulative usage time of more than 1 hour as hot-spot scenarios.
[0080] For example, taking a smart TV as the display device, during the use of a smart TV, users can interact with the TV through different interaction methods such as button operation and voice control. These interactions will lead to frequent switching of the TV's usage state. In order to deeply understand the user's usage habits and needs, the display device 200 can statistically analyze the user's operation behavior data. For example, the TV system can record in detail every button press, voice command, and the events triggered by it, such as application launch, video playback, and game entertainment, to identify the most frequently used applications and interaction methods, such as video playback and application launch. For ease of description, the most frequently used applications and interactive operations such as button operation and voice command can be called hotspot scene items. In this way, by capturing the user's hotspot scene items, such as button operation and voice command, the user's habits and preferences can be analyzed to obtain hotspot scene items, providing strong data support for subsequent system optimization, enabling the system to accurately improve performance and optimize experience according to the user's actual needs. After step S1 is completed, step S2 can be included.
[0081] Step S2: Display device 200 performs sampling on processes in the hot spot scene project to obtain function sampling results.
[0082] As can be seen from step S1, user behavior patterns often exhibit certain regularity and repetition. These regularities and repetitions constitute the hot-spot scenarios that users frequently use. In order to optimize the system performance of hot-spot scenarios, sampling tools can be used to sample the hot-spot scenarios and obtain function sampling results to deeply analyze the system execution details behind user behavior.
[0083] In some embodiments, when the display device 200 performs sampling on the process in the hot spot scene project, it can first obtain the function instructions corresponding to the hot spot scene project, and then use the simpleperf tool to sample the process of the function instructions to obtain the function sampling result.
[0084] For example, instruction-level sampling can be performed using simpleperf. simpleperf allows the collection of various information about a program's execution without interrupting program execution, including function calls, instruction execution counts, etc. For instance, the command `simpleperfcord -p $pids` can be used to perform instruction-level sampling of function instructions, thus capturing detailed instruction information during execution and obtaining the function sampling results. After step S2 is completed, step S3 can be included.
[0085] Step S3: The display device 200 determines the hotspot function based on the preset sampling ratio and the function sampling results.
[0086] Figure 8 This application provides a flowchart illustrating the process of a display device determining a hotspot function based on a preset sampling ratio and function sampling results, as shown in some embodiments. Figure 8 As shown, when determining hotspot functions, the display device 200 first obtains the total number of sampling points corresponding to the operation behavior data, parses the function sampling results, and calculates the execution count of the function instruction. Then, based on the execution count, it determines the instruction sampling point count of the function instruction, sets a preset sampling ratio, determines the actual sampling ratio of the function instruction based on the instruction sampling point count and the total sampling point count, and marks function instructions whose actual sampling ratio exceeds the preset sampling ratio as hotspot functions.
[0087] For example, after obtaining the function sampling results, Simpleperf can generate a file containing the sampled data. By analyzing this file, the execution count of each function instruction can be counted. By sorting, it can be determined which function instructions dominate in hotspot scenarios, i.e., which functions are frequently called. To identify hotspot functions, a preset sampling ratio can be set, for example, 50%. When the sampling points of a certain function instruction exceed 50% of the total sampling points, that function instruction is considered a hotspot function. In this way, the function instructions that have the greatest impact on system performance can be accurately identified, providing a clear target for subsequent optimization work. After step S3 is completed, step S4 can be executed.
[0088] Step S4: The display device 200 copies the hotspot functions to pre-allocated contiguous memory and modifies the reference addresses of the copied hotspot functions to merge the hotspot functions and obtain a set of hotspot functions.
[0089] Since hot-button functions may be distributed across different files, and each function call has a unique virtual address, in some embodiments, to reduce memory fragmentation, memory access latency, and page misses, the display device 200 can copy the hot-button functions from their original files and store them in pre-allocated contiguous memory space. This reduces the page miss rate because hot-button functions stored together are more likely to be hit by the cache system. However, simply copying hot-button functions to contiguous memory is insufficient to guarantee performance improvement. Because there may be complex call relationships between functions, to ensure these relationships are correctly maintained during the copying process, all reference addresses within the hot-button functions can be modified to ensure they correctly point to the new memory locations. Modifying the reference addresses of the copied hot-button functions allows for merging them into a hot-button function set. Organizing all copied and modified hot-button functions into a single set facilitates subsequent management and access. Thus, by copying hot-button functions to contiguous memory, memory fragmentation can be reduced, and memory utilization improved. A contiguous memory layout facilitates CPU cache utilization, reduces memory access latency and page misses, improves program execution efficiency, and thus solves problems affecting the operating efficiency and system performance of display devices.
[0090] To improve the loading speed of hotspot functions and reduce program startup delays, the display device 200 can centrally manage the offset information of hotspot functions and the hotspot function set. Figure 9 The flowchart illustrates the offset information and hotspot function set for centralized management of hotspot functions in display devices, as provided in some embodiments of this application. Figure 9As shown, in some embodiments, after modifying the reference address of the copied hotspot function, the display device 200 can first obtain the original file where the hotspot function was located before copying, and its original position in the original file; obtain the target file where the hotspot function is located after copying, and its target position in the target file; then, calculate the offset information of the hotspot function based on the original position and the target position; and then write the offset information and the set of hotspot functions into a system file of a contiguous block, wherein the system file has a pre-read function to preload the hotspot function through the system file.
[0091] For example, code analysis tools such as static analysis tools and performance analyzers can be used to identify hot functions in a program, i.e., functions that are executed frequently and consume a lot of resources. Next, source file location is performed, i.e., determining the source code file where each hot function is located. This can be achieved, for example, by viewing compiler output information, source code management system logs, or using dedicated source code browsing tools. The start and end line numbers of each hot function in the source file can be recorded, or more precisely, its byte offset can be recorded. The recorded content can be determined according to actual needs, to help accurately locate the function's original position in the source file later. After determining the original position, the target file and target location of the hot function after copying can be obtained. For example, it can be determined which new file (such as a library file, optimized executable file, etc.) the copied hot function is placed in. Then, the starting address or offset of the hot function in the new file is recorded, and then the offset of the hot function in the new file is calculated based on the information of the original and target positions. For example, the offset can be a byte offset relative to the beginning of the file, or an offset relative to a base address such as a segment base address. The calculated offsets can be stored in an appropriate form (such as a structure, database record, etc.) so that they can be used to quickly locate, load, and preload hot functions.
[0092] After obtaining the offset information, the display device 200 can write the offset information and the hot function set to a contiguous system file. This system file can be a contiguous storage file to reduce disk I / O overhead. When writing to the system file, efficient serialization formats such as Protocol Buffers and Flat Buffers can be used to save space and improve read / write efficiency. In this way, the system file prefetching function ensures that the storage medium and file system where the system file resides support prefetching. By properly configuring the operating system's prefetching strategy, hot functions can be automatically loaded into memory before program execution, thereby reducing loading time and improving program startup speed. Therefore, the prefetching function can significantly improve the loading speed of hot functions, reduce program startup latency, and enhance the user experience. Simultaneously, centralized management of offset information and the hot function set facilitates subsequent maintenance and upgrades.
[0093] To ensure the integrity and traceability of hotspot function-related data, in some embodiments, the display device 200 can write the hotspot function set into a contiguous block file. This way, all hotspot functions are stored in a contiguous memory space, rather than scattered across multiple locations. Since writing to a contiguous block file eliminates the need to jump to different locations in memory, data can be read and written faster. Firstly, writing the hotspot function set to a file offers several advantages. Firstly, because the data is physically adjacent when written to contiguous blocks, the risk of data loss or corruption due to file fragmentation is reduced. Contiguous storage reduces disk seek time, improves data read and write speeds, and thus reduces the risk of data integrity issues caused by errors during the read / write process. Secondly, while writing the hotspot function set to the file, characteristic information for each function, such as access frequency and execution time, can be recorded. This information aids in subsequent performance analysis and optimization. By recording the data's write timestamp and version number, the change history of the dataset can be traced, facilitating tracking and rollback to a specific data state. Therefore, writing the hotspot function set into a contiguous block file ensures the integrity and traceability of hotspot function-related data. After step S4 is completed, step S5 may be included.
[0094] Step S5: The display device 200 maps a preset virtual address to a hotspot function set, and stores the hotspot function set through the preset virtual address.
[0095] In order to improve the operating efficiency of software or system, in some embodiments, the display device 200 can map a preset virtual address to a hotspot function set, and store the hotspot function set through the preset virtual address.
[0096] For example, after merging hot functions into a hot function set, the display device 200 can allocate a preset virtual address space for the hot function set and establish a mapping relationship from this virtual address to the actual physical memory, that is, mapping the hot function set to a preset virtual address. In this way, when the program needs to execute these functions, it can directly access them quickly through this virtual address. That is, through virtual address mapping, access to the hot function set becomes more efficient, improving the program's response speed and running efficiency. Furthermore, the display device 200 can quickly locate the function code in the hot function set by accessing the virtual address, thereby reducing the latency caused by memory addressing.
[0097] To accurately identify which file pages are frequently accessed by users and optimize file read / write performance, in some embodiments, after determining the hot-spot scene items based on the hook function set and user operation behavior data, the display device 200 can count the file pages accessed in the operation behavior data, and determine the hot-spot access files of the hot-spot scene items based on the preset file access ratio and file pages. Then, it can record the unique identifier, file path, and file block information of the hot-spot access files to establish a mapping relationship between the hot-spot access files and memory access pages, and then save the unique identifier, file path, and file block information in the hot-spot access files.
[0098] For example, the `filemap_fault` function or the `ext4_submit_bio_read` function can be used to obtain the memory access pages for file read / write operations and record the mapping relationship between the file's inode, file path, and file blocks. This allows a fixed amount of kernel memory to be allocated in advance when the system is idle, loading hot memory blocks into memory. When a page fault occurs again, the `filemap_fault` function is called, and the already loaded hot access files are made available to the current process using the recorded mapping relationship between the file inode, file path, and file blocks. This optimizes file read / write performance; by preloading hot access files and locking memory access pages, disk I / O operations can be reduced, improving system responsiveness.
[0099] To avoid unnecessary background process interference and make resource allocation more efficient, the display device 200 can add tags and execution filters for foreground applications. Figure 10 This application provides schematic diagrams illustrating the process of adding markers to a foreground application using a display device according to some embodiments, such as... Figure 10 As shown, in some embodiments, after determining the hot access files of hot scene items based on the preset file access ratio and file pages, the display device 200 can add read / write markers to the foreground processes in the hot access files, generate read / write files based on the read / write markers, and then record the memory access pages involved in the read / write files according to a preset function.
[0100] For example, by explicitly marking foreground applications, they can serve as filters for statistics and analysis, ensuring that the TV system only focuses on applications that the user is currently using or interacting with, avoiding unnecessary background process interference, and making resource allocation more efficient.
[0101] To improve the efficiency of file reading and writing operations, after generating the file reading and writing steps based on the read and write tags, the display device 200 can record the active file reading interface and passive file mapping interface started by the foreground process. Then, it can locate the memory access page of the file to be read and written through the active file reading interface and passive file mapping interface, and preload the memory access page according to the mapping relationship to obtain the preloaded access page. In response to the memory access page missing event, the preloaded access page is loaded.
[0102] For example, Figure 11 This is a schematic diagram of the process for preloading files for a display device provided in some embodiments of this application, such as... Figure 11 As shown, for projects targeting hotspot scenarios, after adding read / write markers, the display device 200 can monitor and record the foreground process's active file read operations and passive file mapping operations at startup. For example, by tracing the functions `filemap_fault` and `exit_submit_bio_read`, the display device 200 can accurately monitor and manage memory access pages, thereby optimizing file read / write operations. In this way, the display device 200 can capture all relevant file access activities, whether it's a process actively requesting data or passive file mapping via system calls. Through the recorded interface information, the display device 200 can accurately locate the memory access page where the file data actually read and written by the foreground process resides, helping to precisely track which memory access pages are accessed, thus providing a foundation for further optimization.
[0103] After location is complete, the display device 200 can preload memory access pages according to the mapping relationship. Specifically, using the known file-to-memory mapping relationship, the display device 200 can preload these memory access pages to generate preloaded access pages. The purpose of preloading is to load potentially requested data into memory in advance, thereby reducing page faults and improving response speed. For example, the display device 200 can pre-allocate a fixed kernel space as prefetch memory to prevent conflicts when multiple processes simultaneously perform read and write operations on the same file. By pre-allocating a fixed memory area as prefetch memory, it can be ensured that each process has its own independent space to store the data it needs. Afterwards, the relationship between the file being read / written and the memory access pages can be recorded to facilitate subsequent page locking operations. For example, the mapping relationship between file inodes, file paths, and file blocks can be recorded. Thus, when a memory access page miss event occurs, i.e., when the page requested by the process is not in physical memory, the display device 200 can quickly load the required data from the preloaded access pages to reduce latency caused by page misses and improve overall file access performance.
[0104] As can be seen, by recording key file access interface information, the display device 200 can accurately locate and manage memory access pages, preload potentially requested data, and quickly respond to memory access page missing events when necessary. This optimizes the performance of file read and write operations, enabling foreground processes to perform file operations more efficiently, reducing I / O wait time, and improving user experience and system performance.
[0105] To prevent memory access pages from being swapped to disk or compressed by the operating system's swap mechanism when memory resources are scarce, after the step of preloading memory access pages according to the mapping relationship, the display device 200 can obtain the memory address and memory length of the memory access page, and use the mlock function to lock the memory address and memory length.
[0106] For example, by obtaining the memory address and length of the memory access page, the display device 200 can accurately locate the required data location and ensure that this data is read and processed correctly. Using the `mlock` function to lock the memory address and length prevents the operating system from swapping this memory out. By locking the memory, it is ensured that the memory access page resides in memory, thus ensuring that the display device 200 can always access the required data, maintaining accessibility even under conditions of low system resources, without being interfered with by other processes or operating system operations. This ensures data continuity and stability, thereby providing a high-quality display effect.
[0107] In some embodiments, when locking memory access pages, the display device 200 can use the `lock_page` function. This allows the display device 200 to call this function to lock the page when a process needs to modify data on that page, preventing other processes from accessing it until the page is unlocked. Locking memory access pages for hot-spot scenarios to prevent swapping out can prevent page swapping under high load. When system resources are scarce, some pages may be swapped out to disk to free up memory space. By locking memory access pages, the display device 200 can prevent this from happening, thus ensuring that memory access pages are not swapped out.
[0108] Continue to combine Figure 6As described above, in this embodiment, in addition to sampling and merging hotspot functions for processes in hotspot scene projects, the display device 200 also preloads and caches memory access pages in hotspot scene projects. By tracking and analyzing the missing memory access pages during file read / write operations, the system can accurately identify which file pages are frequently accessed. During system idle periods, the system preloads these memory access pages into memory and establishes corresponding mapping relationships. When the program accesses these file pages again, the system can directly read data from memory, avoiding latency in disk I / O operations. Simultaneously, to prevent memory access pages from being swapped to disk or compressed by the system's swap mechanism when memory is scarce, the system also locks the memory access pages to ensure they remain resident in memory, providing users with a smoother operating experience.
[0109] It should be noted that in this embodiment, both hotspot functions and memory access page references are triggered by page fault events such as `filemap_fault`. In the case of hotspot functions, loading is performed using file offsets as mapping addresses; while in the case of memory access pages, the pre-loaded memory access pages are located and loaded through the mapping relationship between file inodes, file paths, and file blocks. The core purpose of both is to reduce latency caused by page faults and improve system performance. By pre-loading and locking critical data, the response speed and operational smoothness of smart TVs in user hotspot scenarios can be improved.
[0110] As can be seen from the above technical solutions, the above embodiments provide a display device 200. The display device 200 can determine hot spot scene items based on the hook function set and user operation behavior data, sample the processes in the hot spot scene items to obtain function sampling results, determine hot spot functions based on a preset sampling ratio and function sampling results, copy the hot spot functions to pre-allocated contiguous memory, and modify the reference addresses of the copied hot spot functions to merge the hot spot functions to obtain a hot spot function set, map a preset virtual address to the hot spot function set, and store the hot spot function set through the preset virtual address. The display device 200 can statistically analyze hot spot scene items based on user interaction, identify hot spot functions and hot spot access files, ensure the smoothness of user operation by merging hot spot functions and preloading hot spot access files, reduce page misses in memory access, improve system performance, solve the problem of operation lag or response delay caused by page misses in memory access, and improve system operating efficiency and system performance.
[0111] Based on the display device 200 described above, some embodiments of this application also provide a system performance optimization method, which can be applied to the display device 200 in the above embodiments. In some embodiments, the method may include the following:
[0112] Hotspot scenario items are determined based on a set of hook functions and user operation behavior data; the set of hook functions is used to capture user interaction events in the operation behavior data; the interaction events include multiple event items; the hotspot scenario items are event items whose cumulative usage time exceeds a threshold duration.
[0113] Sampling is performed on the processes in the aforementioned hotspot scenario projects to obtain function sampling results;
[0114] The hotspot function is determined based on the preset sampling ratio and the sampling results of the function.
[0115] The hot functions are copied to pre-allocated contiguous memory, and the reference addresses of the copied hot functions are modified to merge the hot functions to obtain a set of hot functions;
[0116] Map a preset virtual address to the hotspot function set, and store the hotspot function set through the preset virtual address.
[0117] As can be seen from the above technical solutions, the above embodiments provide a system performance optimization method. The method can identify hot scene items based on user interaction statistical analysis, identify hot functions and hot access files, ensure the smoothness of user operation by merging hot functions and preloading hot access files, reduce page missing phenomenon in memory access, improve system performance, solve the problem of operation lag or response delay caused by page missing in memory access, and improve system operating efficiency and system performance.
[0118] The same or similar parts among the various embodiments in this specification can be referred to mutually, and will not be repeated here.
[0119] Those skilled in the art will clearly understand that the techniques in the embodiments of the present invention can be implemented using software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solutions in the embodiments of the present invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or certain parts of the embodiments of the present invention.
[0120] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
[0121] For ease of explanation, the above description has been provided in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or to limit the embodiments to the specific forms disclosed above. Various modifications and variations can be obtained based on the above teachings. The selection and description of the above embodiments are for the purpose of better explaining the principles and practical applications, thereby enabling those skilled in the art to better utilize the described embodiments and various different variations of embodiments suitable for specific use considerations.
Claims
1. A display device, characterized by comprising: The application comprises: a display configured to display a user interface; a controller configured to: determine a hot scene item according to a hook function set and operation behavior data of a user; the hook function set is used to capture an interactive event of the user in the operation behavior data; the interactive event comprises a plurality of event items; the hot scene item is an event item with a cumulative use duration exceeding a threshold duration; perform sampling on a process in the hot scene item to obtain a function sampling result; determine a hot function according to a preset sampling ratio and the function sampling result; copy the hot function to a pre-applied continuous memory, modify a reference address of the copied hot function, and merge the hot function to obtain a hot function set; map a preset virtual address to the hot function set, and store the hot function set through the preset virtual address.
2. The display device of claim 1, wherein, The controller performing the step of determining a hot scene item according to a hook function set and operation behavior data of a user is specifically configured to: set a hook function set, and capture an interactive event of the user in the operation behavior data through the hook function set; resolve the interactive event at a preset interval duration; calculate a cumulative use duration of a plurality of event items according to a resolution result of the interactive event; determine a hot scene item in the event items according to the cumulative use duration and the threshold duration.
3. The display device of claim 1, wherein, The controller performing the step of performing sampling on a process in the hot scene item to obtain a function sampling result is specifically configured to: obtain a function instruction corresponding to the hot scene item; perform sampling on a process of the function instruction through a simpleperf tool to obtain a function sampling result.
4. The display device of claim 3, wherein, The controller performing the step of determining a hot function according to a preset sampling ratio and the function sampling result is specifically configured to: obtain a total sampling point number corresponding to the operation behavior data; resolve the function sampling result to calculate an execution number corresponding to the function instruction; determine an instruction sampling point number of the function instruction according to the execution number; determine an actual sampling ratio of the function instruction according to the instruction sampling point number and the total sampling point number; mark a function instruction with the actual sampling ratio exceeding a preset sampling ratio as a hot function.
5. The display device of claim 4, wherein, After the step of modifying the reference address of the copied hot function, the controller is further configured to: obtain an original file where the hot function is located before copying, and an original position in the original file; obtain a target file where the hot function is located after copying, and a target position in the target file; calculate offset information of the hot function according to the original position and the target position; write the offset information and the hot function set into a system file of a continuous block, and the system file has a pre-reading function to pre-load the hot function through the system file.
6. The display device of claim 1, wherein, After the step of determining a hot scene item according to a hook function set and operation behavior data of a user, the controller is further configured to: count a file page accessed in the operation behavior data; According to the preset file access proportion and the file page, a hot access file of a hot scene item is determined; The unique identifier, the file path and the file block information of the hot access file are recorded to establish a mapping relationship between the hot access file and a memory access page; The unique identifier, the file path and the file block information are saved in the hot access file.
7. The display device of claim 6, wherein, The controller is further configured to: Add read-write marks to foreground processes in the hot access file; Generate read-write files according to the read-write marks; Record memory access pages involved in the read-write files according to a preset function.
8. The display device of claim 7, wherein, The controller is further configured to: Record active read file interfaces and passive mapping file interfaces started by the foreground processes; Locate the memory access pages of the read-write files through the active read file interfaces and the passive mapping file interfaces; Preload the memory access pages according to the mapping relationship to obtain preloaded access pages; Load the preloaded access pages in response to a missing event of a memory access page.
9. The display device of claim 7, wherein, The controller is further configured to: Obtain a memory address and a memory length of the memory access page; Lock the memory address and the memory length using an mlock function.
10. A method for optimizing system performance, applied to the display device of any one of claims 1-9, characterized in that, The method comprises: Determine a hot scene item according to a hook function set and operation behavior data of a user; the hook function set is used to capture interactive events of the user in the operation behavior data; the interactive events comprise a plurality of event items; the hot scene item is an event item whose cumulative use duration exceeds a threshold duration; Perform sampling on processes in the hot scene item to obtain function sampling results; Determine a hot function according to a preset sampling proportion and the function sampling results; Copy the hot function to a pre-applied continuous memory, modify a reference address of the copied hot function, and merge the hot function to obtain a hot function set; Map a preset virtual address to the hot function set, and store the hot function set through the preset virtual address.
Citation Information
Cited By
Hotspot function locating method, apparatus and navigation receiver for system on chip
CN122220186A