External device and method for controlling application program operation
By using external devices and application operation control methods in smart TV devices, the problem that applications that need to be run in the background in smart TV devices cannot be maintained, and the application is stable and fast self-start is achieved, and the applicability and adaptability are improved.
Patent Information
- Application Number
- CN202211642738.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-20
- Publication Date
- 2025-06-03
- Estimated Expiration
- 2042-12-20
AI Technical Summary
Applications that need to be run in the background in smart TV devices cannot be kept running for a long time, and are easily automatically killed by the system and cannot start by itself, resulting in the inability to provide services. The existing application keep-alive technology has shortcomings in Android system and terminal adaptability.
Provided is a method of controlling the operation of external devices and applications, connecting the smart TV device through the external device, controlling the reset of the external device when the preset conditions are met, and sending a broadcast to the application to control it to maintain operation. The external device may include a microcontroller and a universal serial bus interface, and open write state interface through the hardware driver layer to receive the write value of the application program, determine whether there is a numerical write, and reset and send a broadcast if not.
Ensure that applications that need to be run in the background in the smart TV device are not killed, or can be restarted quickly even if they are killed, which improves the applicability of Android version and terminal adaptability, and reduces the possibility of being restricted.
Smart Images

Figure CN115988274B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of smart TVs, and particularly to an external device and a method for controlling the operation of application programs. Background Art
[0002] Currently, application programs in smart TV devices with the Android system cannot run in the background for a long time. After a period of time, they will be automatically killed by the system to clean up the memory, and the application programs cannot restart automatically after being killed, that is, they cannot provide services to users. This results in the inability to use application programs that need to run in the background, such as timed reminders.
[0003] Existing application keep-alive technologies all implement application keep-alive at the software level, with poor applicability to Android system versions and poor terminal adaptability, making it difficult to meet the actual usage requirements. Summary of the Invention
[0004] This application provides an external device and a method for controlling the operation of application programs to solve the problem that application programs that need to run in the background in smart TV devices cannot keep running.
[0005] In a first aspect, an embodiment of this application provides an external device, and the external device is connected to a smart TV device;
[0006] The external device is configured to control the external device to reset when a preset condition is met, and send a broadcast to the application programs in the smart TV device to control the application programs to keep running.
[0007] Optionally, the external device includes a single-chip microcomputer; a universal serial bus interface is set in the single-chip microcomputer; and the single-chip microcomputer is connected to the smart TV device through the universal serial bus interface.
[0008] Optionally, the external device is specifically configured to control the external device to reset when the smart TV device has been running for a first preset duration after startup, and send a broadcast to the application programs in the smart TV device to control the application programs to keep running.
[0009] Optionally, the external device is specifically configured to open an interface for writing status at the hardware driver layer, and through the interface for writing status, receive the values written by the application programs into the hardware buffer every second preset duration, and determine whether a value is written every second preset duration. When no value is written, control the external device to reset and send a broadcast to the application programs in the smart TV device to control the application programs to keep running.
[0010] Optionally, the external device is specifically configured to receive the current time value written by the application programs into the hardware buffer every second preset duration through the interface for writing status.
[0011] Optionally, the external device is specifically configured to control the reset of the external device, and send a Universal Serial Bus (USB) unmount broadcast and a USB mount broadcast to the application in the smart TV device to control the application to keep running.
[0012] In a second aspect, an embodiment of the present application provides an application running control method, which is applied to the external device described in the first aspect. The method includes:
[0013] When a preset condition is met, control the reset of the external device;
[0014] Send a broadcast to the application in the smart TV device to control the application to keep running.
[0015] Optionally, the step of controlling the reset of the external device when a preset condition is met includes:
[0016] When the smart TV device has been running for a first preset duration after startup, control the reset of the external device.
[0017] Optionally, the step of controlling the reset of the external device when a preset condition is met includes:
[0018] Receive the value written to the hardware buffer by the application every second preset duration through a write status interface;
[0019] Judge whether a value is written every second preset duration;
[0020] When no value is written, control the reset of the external device.
[0021] Optionally, the step of sending a broadcast to the application in the smart TV device to control the application to keep running includes:
[0022] Send a USB unmount broadcast and a USB mount broadcast to the application in the smart TV device to control the application to keep running.
[0023] The above technical solution provided by the embodiments of the present application has the following advantages compared with the prior art: In the embodiments of the present application, an external device is connected to a smart TV device. The external device is used to control the reset of the external device when a preset condition is met, and send a broadcast to an application program in the smart TV device to control the application program to keep running. In the present application, when the preset condition is met, the external device resets and sends a broadcast to the application program in the smart TV device to control the application program to keep running, which can ensure that the application programs that need to run in the background in the smart TV device are not killed, or even if they are killed, they can be quickly restarted automatically. Moreover, compared with the pure software keep-alive solution, the present application greatly improves the applicability of the Android system version, and due to the use of the hardware underlying logic, the terminal adaptability is strong, and the possibility of being restricted is lower than that of the software keep-alive solution, solving the problem that the application programs that need to run in the background in the smart TV device cannot keep running. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The accompanying drawings herein are incorporated into and constitute a part of this specification, showing embodiments consistent with the present invention and, together with the specification, are used to explain the principles of the present invention.
[0025] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0026] Figure 1 It is a schematic diagram of the connection relationship between the external device and the smart TV device in the embodiments of the present application;
[0027] Figure 2 It is a schematic diagram of the method flow for controlling the operation of the application program in the embodiments of the present application;
[0028] Figure 3 It is a schematic diagram of the method flow for controlling the operation of the application program in a specific embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0029] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts fall within the scope of protection of the present application.
[0030] In the embodiments of the present application, an external device is provided, such as Figure 1As shown, an external device is connected to the smart TV device;
[0031] The external device is used to control the reset of the external device when a preset condition is met, and send a broadcast to the application in the smart TV device to control the application to keep running.
[0032] In this application, when the preset condition is met, the external device resets and sends a broadcast to the application in the smart TV device to control the application to keep running, which can ensure that the applications that need to run in the background in the smart TV device are not killed, or, even if they are killed, they can be quickly restarted automatically. Moreover, compared with the pure software keep-alive solution (which generally only supports Android 6.0 and below), this application greatly improves the applicability of the Android system version (from Android 4.0 to the latest version), and because it uses the hardware underlying logic, the terminal adaptability is strong, and the possibility of being restricted is lower than that of the software keep-alive solution, solving the problem that the applications that need to run in the background in the smart TV device cannot keep running.
[0033] Existing application keep-alive technologies are all at the software layer, and this application implements application keep-alive through hardware + software.
[0034] In a specific embodiment, the external device includes a single-chip microcomputer; a Universal Serial Bus (USB) interface is set in the single-chip microcomputer; the single-chip microcomputer is connected to the smart TV device through the Universal Serial Bus interface.
[0035] Among them, the USB interface can be a USB-A interface.
[0036] The single-chip microcomputer is connected to the smart TV device through the USB interface, which can be realized by inserting the single-chip microcomputer into the smart TV device through the USB interface to achieve a pluggable connection.
[0037] In a specific embodiment, the external device is specifically used to control the reset of the external device when the smart TV device has run for a first preset duration after startup, and send a broadcast to the application (Application, APP) in the smart TV device to control the application to keep running.
[0038] Among them, the first preset duration can be customized through the firmware of the single-chip microcomputer. By controlling the reset of the external device and sending a broadcast to the application in the smart TV device, the application that receives the broadcast is restarted automatically, ensuring that the applications that need to run in the background in the smart TV device are not killed, or, even if they are killed, they can be quickly restarted automatically.
[0039] In a specific embodiment, the external device is specifically configured to open an interface for writing a status (heartbeat Time) at the hardware driver layer. Through the interface for writing the status, it receives the values written by the application to the buffer of the hardware every second preset duration, determines whether there is a value written every second preset duration, and when there is no value written, controls the external device to reset and send a broadcast to the application in the smart TV device to control the application to keep running.
[0040] The application writes values to the buffer of the hardware through the interface for writing the status every second preset duration. If it is found that there is no value written at any time during the process, it is determined that the application has been killed by the system, then the external device is controlled to reset and send a broadcast to the application in the smart TV device to control the application to keep running. This can ensure that the applications that need to run in the background in the smart TV device can be quickly restarted automatically even if they are killed.
[0041] Among them, the second preset duration can be 1 second or other values.
[0042] In a specific embodiment, the external device is specifically configured to receive the current time value written by the application to the buffer of the hardware every second preset duration through the interface for writing the status.
[0043] In a specific embodiment, the external device is specifically configured to control the external device to reset and send a USB unmount broadcast and a USB mount broadcast to the application in the smart TV device to control the application to keep running.
[0044] The single-chip microcomputer with a USB-A interface declares itself as a certain xxxxxxxx hardware. Through the firmware, it can control itself to reset (i.e., USB unmount and then mount) xx seconds after the Android system boots up, and send system broadcasts android.hardware.usb.action.USB_DEVICE_DETACHED (USB unmount broadcast) and android.hardware.usb.action.USB_DEVICE_ATTACHED (USB mount broadcast); it can also open an interface for writing the status at the hardware driver layer. The application writes the current time value to the buffer of the hardware every second. The hardware judges whether there is a value written every second. If it is found that there is no value written at any time during the process, it is determined that the application has been killed by the system, then the single-chip microcomputer itself resets and sends a system broadcast.
[0045] By registering a broadcast receiver for the USB mount broadcast, the application can be started by the Android system after the single-chip microcomputer resets and sends a system broadcast.
[0046] Based on the same concept, an application program running control method is provided in an embodiment of the present application, which is applied to an external device provided in the embodiment of the present application, such as Figure 2 As shown, the application program running control method mainly includes:
[0047] Step 201, when a preset condition is met, control the external device to reset.
[0048] Step 202, send a broadcast to the application program in the smart TV device to control the application program to keep running.
[0049] In the present application, when the external device resets when a preset condition is met and sends a broadcast to the application program in the smart TV device to control the application program to keep running, it can ensure that the application programs that need to run in the background in the smart TV device are not killed, or even if they are killed, they can be quickly restarted automatically. Moreover, compared with the pure software keep-alive solution (generally only supporting below Android 6.0), the present application greatly improves the applicability of the Android system version (from Android 4.0 to the latest version), and because it uses the hardware underlying logic, the terminal adaptability is strong, and the possibility of being restricted is lower than that of the software keep-alive solution, solving the problem that the application programs that need to run in the background in the smart TV device cannot keep running.
[0050] In a specific embodiment, when a preset condition is met, controlling the external device to reset includes: when the smart TV device has been running for a first preset duration after startup, controlling the external device to reset.
[0051] Among them, the first preset duration can be customized through the firmware of the single-chip microcomputer. By controlling the external device to reset and sending a broadcast to the application program in the smart TV device, the application program that receives the broadcast is restarted automatically, ensuring that the application programs that need to run in the background in the smart TV device are not killed, or even if they are killed, they can be quickly restarted automatically.
[0052] In a specific embodiment, when a preset condition is met, controlling the external device to reset includes: receiving, through the write status interface, the value written by the application program to the hardware buffer every second preset duration; judging whether a value is written every second preset duration; when no value is written, controlling the external device to reset.
[0053] Among them, the value can be the current time value.
[0054] The application writes a value into the buffer of the hardware through the write status interface every second preset duration. If no value is written at any time during the process, it is determined that the application has been killed by the system, and then the external device is controlled to reset, and a broadcast is sent to the application in the smart TV device to control the application to keep running. This can ensure that the applications that need to run in the background in the smart TV device can be quickly restarted automatically even if they are killed.
[0055] Among them, the second preset duration can be 1 second or other values.
[0056] In a specific embodiment, sending a broadcast to the application in the smart TV device to control the application to keep running includes: sending a USB mass storage unmount broadcast and a USB mass storage mount broadcast to the application in the smart TV device to control the application to keep running.
[0057] The single-chip microcomputer with a USB-A interface declares itself as a certain xxxxxxxx hardware. Through the firmware, it can control the single-chip microcomputer to reset itself (i.e., USB unmount and remount) xx seconds after the Android system boots, and send a USB unmount broadcast and a USB mount broadcast; a write status interface can also be opened by the hardware driver layer. The application writes the current time value into the buffer of the hardware every second. The hardware judges whether a value is written every second. If no value is written at any time during the process, it is determined that the application has been killed by the system, and then the single-chip microcomputer resets itself and sends a system broadcast.
[0058] The application can be started by the Android system after the single-chip microcomputer resets and sends a system broadcast by registering a broadcast receiver for the USB mount broadcast.
[0059] In a specific embodiment, as Figure 3 shown, the application running control method mainly includes:
[0060] Step 301, the smart TV device of the Android system starts.
[0061] Step 302, after the xx-second countdown at startup, the USB single-chip microcomputer executes a reset.
[0062] Step 303, the APP to be kept alive is pulled up by the system.
[0063] Step 304, provide an interface to allow the APP to write the heartbeat status every second.
[0064] Step 305, judge whether there is a heartbeat in the previous second. If so, execute Step 306; otherwise, execute Step 307.
[0065] Step 306, continue to wait for the next second's heartbeat.
[0066] Step 307, the USB single-chip microcomputer executes a reset.
[0067] Step 308, the APP to be kept alive is pulled up by the system.
[0068] It should be noted that in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising a..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.
[0069] The above are only specific embodiments of the present invention, enabling those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to these embodiments shown herein, but rather to the broadest scope consistent with the principles and novel features claimed herein.
Claims
1. An external device, characterized in that, the external device is connected to a smart TV device; the external device is used to control the reset of the external device when a preset condition is met, and send a broadcast to the application program in the smart TV device to control the application program to keep running; the external device includes a single-chip microcomputer; a universal serial bus interface is set in the single-chip microcomputer; the single-chip microcomputer is connected to the smart TV device through the universal serial bus interface.
2. The external device according to claim 1, characterized in that, the external device is specifically used to control the reset of the external device when the smart TV device has been running for a first preset duration after startup, and send a broadcast to the application program in the smart TV device to control the application program to keep running.
3. The external device according to claim 1, characterized in that, the external device is specifically used to open an interface for writing status at the hardware driver layer, and through the interface for writing status, receive the value written by the application program to the buffer of the hardware every second preset duration, and determine whether a value is written every second preset duration. When no value is written, control the external device to reset and send a broadcast to the application program in the smart TV device to control the application program to keep running.
4. The external device according to claim 3, characterized in that, the external device is specifically used to receive the current time value written by the application program to the buffer of the hardware every second preset duration through the interface for writing status.
5. The external device according to any one of claims 1 to 4, characterized in that, the external device is specifically used to control the reset of the external device, and send a universal serial bus unmount broadcast and a universal serial bus mount broadcast to the application program in the smart TV device to control the application program to keep running.
6. A method for controlling the operation of an application program, characterized in that, applied to the external device according to any one of claims 1 to 5, the method includes: controlling the reset of the external device when a preset condition is met; sending a broadcast to the application program in the smart TV device to control the application program to keep running.
7. The method for controlling the operation of an application program according to claim 6, characterized in that, the controlling the reset of the external device when a preset condition is met includes: controlling the reset of the external device when the smart TV device has been running for a first preset duration after startup.
8. The method for controlling the operation of an application program according to claim 6, characterized in that, the controlling the reset of the external device when a preset condition is met includes: receiving, through the interface for writing status, the value written by the application program to the buffer of the hardware every second preset duration; judging whether a value is written every second preset duration; controlling the reset of the external device when no value is written.
9. The method for controlling the operation of an application program according to any one of claims 6 to 8, characterized in that, the sending a broadcast to the application program in the smart TV device to control the application program to keep running includes: Send a Universal Serial Bus (USB) unmount broadcast and a USB mount broadcast to the application in the smart TV device to control the application to keep running.
Citation Information
Patent Citations
Android system based mobile terminal recovery control method
CN105893066A
Intelligent terminal interaction method and device
CN105979326A