Display device and resource control method
By adjusting the time interval for sending repeated keystrokes and freezing low-priority service processes, the problem of inconsistent user experience caused by differences in processing capabilities of different TV chip platforms is solved, achieving a more stable video playback experience.
Patent Information
- Application Number
- CN202410658303.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-24
- Publication Date
- 2024-09-10
AI Technical Summary
The difference in processing capabilities of different TV chip platforms leads to inconsistent user experience. The same video may appear to freeze and skip frames on different models.
By adjusting the time interval for sending repeated keystrokes based on memory usage and CPU usage, extending the time interval to reduce user interface changes, freezing low-priority service processes to release resources and avoid overloading the CPU.
It effectively avoids the user interface freeze and frame skipping caused by overload of the central processor, and improves the consistency of user experience and system stability.
Smart Images

Figure CN118632059A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of display devices, and in particular to a display device and a resource control method. Background Art
[0002] Due to the rapid development of video content formats on smart TVs, the chip processing capabilities of TVs and the processing performance of the system are required to continue to increase. However, due to the uneven overall processing capabilities of different TV platforms, the user experience will vary greatly when the same software is installed on different chip platforms.
[0003] For example, when playing videos of the same format, the load index of the central processing unit (CPU) of the Android system on different chip platforms is different, and the interval for sending repeated keys in the Android system is fixed, so users cannot modify it through the settings interface after the TV is turned on. Currently, the default setting of the Android system for sending repeated keys is 50ms. If this value is set too high, the interface will slide slowly when the direction key is long pressed, and the user experience will be a stuck interface. If this value is set too low, if the processing power of the chip cannot meet the requirements, the interface will also freeze.
[0004] Therefore, when the TV is turned on and running, due to the large differences in processing power between different chip platforms, and the TV software configuration parameters are basically the same, without any distinction between models. As a result, the same user operation cannot be processed in time in the same TV scene on different models of TV, resulting in frequent freezes and frame skipping on the TV screen. Summary of the invention
[0005] Some embodiments of the present application provide a display device and resource control method, which adjusts the time interval for sending repeated keystrokes by using the memory usage status and the CPU usage rate, so as to solve the problem that when the CPU is heavily loaded and the user is constantly operating the user interface, the CPU load continues to increase and cannot respond in time, resulting in user interface freezes and frame skipping.
[0006] In a first aspect, some embodiments of the present application provide a display device, including:
[0007] After receiving a first button pressing event sent by the control device, issuing a button instruction corresponding to the first button;
[0008] If the first key is a target key, setting the time interval for sending the repeated key to a preset time interval, and the target key includes a key related to a user interface change;
[0009] If the lift event of the first button sent by the control device is not received, and the time interval for distributing the button instruction is equal to the preset time interval, the button instruction corresponding to the first button is distributed again, and the time interval for sending the repeated button is adjusted according to the memory usage status and / or the CPU usage rate.
[0010] In some embodiments, the controller adjusts the time interval for sending the repeated keystrokes according to the memory usage status and / or the CPU usage rate, and is further configured to:
[0011] Record the number of repetitions of the key command corresponding to the first key;
[0012] If the number of repetitions is greater than 0, the time interval for sending the repeated keystrokes is adjusted according to the memory usage status and / or the CPU usage rate.
[0013] In some embodiments, the controller is further configured to adjust the time interval for sending the repeated keystrokes according to the memory usage status:
[0014] Get memory usage status;
[0015] If the memory usage state is a tight state, setting the time interval for sending repeated keys to a first target time interval;
[0016] If the memory usage state is not a tight state, the time interval for sending repeated keystrokes is set to a second target time interval, and the first target time interval is greater than the second target time interval.
[0017] In some embodiments, the controller is further configured to adjust the time interval of sending the repeated key according to the CPU usage rate:
[0018] Get CPU usage;
[0019] If the CPU usage rate is greater than a preset threshold, setting the time interval for sending repeated keys to a third target time interval;
[0020] If the CPU usage rate is not greater than a preset threshold, the time interval for sending repeated keystrokes is set to a second target time interval, and the third target time interval is greater than the second target time interval.
[0021] In some embodiments, if the memory usage state is in a tight state, or the CPU usage rate is greater than a preset threshold, the controller is configured to:
[0022] Freeze the target service process.
[0023] In some embodiments, the controller executes freezing of the target service process and is further configured to:
[0024] Freeze idle background service processes; or,
[0025] Get the priority value of the service process;
[0026] If the service process is not in the service whitelist prohibited from freezing and the priority value is less than a preset priority threshold, the service process is frozen.
[0027] In some embodiments, the controller is configured to:
[0028] After receiving a press event of a second key sent by the control device, or after receiving a preset duration of a lift event of a first key sent by the control device, the time interval for sending repeated keys is restored to the preset time interval, and the second key is not the target key.
[0029] In some embodiments, if the first key is a target key, the controller sets the time interval for sending repeated keys to a preset time interval, and is further configured to:
[0030] If the dynamic adjustment switch is in the on state, determining whether the first key is the target key, the dynamic adjustment switch is used to control the switch of the function of dynamically adjusting the time interval of sending repeated keys;
[0031] If the first key is a target key, the time interval for sending repeated keys is set to a preset time interval.
[0032] In some embodiments, after adjusting the time interval for sending the repeated keystrokes according to the memory usage status and / or the CPU usage rate, the controller is configured to:
[0033] The flag bit for dynamic adjustment of repeated keystrokes is set to a preset value, wherein the flag bit is the preset value indicating that the time interval for sending repeated keystrokes has been adjusted.
[0034] In a second aspect, some embodiments of the present application provide a resource control method, including:
[0035] After receiving a first button pressing event sent by the control device, issuing a button instruction corresponding to the first button;
[0036] If the first key is a target key, setting the time interval for sending the repeated key to a preset time interval, and the target key includes a key related to a user interface change;
[0037] If the lift event of the first button sent by the control device is not received, and the time interval for distributing the button instruction is equal to the preset time interval, the button instruction corresponding to the first button is distributed again, and the time interval for sending the repeated button is adjusted according to the memory usage status and / or the CPU usage rate.
[0038] Some embodiments of the present application provide a display device and a resource control method. After receiving a pressing event of a first key sent by a control device, a key instruction corresponding to the first key is distributed. If the first key is a target key, the time interval for sending repeated keys is set to a preset time interval. Among them, the target keys include keys related to user interface changes. The time when the repeated key can be sent next time is determined according to the current time and the preset time interval. If the time when the repeated key can be sent next time has passed and the lifting event of the first key sent by the control device is still not received, the key instruction corresponding to the first key is distributed again, and the time interval for sending repeated keys is adjusted according to the memory usage status and / or the CPU usage rate. The embodiments of the present application can reduce user interface changes by extending the time interval for sending repeated keys in scenarios where the CPU load is heavy and the system memory is in a tight state, thereby avoiding an increase in the CPU load and avoiding the phenomenon of freezes and frame skips on the display device screen. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present application 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 application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 A schematic diagram of an operation scenario between a display device and a control device provided in some embodiments of the present application;
[0041] Figure 2 A schematic diagram of the hardware configuration of a display device provided in some embodiments of the present application;
[0042] Figure 3 A schematic diagram of software configuration of a display device provided in some embodiments of the present application;
[0043] Figure 4 A flow chart of a resource control method provided for some embodiments of the present application;
[0044] Figure 5 A system architecture diagram provided for some embodiments of the present application;
[0045] Figure 6A schematic diagram of a setting interface provided in some embodiments of the present application;
[0046] Figure 7 A flowchart of a method for adjusting the time interval for sending repeated keys provided in some embodiments of the present application;
[0047] Figure 8 A flowchart of another method for adjusting the time interval for sending repeated keys provided in some embodiments of the present application;
[0048] Fig. 9 A flowchart of a method for freezing a service process provided in some embodiments of the present application;
[0049] Fig.10 A schematic diagram of a video playback interface provided for some embodiments of the present application. DETAILED DESCRIPTION
[0050] The following embodiments are described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following embodiments do not represent all implementations consistent with the present application. They are only examples of systems and methods consistent with some aspects of the present application as detailed in the claims.
[0051] It should be noted that the brief description of terms in this application is only for the convenience of understanding the embodiments described below, and is not intended to limit the embodiments of this application. Unless otherwise specified, these terms should be understood according to their common and usual meanings.
[0052] The terms "first", "second", "third", etc. in the specification and claims of this application and the above drawings are used to distinguish similar or similar objects or entities, and do not necessarily mean to limit a specific order or sequence, unless otherwise noted. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances.
[0053] The terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device comprising a list of components is not necessarily limited to all the components expressly listed but may include other components not expressly listed or inherent to such product or device.
[0054] The term "module" refers to any known or later 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.
[0055] In the embodiment of the present application, the display device 200 generally refers to a device with image display and data processing capabilities. For example, the display device 200 includes but is not limited to a smart TV, a mobile terminal, a computer, a monitor, an advertising screen, a wearable device, a virtual reality device, an augmented reality device, etc.
[0056] Figure 1 This is a schematic diagram of an operation scenario between a display device and a control device provided in some embodiments of the present application. Figure 1 As shown in FIG. 1 , a user can operate the display device 200 through touch operation, the mobile terminal 300 and the control device 100. The control device 100 is used to receive operation instructions input by the user and convert the operation instructions into control instructions that can be recognized and responded to by the display device 200. For example, the control device 100 can be a remote controller, a stylus pen, a handle, etc.
[0057] The mobile terminal 300 can be used as a control device for performing human-computer interaction between the user and the display device 200. The mobile terminal 300 can also be used as a communication device for establishing a communication connection with the display device 200 and performing data interaction. In some embodiments, the mobile terminal 300 can install software applications with the display device 200, and achieve connection and communication through a network communication protocol to achieve the purpose of one-to-one control operation and data communication. The audio and video content displayed on the mobile terminal 300 can also be transmitted to the display device 200 to achieve a synchronous display function.
[0058] 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 program for controlling the display device 200 .
[0059] like Figure 1 As also shown in FIG. 4 , the display device 200 also communicates data with the server 400 through various communication methods. The display device 200 may be allowed to communicate and connect through a local area network (LAN), a wireless local area network (WLAN), and other networks.
[0060] The display device 200 may provide a broadcast receiving television function, and may also additionally provide an intelligent network television function with a computer support function, including but not limited to network television, smart television, Internet Protocol television (IPTV), and the like.
[0061] Figure 2 Some embodiments of the present application provide Figure 1 2 is a block diagram of the hardware configuration of the display device 200.
[0062] 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.
[0063] In some embodiments, the detector 230 is used to collect signals of the external environment or external interaction. For example, the detector 230 includes a light receiver, a sensor for collecting the intensity of ambient light; or, the detector 230 includes an image collector, such as a camera, which can be used to collect external environment scenes, user attributes or user interaction gestures; or, the detector 230 includes a sound collector, such as a microphone, etc., for receiving external sounds.
[0064] In some embodiments, the display 260 includes a display function component for presenting a picture, and a driving component for driving an image display. The display 260 is used to receive an image signal output from the controller 250 for display. For example, the display 260 can be used to display video content, image content, and components of a menu control interface and a user control UI interface.
[0065] In some embodiments, the communication device 220 is a component for communicating with an external device or server 400 according to various communication protocol types. The display device 200 may be provided with a plurality of communication devices 220 according to different supported communication modes. For example, when the display device 200 supports wireless network communication, the display device 200 may be provided with a communication device 220 including a WiFi function. When the display device 200 supports Bluetooth connection communication, the display device 200 needs to be provided with a communication device 220 including a Bluetooth function.
[0066] The communication device 220 can enable the display device 200 to communicate with the external device or server 400 by wireless or wired connection. Among them, the wired connection can connect the display device 200 with the external device through components such as data cables and interfaces. The wireless connection can connect the display device 200 with the external device through wireless signals or wireless networks. The display device 200 can establish a connection relationship with the external device directly, or indirectly establish a connection relationship through a gateway, a router, a connection device, etc.
[0067] 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 interface to an nth interface for input / output. The controller 250 controls the operation of the display device and responds to the user's operation through various software control programs stored in the memory. The controller 250 controls the overall operation of the display device 200.
[0068] In some embodiments, the controller 250 and the tuner-demodulator 210 may be located in different separate devices, that is, the tuner-demodulator 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.
[0069] In some embodiments, the user may input a user command through a graphical user interface (GUI) displayed on the display 260 , and the user input interface receives the user input command through the graphical user interface (GUI).
[0070] In some embodiments, the audio output device 270 may be a local speaker of the display device 200, or may be an external audio output device of the display device 200. In particular, for the external audio output device of the display device 200, the display device 200 may also be provided with an external audio output terminal, and the audio output device may be connected to the display device 200 through the external audio output terminal to output the sound of the display device 200.
[0071] In some embodiments, the user input interface 280 may be used to receive instructions from a user.
[0072] In order to perform user interaction, in some embodiments, the display device 200 may run an operating system. The operating system is a computer program for managing and controlling hardware resources and software resources in 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 can provide a user interface by running an application program. The operating system also allows the user to interact with the display device 200.
[0073] It should be noted that the operating system may be a native operating system based on a specific operating platform, or a third-party operating system deeply customized based on a specific operating platform, or an independent operating system specially developed for the display device.
[0074] The operating system can be divided into different modules or layers according to the functions implemented, such as Figure 3 As shown, in some embodiments, the system is divided into four layers, from top to bottom, namely, the application layer (Applications) layer (referred to as "application layer"), the application framework layer (Application Framework) layer (referred to as "framework layer"), the system library layer and the kernel layer.
[0075] In some embodiments, the application layer is used to provide services and interfaces for applications so that the display device 200 can run applications and interact with users based on the applications. At least one application can be run in the application layer, and these applications can be window programs, system settings programs, clock programs, etc. that come with the operating system; they can also be applications developed by third-party developers. In specific implementations, the application packages in the application layer are not limited to the above examples.
[0076] The framework layer provides application programming interfaces (APIs) and programming frameworks for applications. The application framework layer includes some predefined functions. The application framework layer is equivalent to a processing center that determines the actions that applications in the application layer take. Through the API interface, applications can access system resources and obtain system services during execution.
[0077] like Figure 3 As shown, in the embodiment of the present application, the application framework layer includes a view system, managers, content providers, etc., wherein the view system can design and implement the interface and interaction of the application, and the view system includes lists, grids, text boxes, buttons, etc. The manager includes at least one of the following modules: an activity manager for interacting with all activities running 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 the application package 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.
[0078] In some embodiments, the activity manager is used to manage the life cycle of each application and the usual navigation back function, such as controlling the exit, opening, and back of the application. The window manager is used to manage all window programs, such as obtaining the display screen size, determining whether there is a status bar, locking the screen, capturing the screen, and controlling the display window changes, for example, reducing the display window, shaking the display, distorting the display, etc.
[0079] In some embodiments, the system runtime layer can provide support for the framework layer. When the framework layer is used, the operating system will run the instruction library contained in the system runtime layer, such as the C / C++ instruction library, to implement the functions to be implemented by the framework layer.
[0080] In some embodiments, the kernel layer is a functional layer between the hardware and software of the display device 200. The kernel layer can implement functions such as hardware abstraction, multitasking, and memory management. Figure 3 As shown, the kernel layer may be configured with hardware drivers, and the drivers included in the kernel layer may be at least one of the following drivers: 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.
[0081] It should be noted that the above example is only a simple division of the operating system functions and does not constitute a limitation on the specific operating system form of the display device 200 in the embodiment of the present application. Depending on factors such as the function of the display device and the type of operating system, the number of levels and specific level types contained in the operating system may be expressed in other forms.
[0082] Due to the rapid development of video content formats on smart TVs, the chip processing capabilities of TVs and the processing performance of the system are required to continue to increase. However, due to the uneven overall processing capabilities of different TV platforms, the user experience will vary greatly when the same software is installed on different chip platforms.
[0083] For example, when playing videos of the same format, the CPU load index of the Android system on different chip platforms is different, and the repeated key sending interval of the Android system is fixed, and the user cannot modify it through the settings interface after the TV is turned on. Now the default setting of the Android system for sending repeated keys is 50ms. If this value is set too high, the interface will slide slowly when the direction key is long pressed, and the user experience interface freezes. If this value is set too low, if the processing power of the chip cannot meet the requirements, the interface will freeze.
[0084] Therefore, when the TV is turned on and running, due to the large differences in processing power between different chip platforms, and the TV software configuration parameters are basically the same, without any distinction between models. As a result, the same user operation cannot be processed in time in the same TV scene on different models of TV, resulting in frequent freezes and frame skipping on the TV screen.
[0085] In order to solve the above technical problems, the embodiment of the present application provides a display device 200. The structure and functions of each part of the display device 200 can refer to the above embodiment. In addition, based on the display device 200 shown in the above embodiment, this embodiment further improves some functions of the display device 200. Figure 4 As shown, the controller 250 (at least one processor) enables the display device 200 to perform the following steps by running the application:
[0086] Step S401: receiving a first button pressing event sent by the control device 100;
[0087] The user inputs an instruction to press the power button of the control device 100, and the display device 200 is started. After the display device 200 is started, the key detection service is started and is in a background preparation state.
[0088] After the key detection service is started, the key reading module creates a detection thread. The function of the detection thread is to scan all device nodes under a specific directory and open these device nodes. If the device node changes, the device event is placed in a buffer, and the reading process is immediately awakened to take the input event and encapsulate the existing data.
[0089] After receiving the operation of the user pressing the first button, the control device 100 sends the button signal to the driver of the display device. The driver converts the button signal into a button event and stores it in the device node. After the detection thread detects the change of the device node, the button event is placed in a cache buffer, and the reading process reads the button event and encapsulates the button event and sends it to the button distribution module.
[0090] The key events include press events, i.e., key events corresponding to a user pressing a key of the control device 100. The key events also include lift events, i.e., key events corresponding to a user releasing a key after pressing the key of the control device 100.
[0091] like Figure 5 As shown, the system architecture includes application layer, framework layer, shared library layer, kernel layer and external devices.
[0092] The application layer includes multiple applications, such as Live TV, HotKey Service, and Launcher.
[0093] The framework layer includes activity management (Activity Manager), power management service (Power ManagerService), window management service (Window Manager Service), input management service (Input ManagerService), CPU load detection module, setting repeated key interval module, recovery interval module and freezing module.
[0094] Activity management is a system service. 1) Manage the application's task stack: When the user switches to a new application, activity management is responsible for starting, stopping or restarting the application's activities to meet the user's needs. 2) Manage application processes: Activity management allocates memory to each process and kills unnecessary processes to free up resources when necessary. 3) Manage service processes: When an application needs to start a long-running service, activity management allocates resources for it and manages its life cycle. In summary, activity management is a very important service in the Android system. It is responsible for multiple aspects of the application, such as process management, task management, permission management, and service management, to ensure the smooth operation of the application and user experience.
[0095] The power management service is the core service of the Android system power management. It is essentially a policy control solution at the framework layer. Its functions are: 1) Provide an application interface upward, such as keeping the system awake in audio scenarios and waking up the phone screen in message notification scenarios; 2) Make decisions downward at the HAL (Hardware Abstraction Layer) layer and the Kernel layer to control the device standby state and the status of hardware devices such as the display, backlight, distance sensor, and light sensor.
[0096] The window management service is used to manage windows. It manages all the windows in the current system. It can traverse to select the optimal window, distribute events passed from the input management service, and distribute them to a certain process across processes through Socket.
[0097] The CPU load detection module is used to detect the CPU load, that is, the CPU usage rate. The repeated key interval setting module is used to adjust the time interval for sending repeated keys. The recovery interval module is used to restore the time interval for sending repeated keys to the preset time interval. The freezing module is used to freeze some running background idle service processes.
[0098] The shared library layer includes the event management center (EventHub), the key reading module (Input Device Reader) and the key distribution module (Input Dispatcher). The event management center is used to monitor changes in device nodes, cache key event source data, and notify the key reading module to read. The key reading module is used to read and analyze key event source data. The key distribution module is used to distribute key events.
[0099] The kernel layer includes drivers and device nodes. Drivers include infrared interface drivers (IRRX Driver) and Bluetooth drivers. Among them, the infrared interface driver is used to receive infrared signals sent by infrared remote controllers. The Bluetooth driver is used to receive Bluetooth signals sent by Bluetooth remote controllers.
[0100] External devices include infrared remote controller and Bluetooth remote controller.
[0101] Taking the infrared remote control as an example, after receiving the user's command to press the "right button", the infrared remote control sends the infrared signal corresponding to the "right button" to the infrared interface driver. The infrared interface driver saves the key event of the "right button" to the device node. The event management center detects the change of the device node of the infrared remote control, saves the key event source data of the "right button" to the cache, and notifies the key reading module to read the key event source data, analyzes and processes the key event source data, forms a new data source, and sends the new data source of the key event to the key distribution module.
[0102] Step S402: Distribute the key command corresponding to the first key;
[0103] After receiving the pressing event of the first key, the key distribution module reads the key event and sends the key event to the input management service. The input management service sends the key event to the window management service, and the window management service distributes the key event to the corresponding process, so as to execute the operation corresponding to the key event.
[0104] Step S403: determining whether the first button is a target button;
[0105] In some embodiments, a dynamic adjustment switch for the time interval of sending a repeated key is set. The dynamic adjustment switch is used to control the switch of the function of dynamically adjusting the time interval of sending a repeated key. If the dynamic adjustment switch is in the on state, it indicates that the time interval of sending a repeated key needs to be dynamically adjusted. If the dynamic adjustment switch is in the off state, it indicates that there is no need to dynamically adjust the time interval of sending a repeated key.
[0106] The dynamic adjustment switch can be set by default or set by the user.
[0107] In some embodiments, a dynamic adjustment switch control is added to the setting interface. The user can control the on and off state of the dynamic adjustment switch by selecting the dynamic adjustment switch control. Figure 6 shown.
[0108] In some embodiments, a property switch is set by a special operation method of the remote controller, for example, a combination of menu key + left key + menu key + right key + confirm key. After receiving the command of the combination key, the on and off state of the dynamic adjustment switch is controlled.
[0109] When the dynamic adjustment switch is in the on state, the dynamic adjustment switch flag is a preset value, exemplarily, the preset value is 1. When the dynamic adjustment switch is in the off state, the dynamic adjustment switch flag is a non-preset value, exemplarily, the non-preset value is 0.
[0110] After receiving a first button pressing event sent by the control device, obtaining a dynamic adjustment switch flag;
[0111] Determine whether the dynamic adjustment switch flag is a preset value;
[0112] If the dynamic adjustment switch flag is a preset value, it is determined whether the first button is a target button.
[0113] If the dynamic adjustment switch flag is not a preset value, subsequent operations related to the adjustment of the time interval for sending repeated keys will not be performed.
[0114] A whitelist is set, in which keys that can be dynamically processed, namely, target keys, are stored. The target keys include some keys that are commonly used by the control device 100 and can coexist with the current scene.
[0115] Buttons include system keys, user interface keys, and global keys. System keys refer to keys that control system parameters, such as the volume up key, volume down key, etc. Among them, some system keys are also related to user interface changes. For example, pressing the volume up key should display the current volume in the user interface. User interface keys refer to keys that control the user interface, such as: direction keys, confirmation keys, menu down and channel keys, etc. Global keys include one-key jump keys, such as XX application shortcut keys. Regardless of the current scenario, this button can jump to XX application with one click.
[0116] The target keys include keys related to user interface changes, namely user interface keys and some system keys.
[0117] In some embodiments, all application scenarios in the display device 200 share a whitelist. The key flag of the target key in the whitelist is set to a preset value. The key flag of the target key in the non-whitelist is set to a non-preset value. The key flag is set to a preset value to indicate that the key can modify the time interval for repeatedly sending the key, and the key flag is set to a non-preset value to indicate that the key cannot modify the time interval for repeatedly sending the key.
[0118] In some embodiments, the step of determining whether the first key is a target key includes:
[0119] Determine whether the first button is in the whitelist;
[0120] If the first button is in the whitelist, determining the first button as the target button;
[0121] If the first button is not in the whitelist, it is determined that the first button is not a target button.
[0122] In some embodiments, the step of determining whether the first key is a target key includes:
[0123] Determine whether the key flag of the first key is a preset value;
[0124] If the key flag bit of the first key is a preset value, determining the first key as a target key;
[0125] If the key flag of the first key is not a preset value, it is determined that the first key is not a target key.
[0126] In some embodiments, a whitelist is set in each or each type of application scenario in the display device 200. That is, each or each type of application scenario has its own corresponding target button.
[0127] It should be noted that the scenarios include running applications installed on the display device, running a browser, running live TV and playing media resources, etc.
[0128] After receiving the first button pressing event sent by the control device, obtaining a whitelist corresponding to the current scene;
[0129] Determine whether the first button is in the whitelist;
[0130] If the first button is in the whitelist, determining the first button as the target button;
[0131] If the first button is not in the whitelist, it is determined that the first button is not a target button.
[0132] If the first key is not the target key, subsequent operations related to adjusting the time interval for sending repeated keys are not performed.
[0133] After receiving the pressing event of the first key, the key distribution module determines whether the first key is a target key.
[0134] If the first key is a target key, executing step S404: setting the time interval for sending repeated keys to a preset time interval;
[0135] If the first key is the target key, the number of repetitions of the key command corresponding to the first key is recorded, the number of repetitions is 0, and the time interval for sending repeated keys is set to the preset time interval. The time interval for sending repeated keys refers to the time interval threshold for the next repeated key sending. The default setting is 400ms.
[0136] After determining that the first key is the target key, the key distribution module sets the time interval for sending repeated keys to a preset time interval.
[0137] Step S405: determining whether a first button lift event sent by the control device 100 is received;
[0138] If a first key lift event sent by the control device 100 is received, subsequent operations related to sending repeated keys are not performed.
[0139] If the first key lift event sent by the control device 100 is not received, step S406 is executed: determining whether the time interval from the key command distribution is equal to the preset time interval;
[0140] In some embodiments, if the first button is a target button, after the button instruction corresponding to the first button is distributed, a timer is started to determine whether the time of the timer is equal to a preset time interval.
[0141] In some embodiments, after the time interval for sending repeated keys is set to a preset time interval, the time for the next repeated key sending is calculated, that is, the time for issuing the key instruction corresponding to the first key plus the preset time interval. The step of determining whether the time interval for issuing the key instruction is equal to the preset time interval includes: determining whether the current time reaches the time for the next repeated key sending.
[0142] If the time interval between distributing the key command is less than the preset time interval, continue to execute step S405.
[0143] If the time interval between key command distribution is equal to the preset time interval, step S407 is executed: the key command corresponding to the first key is distributed again, and the time interval for sending repeated keys is adjusted according to the memory usage status and / or the CPU usage rate.
[0144] When the key distribution module does not receive the first key lift event sent by the control device and the time interval from distributing the key command is equal to the preset time interval, the key distribution module distributes the key command corresponding to the first key again and increases the number of repetitions by 1.
[0145] It should be noted that the current number of repetitions is 1. If the number of repetitions is greater than 0, the time interval for sending repeated keys needs to be adjusted according to the memory usage status and / or the CPU usage rate.
[0146] Use the main thread to receive key information in real time, and use a child thread to handle the logic of detecting the number of repeated key presses. The number of key presses changes with the number of key commands sent, and the number of child threads must be consistent with the main thread.
[0147] In some embodiments, determining whether the number of repetitions is greater than 0;
[0148] If the number of repetitions is greater than 0, adjusting the time interval for sending repeated keys according to the memory usage status and / or the CPU usage rate;
[0149] If the number of repetitions is not greater than 0, the step of adjusting the time interval for sending repeated keystrokes according to the memory usage status and / or the CPU usage rate is not performed.
[0150] In some embodiments, determining whether the number of repetitions is greater than 0;
[0151] If the number of repetitions is greater than 0, determine whether the number of repetitions is less than an upper limit of the number of repetitions; illustratively, the upper limit of the number of repetitions is 255.
[0152] If the number of repetitions is less than the upper limit of the number of repetitions, adjusting the time interval for sending the repeated keystrokes according to the memory usage status and / or the CPU usage rate;
[0153] If the number of repetitions is not less than the upper limit of the number of repetitions, the number of repetitions is set to 1, and the time interval for sending repeated keys is adjusted according to the memory usage status and / or the CPU usage rate.
[0154] The embodiment of the present application resets the number of repetitions exceeding the upper limit and restores it to the initial value, similar to the zeroing action, to prevent the number from continuously changing and causing memory overflow.
[0155] In some embodiments, Figure 7 As shown, the step of adjusting the time interval for sending the repeated keystrokes according to the memory usage status includes:
[0156] Step S701: Obtain memory usage status;
[0157] Step S702: Detect whether the memory usage status is in a tight state;
[0158] When checking whether the system memory is tight, use the existing interface of the Android system to judge. Call the isLowMemory(Context) method to check whether the system memory is in a memory tight state. If the return value is true, it means that the system may be experiencing memory pressure, and you should consider releasing memory or optimizing the memory usage of the application. If the return value is false, it means that the system currently has no memory pressure.
[0159] This interface compares with the low memory threshold configured by the system to output whether it is in a memory shortage state. Determine whether the current memory is lower than the low memory threshold; if the current memory is lower than the low memory threshold, the memory usage state is determined to be a memory shortage state and a true value is returned; if the current memory is not lower than the low memory threshold, the memory usage state is determined not to be a memory shortage state and a false value is returned.
[0160] If the memory usage state is a tight state, executing step S703: setting the time interval for sending repeated keys to a first target time interval;
[0161] If the memory usage state is not a tight state, step S704 is executed: the time interval for sending repeated keys is set to a second target time interval, the first target time interval being greater than the second target time interval, wherein the second target time interval is a fixed time interval for sending repeated keys configured by the Android system.
[0162] Exemplarily, if the memory usage status is a tight state, the time interval for sending repeated keys is set to 150ms; if the memory usage status is not a tight state, the time interval for sending repeated keys is set to 50ms.
[0163] After determining that the memory usage state is in a tight state, the key distribution module dynamically modifies the interval for sending repeated keys by setting the repeated key interval module.
[0164] In some embodiments, Figure 8 As shown, the step of adjusting the time interval for sending the repeated keystrokes according to the CPU usage rate includes:
[0165] Step S801: Obtaining CPU usage;
[0166] In the embodiment of the present application, the utilization rate of the central processing unit can be calculated by reading the / proc / stat file.
[0167] To calculate CPU usage, you can take the following steps:
[0168] Read the / proc / stat file and record the initial value of the CPU time slice;
[0169] Rest for a while (for example, 1 second), read the / proc / stat file again, and record the new value of the CPU time slice;
[0170] Calculate the difference between each type of CPU time slice, and then calculate the total CPU time;
[0171] The CPU usage is calculated using the ratio of the non-idle time slice to the total time.
[0172] Step S802: determining whether the CPU usage is greater than a preset threshold;
[0173] If the CPU usage rate is greater than the preset threshold, step S803 is executed: the time interval for sending repeated keys is set to a third target time interval.
[0174] It should be noted that the first target time interval and the third target time interval may be the same or different.
[0175] If the CPU usage rate is not greater than the preset threshold, step S804 is executed: the time interval for sending repeated keys is set to a second target time interval, and the third target time interval is greater than the second target time interval.
[0176] Exemplarily, the preset threshold is 80%. If the CPU usage is 90%, the time interval for sending repeated keys is set to 150ms; if the CPU usage is 60%, the time interval for sending repeated keys is set to 50ms.
[0177] Exemplarily, the preset threshold is 800. The threshold is 80% of the entire CPU, the CPU index of the entire machine is 1000, and the preset threshold is set to 800. If the CPU usage index is 900, the time interval for sending repeated keys is set to 150ms; if the CPU usage index is 600, the time interval for sending repeated keys is set to 50ms.
[0178] In some embodiments, the number of cores of the central processing units of different display devices is different. Different numbers of cores correspond to different preset thresholds. The more cores there are, the higher the preset threshold is set.
[0179] For example, the whole machine is configured with 2 CPU cores, the processing capacity is 200%, the preset threshold is 80%, and the actual threshold is 160% due to the 2 cores. If the CPU usage is 170%, the time interval for sending repeated keys is set to 150ms; if the CPU usage is 100%, the time interval for sending repeated keys is set to 50ms.
[0180] The whole machine is configured with 4 CPU cores, the processing capacity is 400%, the preset threshold is 90%, and the actual threshold is 360% due to the 4 cores. If the CPU usage is 370%, set the interval for sending repeated keys to 150ms; if the CPU usage is 330%, set the interval for sending repeated keys to 50ms.
[0181] In some embodiments, the third target time interval is determined according to CPU usage.
[0182] If the CPU usage rate is within a first preset range, determining the third target time interval to be a first fixed value;
[0183] If the CPU usage rate is within a second preset range, determining the third target time interval to be a second fixed value;
[0184] If the CPU usage rate is within a third preset range, determining the third target time interval as a third fixed value;
[0185] …
[0186] Exemplarily, the first preset range is 80%-85%, the second preset range is 85%-90%, and the third preset range is 90%-95%. The first fixed value is 100ms, the second fixed value is 150ms, and the third fixed value is 200ms. If the CPU usage rate is 82%, the time interval for sending repeated keys is set to 100ms; if the CPU usage rate is 86%, the time interval for sending repeated keys is set to 150ms; if the CPU usage rate is 92%, the time interval for sending repeated keys is set to 200ms.
[0187] The CPU load detection module reads the CPU usage every 500ms and calculates the percentage of CPU idle time within 500ms. When the key distribution module obtains the CPU usage greater than the preset threshold from the CPU load detection module, it dynamically modifies the interval for sending repeated keys by setting the repeated key interval module.
[0188] In some embodiments, if the memory usage status is a critical status, or if the CPU usage rate is greater than a preset threshold, the target service process is frozen.
[0189] In some embodiments, the step of freezing the target service process includes: freezing a low-priority service process.
[0190] Among them, active processes (pages that are visible and can interact with users) have the highest priority. Visible processes (pages that are visible but cannot be interacted with, such as pages with pop-ups or covered parts) have high priority. Started background service processes have medium priority. Background processes have low priority. Freezing low-priority service processes is essentially freezing background processes.
[0191] In some embodiments, the step of freezing the target service process includes: freezing a background idle service process.
[0192] Get background process;
[0193] Determine whether the background process is idle;
[0194] If the background process is idle, freeze the background process;
[0195] If the background process is not in an idle state, the operation related to freezing the background process is not performed.
[0196] Android provides some methods to detect whether the background process is idle. The most commonly used one is Looper.myQueue().isIdle() method. This method returns a Boolean value indicating whether the current process is idle.
[0197] In some embodiments, the step of freezing the target service process includes:
[0198] Get the priority value of the service process;
[0199] The system will determine the priority value ADJ of each process based on the component status of the service process. Each level is different, and the corresponding value and meaning are also different.
[0200] Exemplarily, the correspondence between ADJ levels and values is shown in Table 1.
[0201] Table 1
[0202] ADJ Level Value NATIVE_ADJ (local) -1000 SYSTEM_ADJ(system) -900 PERSISENT_PROC_ADJ (persistent process) -800 PERSISENT_SERVICE_ADJ (persistent service) -700 FOREGROUND_APP_ADJ (front application) 0 VISIBLE_APP_ADJ (visible application) 100
[0203] Determining whether the priority value is less than a preset priority threshold;
[0204] If the priority value of the service process is less than a preset priority threshold, freezing the service process;
[0205] If the priority value of the service process is not less than the preset priority threshold, the operation of freezing the service process is not performed.
[0206] In some embodiments, Fig. 9 As shown, the steps of freezing the target service process include:
[0207] Step S901: Determine whether the service process is in the service whitelist prohibited from freezing;
[0208] For service processes whose priority value is less than a preset priority threshold but cannot be frozen, they can be set in a service whitelist prohibited from freezing.
[0209] If the service process is in the whitelist of services prohibited from freezing, the related operations of freezing the service process will not be performed.
[0210] If the service process is not in the service whitelist prohibited from freezing, executing step S902: obtaining the priority value of the service process;
[0211] Step S903: Determine whether the priority value is less than a preset priority threshold;
[0212] If the priority value of the service process is less than the preset priority threshold, step S904 is executed: freezing the service process.
[0213] If the priority value of the service process is not less than the preset priority threshold, the operation of freezing the service process is not performed.
[0214] After determining that the memory usage state is in a tight state or the CPU usage rate is greater than a preset threshold, the key distribution module dynamically modifies the interval of sending repeated keys by setting the repeated key interval module, and freezes some service processes by the freezing module.
[0215] In the embodiment of the present application, by freezing a portion of idle background services or low-priority services, more resources and memory are released, thereby avoiding the problem of screen freeze and frame skipping caused by the user interface's inability to respond in time.
[0216] In some embodiments, after determining that the memory usage is in a tight state or the CPU usage is greater than a preset threshold, the input key operation will not be processed for a certain period of time. Since the CPU usage is very high, if you press and hold the key in the whitelist at this time, the corresponding business will not be processed, so as to prevent the CPU from continuing to increase, causing the page to freeze and affecting the viewing experience.
[0217] In some embodiments, if the lift event of the first button sent by the control device is not received, and the time interval for distributing the button command is equal to the preset time interval, the memory usage status is obtained, and the CPU usage rate is obtained as long as one of the following conditions is met: 1) the memory usage status is in a tense state; 2) the CPU usage rate is greater than the preset threshold, that is, the time interval for sending repeated buttons needs to be dynamically adjusted.
[0218] In some embodiments, the size of the memory configured in the whole machine is read;
[0219] If the memory size is not greater than the preset memory size, the memory usage status is obtained. For example, the preset memory size is 2G;
[0220] Adjust the time interval for sending repeated keys according to the memory usage status;
[0221] If the memory size is greater than a preset memory size, obtaining a CPU usage rate;
[0222] Adjust the time interval between repeated keystrokes based on CPU usage.
[0223] The embodiment of the present application can adjust the time interval for sending repeated keys according to the memory usage status when the display device is configured with a small memory. When the display device is configured with a large memory, that is, when insufficient memory rarely occurs, the time interval for sending repeated keys is adjusted according to the CPU usage rate. This reduces some processes to a certain extent and improves the processing speed.
[0224] After obtaining the adjusted time interval for sending repeated keys, continue to determine whether the lift event of the first key sent by the control device is received. If the lift event of the first key is not received, determine whether the time interval from the last key instruction distribution is equal to the adjusted time interval for sending repeated keys. If the time interval from the last key instruction distribution is equal to the adjusted time interval for sending repeated keys, distribute the key instruction corresponding to the first key again, and increase the number of repetitions by 1. If the number of repetitions is greater than 0, continue to adjust the time interval for sending repeated keys according to the memory usage status and / or the CPU usage rate, and perform subsequent steps in this way.
[0225] In some embodiments, when it is detected that the memory usage state is not in a tense state, or the CPU usage rate is not greater than a preset threshold, if the target service process is in a frozen state, the frozen state of the target service process can be released.
[0226] In some embodiments, each time a key command is repeatedly sent, or the number of repetitions is increased by 1, the time interval for sending repeated keys is adjusted according to the memory usage status and / or the CPU usage rate.
[0227] In some embodiments, the number of repetitions may be preset, and the time interval for sending the repeated keystrokes may be adjusted according to the memory usage status and / or the CPU usage rate. For example, every three times a repeat keystroke instruction is sent, the time interval for sending the repeated keystrokes may be adjusted according to the memory usage status and / or the CPU usage rate.
[0228] After determining that the number of repetitions is greater than 0, determine whether (n-1)%A is equal to 0; wherein n is the number of repetitions and A is the preset number. If (n-1)%A is equal to 0, adjust the time interval for sending repeated keys according to the memory usage status and / or the CPU usage rate; if (n-1)%A is not equal to 0, do not perform the operation of adjusting the time interval for sending repeated keys, and continue to perform related operations according to the time interval for sending repeated keys after the last adjustment.
[0229] After adjusting the time interval for sending the repeated key, the flag bit for dynamic adjustment of the repeated key is set to a preset value, and the flag bit is the preset value indicating that the time interval for sending the repeated key has been adjusted. The keys in the subsequent whitelist do not need to perform the above-mentioned repeated action. In this case, the keys in the whitelist uniformly use one interval for repeated key.
[0230] After receiving a pressing event of a third button sent by the control device, issuing a button instruction corresponding to the third button;
[0231] In some embodiments, if the third key is a target key, a flag bit for dynamic adjustment of repeated keys is obtained;
[0232] Determine whether the flag bit for dynamic adjustment of repeated keystrokes is a preset value;
[0233] If the flag bit of the repeated key dynamic adjustment is the preset value, determining whether to receive the lift event of the third key;
[0234] If the lift event of the third button is not received, it is determined that the time interval for distributing the button instruction is equal to the time interval for sending repeated buttons after adjustment, wherein the time interval for sending repeated buttons after adjustment is the time interval after the last whitelist button, i.e., the first button, was adjusted.
[0235] If the time interval for distributing the key command is equal to the time interval for sending the adjusted repeated key, the key command corresponding to the third key is distributed again, and the time interval for sending the repeated key is adjusted according to the memory usage status and / or the CPU usage rate.
[0236] If the flag bit for dynamic adjustment of the repeated key is not a preset value, the step of setting the time interval for sending the repeated key to the preset time interval is performed.
[0237] In some embodiments, if the third button is the target button, the time interval for sending the repeated button is set to a preset time interval, and if the lift event of the third button is not received, and the time interval from the distribution of the button instruction is equal to the preset time interval, the button instruction corresponding to the third button is distributed again, and the flag bit of the dynamic adjustment of the repeated button is obtained. If the flag bit of the dynamic adjustment of the repeated button is a preset value, the button instruction corresponding to the third button is sent at the time interval after the last whitelist button, that is, the first button is adjusted.
[0238] After receiving a press event of a second button of the control device 100, or receiving a lift event of a first button of the control device 100 for a preset time, the time interval for sending repeated buttons is restored to prevent system abnormality. The second button is not the target button.
[0239] In some embodiments, restoring the time interval for sending repeated keys refers to restoring the time interval for sending repeated keys to a preset time interval.
[0240] In some embodiments, restoring the time interval for sending repeated keys means restoring the time interval for sending repeated keys to the second target time interval after setting the time interval for sending repeated keys to the first target time interval or the third target time interval.
[0241] After receiving a preset duration of a pressing event of the second key or a lifting event of the first key, the key distribution module restores the time interval for sending repeated keys to the preset time interval through the recovery interval module.
[0242] After receiving a pressing event of the second button of the control device 100 or receiving a lifting event of the first button of the control device 100 for a preset duration, the number of repetitions is cleared.
[0243] After receiving a pressing event of the second button of the control device 100 or receiving a lifting event of the first button of the control device 100 for a preset duration, the freezing state of the target service process is released.
[0244] After receiving a pressing event of the second button of the control device 100, or after receiving a preset duration of a lifting event of the first button of the control device 100, the flag for dynamic adjustment of the repeated key is set to a non-preset value, and the flag being a non-preset value indicates that the time interval for sending the repeated key is not adjusted.
[0245] The embodiment of the present application increases the monitoring of CPU load and memory usage, and adjusts the time interval for repeated key presses of the control device according to different scenarios. It also refines the priority of the processing process according to different scenarios, freezes some idle background services, releases resources, avoids the scenario where the user interface cannot respond in time, and improves the user experience.
[0246] For example, the video playback interface is as follows: Fig.10 As shown, the current progress is at a. Detect that the user long presses the right key, that is, inputs the fast-forward instruction. After receiving the right key press event, a fast-forward instruction is issued, and the current progress advances to b, and the screen corresponding to progress b is displayed. If the right key lift event is not received after 400ms, the fast-forward instruction is issued again, and the current progress advances to c, and the screen corresponding to progress c is displayed. After detecting that the current CPU usage rate is greater than the preset threshold of 80%, the time interval for sending repeated keys is adjusted to 150ms, and the background idle service is frozen. If the right key lift event is still not received after 150ms, the fast-forward instruction is issued again, and the current progress advances to d, and the screen corresponding to progress d is displayed. After detecting that the current CPU usage rate is less than the preset threshold of 80%, the time interval for sending repeated keys is adjusted to 50ms. If the right key lift event is still not received after 50ms, the fast-forward instruction is issued again, and the current progress advances to e, and the screen corresponding to progress e is displayed. 500ms after receiving the right key lift event or the return key press event, the time interval for sending repeated keys is restored to release the background idle service freeze state.
[0247] The embodiments of the present application ensure that videos played under LiveTV or by third-party applications will not cause system freezes or frame skipping due to changes in the user interface.
[0248] Some embodiments of the present application provide a resource control method, the method is applicable to a display device 200, the display device 200 includes a display 260 and a controller 250, the controller 250 is configured to: after receiving a pressing event of a first key sent by the control device, distribute a key instruction corresponding to the first key; if the first key is a target key, set the time interval for sending repeated keys to a preset time interval, the target key includes a key related to a user interface change; if the lifting event of the first key sent by the control device is not received, and the time interval from the distribution of the key instruction is equal to the preset time interval, distribute the key instruction corresponding to the first key again, and, according to the memory usage status and / or the CPU usage rate, adjust the time interval for sending the repeated keys. In the scenario where the CPU load is heavy and the system memory is in a tight state, the embodiment of the present application can reduce the user interface change by extending the time interval for sending repeated keys, thereby avoiding the increase of the CPU load and avoiding the phenomenon of freezing and frame skipping on the display device screen.
[0249] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0250] For the convenience of explanation, the above description has been made in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or limit the embodiments to the specific forms disclosed above. Based on the above teachings, various modifications and variations can be obtained. The selection and description of the above embodiments are to better explain the principles and practical applications, so that those skilled in the art can better use the embodiments and various different variations of the embodiments suitable for specific use considerations.
Claims
1. A display device, characterized in that: include: monitor; The controller is configured as: After receiving a first button press event sent by the control device, issuing a button instruction corresponding to the first button; If the first key is a target key, setting the time interval for sending repeated keys to a preset time interval, and the target key includes a key related to a user interface change; If the lift event of the first button sent by the control device is not received, and the time interval from distributing the button instruction is equal to the preset time interval, the button instruction corresponding to the first button is distributed again, and the time interval for sending the repeated button is adjusted according to the memory usage status and / or the CPU usage rate.
2. The display device according to claim 1, wherein The controller adjusts the time interval for sending the repeated keystrokes according to the memory usage status and / or the CPU usage rate, and is further configured to: Record the number of repetitions of the key command corresponding to the first key; If the number of repetitions is greater than 0, the time interval for sending the repeated keystrokes is adjusted according to the memory usage status and / or the CPU usage rate.
3. The display device according to claim 1, wherein The controller adjusts the time interval for sending the repeated keystrokes according to the memory usage status, and is further configured to: Get memory usage status; If the memory usage state is a tight state, setting the time interval for sending repeated keys to a first target time interval; If the memory usage state is not a tight state, the time interval for sending repeated keystrokes is set to a second target time interval, and the first target time interval is greater than the second target time interval.
4. The display device according to claim 1, wherein The controller adjusts the time interval for sending the repeated keystrokes according to the CPU usage, and is further configured to: Get CPU usage; If the CPU usage is greater than a preset threshold, setting the time interval for sending repeated keys to a third target time interval; If the CPU usage is not greater than a preset threshold, the time interval for sending repeated keystrokes is set to a second target time interval, and the third target time interval is greater than the second target time interval.
5. The display device according to claim 3 or 4, characterized in that If the memory usage is in a critical state, or the CPU usage is greater than a preset threshold, the controller is configured to: Freeze the target service process.
6. The display device according to claim 5, wherein: The controller freezes the target service process and is further configured to: Freeze idle background service processes; or, Get the priority value of the service process; If the service process is not in the service whitelist prohibited from freezing and the priority value is less than a preset priority threshold, the service process is frozen.
7. The display device according to claim 1, wherein The controller is configured to: After receiving a press event of a second key sent by the control device, or after receiving a preset duration of a lift event of a first key sent by the control device, the time interval for sending repeated keys is restored to the preset time interval, and the second key is not the target key.
8. The display device according to claim 1, wherein The controller sets the time interval for sending repeated keys to a preset time interval if the first key is a target key, and is further configured to: If the dynamic adjustment switch is in the on state, determining whether the first key is the target key, the dynamic adjustment switch is used to control the on / off function of dynamically adjusting the time interval for sending repeated keys; If the first key is a target key, the time interval for sending repeated keys is set to a preset time interval.
9. The display device according to claim 1, wherein After adjusting the time interval for sending the repeated keystrokes according to the memory usage status and / or the CPU usage rate, the controller is configured to: The flag bit for dynamic adjustment of repeated keystrokes is set to a preset value, where the flag bit is the preset value indicating that the time interval for sending repeated keystrokes has been adjusted.
10. A resource control method, characterized in that: include: After receiving a first button press event sent by the control device, issuing a button instruction corresponding to the first button; If the first key is a target key, setting the time interval for sending repeated keys to a preset time interval, and the target key includes a key related to a user interface change; If the lift event of the first button sent by the control device is not received, and the time interval from distributing the button instruction is equal to the preset time interval, the button instruction corresponding to the first button is distributed again, and the time interval for sending the repeated button is adjusted according to the memory usage status and / or the CPU usage rate.
