Automatic control method, device, equipment and storage medium of IPTV equipment
By receiving and outputting the target data of the remote control operation request in the IPTV device, the multicast network is used to realize the synchronous control of multiple devices, which solves the problems of insufficient compatibility and inaccurate button recognition in the existing technology, and achieves high accuracy and simplicity. Multi-device control.
Patent Information
- Application Number
- CN202410964170.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-07-18
AI Technical Summary
Existing IPTV devices have insufficient compatibility and inaccurate button recognition when multiple devices are controlled at the same time. In particular, real-time background button interception cannot be implemented at the APP layer, making long-press button recognition difficult.
By receiving the operation request of the remote control device, intercepting the target data including equipment supplier identification code, equipment identification code, key type, key code and time information, establishing an output port of the multicast network, and outputting the target data to the multicast network to synchronize IPTV equipment receives and performs operation configuration to achieve synchronous control of multiple devices.
It achieves high compatibility and accurate multi-device control, especially the accurate restoration of long-press key operations, simplifying development difficulty, simple operation and high accuracy of synchronous control.
Smart Images

Figure CN118509628B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automated remote control technology, and in particular to an automated control method, device, equipment and storage medium for an IPTV device. Background Art
[0002] Internet Protocol Television (IPTV) is a technology that transmits television programs and video content via the Internet. It uses the IP protocol to convert television signals into digital data and transmits them to users' devices such as smart TVs, computers, and mobile phones via the Internet.
[0003] IPTV devices are mainly controlled by remote control. Sometimes one remote control is needed to control several boxes at the same time to achieve the purpose of controlling multiple IPTV devices at the same time. At present, the method of realizing simultaneous control of multiple devices is mainly to obtain system keys through event processing functions such as onKeyDown and OnKeyUp at the application APP layer.
[0004] The above method cannot achieve real-time background key interception at the APP layer. The APP can only receive the key when the APP is in the front end. When the APP application is switched, the APP is not in the front end and cannot receive the key value thrown by the system, making some system key reception invalid and long key recognition difficult. The limitations are obvious. An IPTV multi-device control method with high compatibility and accurate key restoration is urgently needed. Summary of the invention
[0005] The main purpose of this application is to provide an automatic control method, device, equipment and storage medium for an IPTV device, aiming to solve the technical problems of insufficient compatibility and inaccurate key recognition.
[0006] To achieve the above-mentioned purpose, in a first aspect, the present application provides an automated control method for an IPTV device, the IPTV device comprising a remote control IPTV device and a synchronous IPTV device, the method being applied to the remote control IPTV device, the method comprising: receiving an operation request from the remote control device; intercepting target data from the operation request, the target data comprising a device vendor identification code, a device identification code, a button type, a button code, a button value and time information; establishing an output port of a multicast network for the target data; and outputting the target data to the multicast network through the output port of the multicast network, so that the synchronous IPTV device receives the target data and performs an operation configuration corresponding to the operation request according to the target data.
[0007] Optionally, establishing an output port of a multicast network for target data includes: creating a socket for the target data; configuring the socket by setting a function to obtain a target data handle containing the target data.
[0008] Optionally, the target data is output to the multicast network through the output port of the multicast network, including: creating a message loop set; obtaining the event start file in the / dev / input folder, and opening the event start file through the open program; configuring a callback function for the target data handle to obtain the target data through the callback function; adding the configured target data handle to the message loop set through the message loop function; and outputting the target data to the multicast network through the message loop set.
[0009] Optionally, the target data is output to the multicast network through the message loop set, including: reading and recording the target data contained in the target data handle through a callback function; and outputting the target data to the multicast network through an output port of the multicast network using a socket.
[0010] In a second aspect, the present application provides an automated control method for an IPTV device, the IPTV device comprising a remote control IPTV device and a synchronous IPTV device, the method being applied to the synchronous IPTV device, the method comprising: joining a multicast network; cyclically receiving target data output by the remote control IPTV device, the target data being intercepted from an operation request by the remote control IPTV device through receiving an operation request from the remote control device, and outputting it to the remote control IPTV device through an output port of the multicast network; parsing and obtaining a device vendor identification code, a device identification code, a button type, a button code, a button value, and time information in the target data; writing the button type, button code, button value, and time information into a target synchronous IPTV device corresponding to the device vendor identification code and the device identification code; and performing operation configuration corresponding to the operation request according to the button type, button code, button value, and time information.
[0011] Optionally, the key type, key code, key value and time information are written into the target synchronous IPTV device corresponding to the device vendor identification code and the device identification code, and the method also includes: determining whether the synchronous IPTV device contains the target synchronous IPTV device corresponding to the device vendor identification code and the device identification code; if contained, writing the key type, key code, key value and time information to the target synchronous IPTV device; if not contained, creating a virtual target IPTV device in the / dev / input folder according to the device vendor identification code and the device identification code; and writing the key type, key code, key value and time information to the virtual target IPTV device.
[0012] In a third aspect, the present application provides an automated control device for an IPTV device, the IPTV device including a remote control IPTV device and a synchronous IPTV device, the device being applied to the remote control IPTV device, the device including: a receiving module for receiving an operation request from the remote control device; an interception module for intercepting target data from the operation request, the target data including a device vendor identification code, a device identification code, a button type, a button code, a button value and time information; a port module for establishing an output port of a multicast network for the target data; an output module for outputting the target data to the multicast network through the output port of the multicast network, so that the synchronous IPTV device receives the target data and performs an operation configuration corresponding to the operation request according to the target data.
[0013] Optionally, the port module can be used to create a socket for the target data; the socket is configured by setting the function to obtain a target data handle containing the target data.
[0014] Optionally, the output module can be used to create a message loop set; obtain the event start file in the / dev / input folder, and open the event start file through the open program; configure the callback function for the target data handle to obtain the target data through the callback function; add the configured target data handle to the message loop set through the message loop function; output the target data to the multicast network through the message loop set.
[0015] Optionally, the output module can also be used to read and record the target data contained in the target data handle through a callback function; and output the target data to the multicast network through an output port of the multicast network using a socket.
[0016] In a fourth aspect, the present application provides an automatic control device for an IPTV device, wherein the IPTV device includes a remote control IPTV device and a synchronous IPTV device, and the device is applied to the synchronous IPTV device, and the device includes: a startup module for joining a multicast network; a response module for cyclically receiving target data output by the remote control IPTV device, wherein the target data is intercepted from the operation request by the remote control IPTV device by receiving the operation request from the remote control device, and is output to the remote control IPTV device through the output port of the multicast network; a parsing module for parsing and obtaining the device vendor identification code, device identification code, button type, button code, button value and time information in the target data; a writing module for writing the button type, button code, button value and time information into the target synchronous IPTV device corresponding to the device vendor identification code and the device identification code; and a configuration module for performing operation configuration corresponding to the operation request according to the button type, button code, button value and time information.
[0017] Optionally, the automated control device also includes a judgment module for judging whether the synchronous IPTV device includes a target synchronous IPTV device corresponding to the device vendor identification code and the device identification code; if included, writing the button type, button code, button value and time information to the target synchronous IPTV device; if not included, creating a virtual target IPTV device in the / dev / input folder according to the device vendor identification code and the device identification code; and writing the button type, button code, button value and time information to the virtual target IPTV device.
[0018] In a fifth aspect, the present application provides an electronic device, comprising: a memory, a processor; the memory is used to store program instructions; the processor is used to call program instructions to execute an automatic control method of an IPTV device as provided in any one of the first or second aspects above.
[0019] In a sixth aspect, the present application provides a computer-readable storage medium, in which computer execution instructions are stored. When the computer execution instructions are executed by a processor, they are used to implement the automatic control method of the IPTV device provided in the first aspect or the second aspect above.
[0020] In a seventh aspect, the present application provides a computer program product, including a computer program; when the computer program is executed, it implements the automatic control method of the IPTV device provided in the first aspect or the second aspect above.
[0021] The beneficial effects that can be achieved by this application are: intercepting the operation request of an input device by multicast, synchronizing the operation request to multiple devices in the multicast, and achieving the purpose of controlling multiple devices at the same time. The operation request is restored by using the specific device vendor identification code, device identification code, key type, key code, key value and time information, which can restore more accurately, especially the long key operation that is difficult to record can also be accurately restored, which simplifies the development difficulty, is simple to operate, has high accuracy of synchronous control, and has higher compatibility.
[0022] An automatic control method, apparatus, device and storage medium for IPTV equipment proposed in the embodiment of the present application receive an operation request from a remote control device; intercept target data from the operation request, the target data including a device vendor identification code, a device identification code, a button type, a button code, a button value and time information; establish an output port of a multicast network for the target data; output the target data to the multicast network through the output port of the multicast network, so that a synchronous IPTV device receives the target data and performs operation configuration corresponding to the operation request according to the target data. It only needs to establish multicast logic and ports in the bottom layer of the IPTV device in advance, and there is no need to implement it in the application APP layer, so that the target data can be synchronized to multiple IPTV devices. The implementation scheme has simple steps, good data transmission effect, high degree of remote control command restoration, simple operation and high control accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;
[0024] Figure 2 Schematic diagram of the process of the automatic control method of the IPTV device provided in the embodiment of the present application Figure 1 ;
[0025] Figure 3 Schematic diagram of the process of the automatic control method of the IPTV device provided in the embodiment of the present application Figure 2 ;
[0026] Figure 4 Schematic diagram of the process of the automatic control method of the IPTV device provided in the embodiment of the present application Figure 3 ;
[0027] Figure 5 Schematic diagram of the process of the automatic control method of the IPTV device provided in the embodiment of the present application Figure 4 ;
[0028] Figure 6 Schematic diagram of the structure of the automatic control device of the IPTV device provided in the embodiment of the present application Figure 1 ;
[0029] Figure 7 Schematic diagram of the structure of the automatic control device of the IPTV device provided in the embodiment of the present application Figure 2 ;
[0030] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0031] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings.
[0032] Reference numerals:
[0033] 101-remote control device; 102-remote control IPTV device; 103-synchronous IPTV device; 600-remote control receiving device of IPTV device; 601-receiving module; 602-interception module; 603-port module; 604-output module; 700-remote control synchronization device of IPTV device; 701-starting module; 702-response module; 703-analysis module; 704-writing module; 705-configuration module; 800-electronic device; 801-processor; 802-memory; 803-communication interface; 804-system bus. DETAILED DESCRIPTION
[0034] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0035] The main solution of the embodiment of the present application is: in a scenario where multiple IPTV devices need to be controlled synchronously, the relevant information of the control command received by an IPTV device is multicast by using the multicast network, and other IPTV devices obtain the relevant information of the control command from the multicast network, restore the control command and perform corresponding control configuration to achieve the purpose of synchronously controlling multiple IPTV devices.
[0036] The prior art uses the application layer APP installed in each IPTV device to obtain the system keys in the remote control request through functions such as onKeyDown and OnKeyUp to achieve synchronous control, where onKeyDown is an event handler, which is an event triggered when the user presses a keyboard key, and OnKeyUp is an event processing function, which is triggered when the user presses and releases a keyboard key. Usually, the OnKeyUp event processing function is used to detect whether the key input by the user is a specific key, and to perform the corresponding operation. This solution has great limitations. It is only effective when the application layer APP is at the front end of the device, and because different IPTVs have inconsistent processing methods at the framework layer, some keys cannot be received by the application layer APP.
[0037] For example, system buttons such as home, settings, volume up and down, etc. may not be received by the application layer APP, so they cannot be recorded and restored to the IPTV device. At the framework layer, the interceptKeyBeforeDispatching method can also intercept system button operations. interceptKeyBeforeDispatching is used to intercept key events before they are distributed. The events can be processed or intercepted before they are distributed to the system. In this way, some special key processing can be implemented, such as shielding certain keys or converting certain key events into other operations. However, using this solution requires changing the framework layer code, and this solution does not handle "long press operations" well. For example, long press operations will be processed as a large amount of long press information at this location (such as 50 times in 1 second), and there will be major problems in saving and restoring this information.
[0038] This application provides a solution, through remote control operation on an IPTV device, the IPTV device records all operation key codes and events and other information, and sends the intercepted information through multicast, so that other IPTV devices joining the multicast can synchronously receive all operation information of the IPTV device, so as to restore and configure the data. From the perspective of data capture, the information integrity of the data obtained by multiple devices from the multicast is higher, especially the request information of the long press operation can be restored more accurately; from the perspective of technical solution implementation, the development difficulty is simplified, the compatibility is higher, and the operation is simple.
[0039] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of the present application. Figure 1 As shown, the application scenario includes a remote control device 101 , a remote control IPTV device 102 and a synchronous IPTV device 103 .
[0040] The remote control device 101 is used to send remote control instructions / operation requests to the remote control IPTV device 102, for example, through infrared or radio waves, so that the user can remotely control the remote control IPTV device 102 by controlling the remote control device 101, such as controlling the power switch, volume adjustment, channel switching and other functions of the remote control IPTV device 102.
[0041] The remote control IPTV device 102 refers to a device that can receive the remote control command / operation request of the remote control device 101. After receiving the remote control command / operation request, the remote control IPTV device 102 can synchronize the remote control command / operation request to one or more synchronization IPTV devices 103. The synchronization IPTV device 103 can receive the corresponding remote control command / operation request from the remote control IPTV device 102. Among them, the remote control IPTV device 102 and the synchronization IPTV device 103 can be the same IPTV device. In the same application scenario, the device that receives the operation request from the remote control device and synchronizes the operation request to one or more other IPTV devices is the remote control IPTV device 102, and the other IPTV devices that receive the synchronized operation request are the synchronization IPTV devices 103.
[0042] Figure 2 Schematic diagram of the process of the automatic control method of the IPTV device provided in the embodiment of the present application Figure 1 The IPTV device includes a remote control IPTV device and a synchronous IPTV device, and the method is applied to the remote control IPTV device, such as Figure 2 As shown, the method includes:
[0043] S201: receiving an operation request from a remote control device.
[0044] The remote control IPTV device corresponds to the device 1 in the above-mentioned application scenario embodiment, and is used to receive an operation request executed by the remote control device. The remote control device refers to a device for remotely controlling an electronic device, which usually includes some buttons and an infrared transmitter. By pressing different buttons, different signals can be sent to the IPTV device, thereby realizing the control of the IPTV device. The user performs operations such as pressing buttons, and exemplary operation requests include: turning on / off the IPTV device, adjusting the volume, switching channels or input sources, adjusting brightness / contrast parameters, etc.
[0045] The synchronous IPTV device corresponds to the device 2 to the device 5 in the above application scenario embodiment. The user hopes to be able to control the synchronous IPTV device at the same time when performing remote control operation on the remote-controlled IPTV.
[0046] S202: intercepting target data from the operation request, the target data including the device vendor identification code, the device identification code, the key type, the key code, the key value and the time information.
[0047] The Vendor ID (VID), or manufacturer ID, is a code used to identify the supplier of electronic components. VID is used to indicate the type / model of the remote control device that outputs the operation request. The Product ID (PID) is the identification code of the product device, which is usually defined by the manufacturer and is used to distinguish different models of remote control devices. The key type (type) indicates that the event is a key event type. The key code (code) indicates the value of the key. Different values represent different keys (such as confirmation, menu, power on / off key, volume adjustment key or channel switching key, etc.). The key value (value) indicates whether the key is pressed (down) or released (up). Time information includes key duration information, that is, the length of time the key is pressed, and can also include key start information.
[0048] After receiving the operation request, the remote control IPTV device intercepts the above information from the instruction to record which remote control device has performed a certain key operation on which controlled device for a certain duration. Among them, the key codes can be customized using the two values of VID and PID to identify different remote control devices.
[0049] S203: Establish an output port of the multicast network for the target data.
[0050] The embodiment of the present application sends the operation request from the remote control IPTV device to the synchronous IPTV device by multicast. Multicast is a technology for sending data to multiple hosts at one time on the network, which can effectively reduce the traffic of the network and also save transmission time and bandwidth. The multicast network needs to forward the multicast data from one interface to other interfaces through the multicast interface so as to reach all hosts that need to receive the multicast data. Therefore, it is necessary to establish a data output interface facing the multicast network on the synchronous IPTV device end to output the target data to the multicast network.
[0051] In a specific embodiment, establishing an output port of a multicast network for target data includes: creating a socket for the target data; configuring the socket through a setting function to obtain a target data handle containing the target data. Exemplarily, the socket uses a socket socket, and the setting function can use a setsockopt function. That is, establishing an output port of a multicast network for target data includes: creating a socket socket for the target data; configuring the socket socket through a setsockopt function to obtain a target data handle containing the target data. A socket socket is a communication mechanism, and using a socket socket can create a communication endpoint on a remote control IPTV device. The setsockopt function can be used to set and obtain socket options, which can be used to control the behavior of the socket so that the socket socket can support multicast transmission. Using a socket socket to implement multicast can limit the recipients of data packets, improve the security of data transmission, and achieve on-demand reception.
[0052] S204: Output the target data to the multicast network through the output port of the multicast network, so that the synchronous IPTV device receives the target data and performs operation configuration corresponding to the operation request according to the target data.
[0053] The target data is multicasted to the network range through the output port of the multicast network. All the synchronous IPTV devices within the multicast network range can receive the multicast data, and then restore the operation request through the received target data, and then execute the operation configuration corresponding to the operation request.
[0054] The embodiment of the present application receives an operation request from a remote control device; intercepts target data from the operation request, the target data including a device vendor identification code, a device identification code, a button type, a button code, a button value and time information; establishes an output port of a multicast network for the target data; and outputs the target data to the multicast network through the output port of the multicast network, so that the synchronous IPTV device receives the target data and performs an operation configuration corresponding to the operation request according to the target data. The operation request input to a device is intercepted by multicast, and the operation request is synchronized to multiple devices in the multicast, so as to achieve the purpose of controlling multiple devices at the same time. From the dimension of data capture, the information integrity of the data obtained by multiple devices from the multicast is higher, and the operation request is restored by using the vendor identification code, device identification code, button type, button code, button value and time information, which can more accurately restore and reproduce, especially the operation request of a long button; from the dimension of technical solution implementation, the development difficulty is simplified, the compatibility is higher, and the operation is simple.
[0055] On the basis of the above embodiment, optionally, the target data is output to the multicast network through the output port of the multicast network, including: creating a message loop set; obtaining the event start file in the / dev / input folder, and opening the event start file through the open program; configuring a callback function for the target data handle to obtain the target data through the callback function; adding the configured target data handle to the message loop set through the message loop function; and outputting the target data to the multicast network through the message loop set.
[0056] Exemplarily, the message loop set uses the aLooper set, and the message loop function uses the ALooper_addFd function. That is, create an aLooper set; obtain the event start file in the / dev / input folder, and open the event start file through the open program; configure the callback function for the target data handle to obtain the target data through the callback function; add the configured target data handle to the aLooper set through the ALooper_addFd function; output the target data to the multicast network through the aLooper set. The embodiment of the present application is suitable for application scenarios where multiple devices exist at the same time, such as monitoring two input devices at the same time in one thread, such as two remote control operations A and B. This solution can process key operations from multiple remote control devices at the same time.
[0057] The aLooper collection is an event loop mechanism in the Android system. The event loop can implement a series of asynchronous tasks such as user interaction, network communication, IO operations, etc. The aLooper collection is a collection that contains multiple Loopers. Its function is to provide an event loop mechanism so that Android applications can respond to asynchronous events such as user input events, network events, IO events, etc. Each thread has a Looper object, which will keep looping and waiting for the arrival of messages. The aLooper collection is a collection that manages multiple Looper objects. Through this collection, message transmission between multiple threads can be realized.
[0058] The / dev / input folder is a special folder in the Linux system, mainly used to interact with input devices. In this folder, each input device corresponds to a file, and the event file records the event information generated when the user uses the input device. Get the event start file in the / dev / input folder, that is, get all the device files that start with the event, and open these files one by one through the open program.
[0059] Optionally, the target data is output to the multicast network through the aLooper collection, including: reading and recording the target data contained in the target data handle through the callback function; outputting the target data to the multicast network through the output port of the multicast network using the socket. The callback function is a function pointer that points to a function defined by the user and is called when a specific event occurs. The callback function is used to implement the following functions: read the data on the handle (for the purpose of receiving user operation requests); parse the read data and write records in the order of VID, PID, key type, key code, key value and time information, and send it through the socket; add fd to the waiting event loop by calling ALooper_addFd (for the purpose of receiving the next user operation request). The above event loop is executed cyclically, waiting for the opened target data handle to obtain key value related data.
[0060] Figure 3 Schematic diagram of the process of the automatic control method of the IPTV device provided in the embodiment of the present application Figure 2 , shows a specific implementation method of outputting an operation request from a remote control IPTV device to a synchronous IPTV device. Figure 3 As shown, the method includes:
[0061] S301: Create a socket for target data;
[0062] S302: configuring the socket by setting a function to obtain a target data handle containing target data;
[0063] S303: Create a message loop set;
[0064] S304: Obtain the event start file in the / dev / input folder, and open the event start file through the open program;
[0065] S305: configuring a callback function for the target data handle to obtain the target data through the callback function;
[0066] S306: adding the configured target data handle to the message loop set through the message loop function;
[0067] S307: Output the target data to the multicast network through the message loop set.
[0068] Similarly, the target data is output to the multicast network using a socket. With simple underlying configuration, the purpose of synchronous control of multiple IPTV devices can be achieved.
[0069] Figure 4 Schematic diagram of the process of the automatic control method of the IPTV device provided in the embodiment of the present application Figure 3The IPTV device includes a remote control IPTV device and a synchronous IPTV device. The method shown in this embodiment is applied to the synchronous IPTV device. Figure 4 As shown, the method includes:
[0070] S401: Joining the multicast network;
[0071] S402: cyclically receiving target data output by the remote control IPTV device, where the target data is intercepted from the operation request received by the remote control IPTV device and output to the remote control IPTV device through the output port of the multicast network;
[0072] S403: Parse and obtain the device vendor identification code, device identification code, key type, key code, key value and time information in the target data;
[0073] S404: writing the key type, key code, key value and time information into the target synchronous IPTV device corresponding to the device vendor identification code and the device identification code;
[0074] S405: Perform operation configuration corresponding to the operation request according to the key type, key code, key value and time information.
[0075] The embodiment of the present application adds a synchronous IPTV device to a multicast network, receives target information intercepted by a remote-controlled IPTV device after receiving an operation request, and restores the operation request based on the target information, and performs corresponding operation configuration. The operation configuration is consistent with the operation configuration made by the remote-controlled IPTV device, and the remote-controlled IPTV device and the synchronous IPTV device achieve synchronous remote control. The operation request restored using button type, button code, button value and time information is more accurate and simple to operate.
[0076] On the basis of the above embodiment, optionally, the button type, button code, button value and time information are written into the target synchronous IPTV device corresponding to the device vendor identification code and the device identification code, which also includes: judging whether the synchronous IPTV device includes the target synchronous IPTV device corresponding to the device vendor identification code and the device identification code; if included, writing the button type, button code, button value and time information to the target synchronous IPTV device; if not included, creating a virtual target IPTV device in the / dev / input folder according to the device vendor identification code and the device identification code; and writing the button type, button code, button value and time information to the virtual target IPTV device.
[0077] Specifically, a virtual device is created according to the VID and PID information to obtain the virtual device file descriptor; an input_event event is created, and the key type, key code, key value and time information are written into the virtual device file descriptor. When a virtual device is created, the system will receive the key value from the created virtual device; if a virtual device is not created, the restored key value will not be received when the corresponding target synchronous IPTV device is not included. The virtual device receives the target data from the multicast, and then writes the target data into the device for restoration by creating a device handle. After restoration, the system can receive the remote control command.
[0078] Figure 5 Schematic diagram of the process of the automatic control method of the IPTV device provided in the embodiment of the present application Figure 4 , shows a specific embodiment of the present application, such as Figure 5 As shown, the method includes:
[0079] S501: Joining the multicast network;
[0080] S502: cyclically receiving target data output by the remote control IPTV device, where the target data is intercepted from the operation request received by the remote control IPTV device and output to the remote control IPTV device through the output port of the multicast network;
[0081] S503: Parse and obtain the device vendor identification code, device identification code, key type, key code, key value and time information in the target data;
[0082] S504: Determine whether the synchronized IPTV devices include a target synchronized IPTV device corresponding to the device vendor identification code and the device identification code;
[0083] S505: If included, write the key type, key code, key value and time information to the target synchronous IPTV device;
[0084] S506: If not, create a virtual target IPTV device in the / dev / input folder according to the device vendor identification code and the device identification code;
[0085] S507: Write the button type, button code, button value and time information to the virtual target IPTV device.
[0086] The above embodiments have described in detail the automatic control method of the IPTV device provided by the present application. The following will specifically explain the automatic control device, electronic device, storage medium and program product of the IPTV device provided by the embodiments of the present application.
[0087] Figure 6Schematic diagram of the structure of the automatic control device of the IPTV device provided in the embodiment of the present application Figure 1 .like Figure 6 As shown, the automatic control device of the IPTV device is a remote control receiving device 600 of the IPTV device, including:
[0088] The receiving module 601 is used to receive an operation request from a remote control device;
[0089] The interception module 602 is used to intercept target data from the operation request, the target data including the device vendor identification code, the device identification code, the key type, the key code, the key value and the time information;
[0090] Port module 603, used to establish an output port of the multicast network for target data;
[0091] The output module 604 is used to output the target data to the multicast network through the output port of the multicast network, so that the synchronous IPTV device receives the target data and performs operation configuration corresponding to the operation request according to the target data.
[0092] Optionally, the port module 603 can be used to create a socket for the target data; configure the socket by setting a function to obtain a target data handle containing the target data.
[0093] Optionally, the output module 604 can be used to create a message loop set; obtain the event start file in the / dev / input folder, and open the event start file through the open program; configure a callback function for the target data handle to obtain the target data through the callback function; add the configured target data handle to the message loop set through the message loop function; and output the target data to the multicast network through the message loop set.
[0094] Optionally, the output module 604 may also be used to read and record the target data contained in the target data handle through a callback function; and output the target data to the multicast network through an output port of the multicast network using a socket.
[0095] Figure 7 Schematic diagram of the structure of the automatic control device of the IPTV device provided in the embodiment of the present application Figure 2 .like Figure 7 As shown, the automatic control device of the IPTV device is a remote control synchronization device 700 of the IPTV device, including:
[0096] A startup module 701 is used to join a multicast network;
[0097] The response module 702 is used to cyclically receive target data output by the remote control IPTV device, where the target data is intercepted from the operation request received by the remote control IPTV device and output to the remote control IPTV device through the output port of the multicast network;
[0098] The parsing module 703 is used to parse and obtain the device vendor identification code, device identification code, key type, key code, key value and time information in the target data;
[0099] A writing module 704 is used to write the key type, key code, key value and time information into the target synchronous IPTV device corresponding to the device vendor identification code and the device identification code;
[0100] The configuration module 705 is used to perform operation configuration corresponding to the operation request according to the key type, key code, key value and time information.
[0101] Optionally, the remote control synchronization device 700 of the IPTV device also includes a judgment module, which is used to judge whether the synchronized IPTV device contains a target synchronized IPTV device corresponding to the device vendor identification code and the device identification code; if it does, write the button type, button code, button value and time information to the target synchronized IPTV device; if it does not, create a virtual target IPTV device in the / dev / input folder according to the device vendor identification code and the device identification code; write the button type, button code, button value and time information to the virtual target IPTV device.
[0102] The device provided in the embodiment of the present application can be used to execute the above-mentioned automatic control method of the IPTV device. Its implementation method and technical effect are similar and will not be repeated here.
[0103] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 8 As shown, the electronic device 800 includes:
[0104] Processor 801 , memory 802 , communication interface 803 and system bus 804 .
[0105] Among them, the memory 802 and the communication interface 803 are connected to the processor 801 through the system bus 804 and complete communication with each other. The memory 802 is used to store computer execution instructions, the communication interface 803 is used to communicate with other devices, and the processor 801 is used to execute computer execution instructions to execute the solution of the IPTV device automatic control method as described in the above method embodiment.
[0106] Specifically, the processor 801 may include one or more processing units, for example, the processor 801 may be a CPU, or a digital signal processing (DSP), an application specific integrated circuit (ASIC), etc. A general processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in the application may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0107] The memory 802 can be used to store program instructions. The memory 802 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 800 (such as audio data, etc.), etc. In addition, the memory 802 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (Universal Flash Storage, referred to as UFS), etc. The processor 801 executes various functional applications and data processing of the electronic device 800 by running the program instructions stored in the memory 802.
[0108] The communication interface 803 can provide solutions for wireless communications including 2G / 3G / 4G / 18G applied to the electronic device 800. The communication interface 803 can receive electromagnetic waves through the antenna, filter, amplify and other processes the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The communication interface 803 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna. In some embodiments, at least some functional modules of the communication interface 803 can be set in the processor 801. In some embodiments, at least some functional modules of the communication interface 803 can be set in the same device as at least some modules of the processor 801.
[0109] The system bus 804 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus 804 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0110] It should be noted that the number of the memory 802 and the processor 801 is not limited in the embodiment of the present application, and they can be one or more. Figure 8 Take one as an example for illustration; the memory 802 and the processor 801 can be connected by wire or wireless in various ways, such as through a bus connection. In practical applications, the electronic device 800 can be various forms of computers or mobile terminals. Among them, the computer is, for example, a laptop computer, a desktop computer, a workbench, a server, a blade server, a mainframe computer, etc.; the mobile terminal is, for example, a personal digital assistant, a cellular phone, a smart phone, a wearable device, and other similar computing devices.
[0111] The electronic device of this embodiment can be used to execute the technical solution in the above method embodiment. Its implementation principle and technical effect are similar and will not be described in detail here.
[0112] The embodiment of the present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the solution of the automatic control method of the IPTV device in the above method embodiment.
[0113] The embodiment of the present application also provides a computer program product, including a computer program; when the computer program is executed, the solution of the automatic control method of the IPTV device in the above method embodiment is implemented.
[0114] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. An automatic control method for an IPTV device, characterized in that: The IPTV device includes a remote control IPTV device and a synchronous IPTV device, and the method is applied to the remote control IPTV device, and the method includes: receiving an operation request from a remote control device; intercepting target data from the operation request, the target data including a device vendor identification code, a device identification code, a key type, a key code, a key value, and time information; Establishing an output port of a multicast network for the target data; Outputting the target data to the multicast network through an output port of the multicast network, so that the synchronous IPTV device receives the target data and performs an operation configuration corresponding to the operation request according to the target data; The step of establishing an output port of a multicast network for the target data comprises: Creating a socket for the target data; Configure the socket by setting a function to obtain a target data handle containing the target data; The step of outputting the target data to the multicast network through an output port of the multicast network includes: Create a message loop collection; Get the event start file in the / dev / input folder, and open the event start file through the open program; configuring a callback function for the target data handle to obtain the target data through the callback function; Adding the configured target data handle to the message loop set through a message loop function; The target data is output to the multicast network through the message loop set.
2. The automated control method according to claim 1, characterized in that: The step of outputting the target data to the multicast network through the message loop set includes: Read and record the target data contained in the target data handle through the callback function; The target data is output to the multicast network through the output port of the multicast network using the socket.
3. An automatic control method for an IPTV device, characterized in that: The IPTV device includes a remote control IPTV device and a synchronous IPTV device, and the method is applied to the synchronous IPTV device, and the method includes: Join a multicast network; cyclically receiving target data output by the remote control IPTV device, wherein the target data is intercepted from the operation request received by the remote control IPTV device and output to the remote control IPTV device through an output port of the multicast network; Parse and obtain the device vendor identification code, device identification code, key type, key code, key value and time information in the target data; Writing the button type, button code, button value and time information into the target synchronous IPTV device corresponding to the device vendor identification code and the device identification code; Performing operation configuration corresponding to the operation request according to the key type, key code, key value and time information; Wherein, the step of writing the key type, key code, key value and time information into the target synchronous IPTV device corresponding to the device vendor identification code and the device identification code further includes: Determining whether the synchronous IPTV devices include a target synchronous IPTV device corresponding to the device vendor identification code and the device identification code; If included, write the button type, button code, button value and time information to the target synchronous IPTV device; If not, create a virtual target IPTV device in the / dev / input folder according to the device vendor identification code and the device identification code; The key type, key code, key value and time information are written to the virtual target IPTV device.
4. An automatic control device for IPTV equipment, characterized in that: The IPTV device includes a remote control IPTV device and a synchronous IPTV device, and the device is applied to the remote control IPTV device, and the device includes: A receiving module, used for receiving an operation request from a remote control device; An interception module, used to intercept target data from the operation request, wherein the target data includes a device vendor identification code, a device identification code, a key type, a key code, a key value and time information; A port module, used for establishing an output port of a multicast network for the target data; an output module, configured to output the target data to the multicast network through an output port of the multicast network, so that the synchronous IPTV device receives the target data and performs an operation configuration corresponding to the operation request according to the target data; Wherein, the port module is specifically used for: Creating a socket for the target data; Configure the socket by setting a function to obtain a target data handle containing the target data; The output module is specifically used for: Create a message loop collection; Get the event start file in the / dev / input folder, and open the event start file through the open program; configuring a callback function for the target data handle to obtain the target data through the callback function; Adding the configured target data handle to the message loop set through a message loop function; The target data is output to the multicast network through the message loop set.
5. An automatic control device for IPTV equipment, characterized in that: The IPTV device includes a remote control IPTV device and a synchronous IPTV device, and the apparatus is applied to the synchronous IPTV device, and the apparatus includes: Startup module, used to join the multicast network; a response module, configured to cyclically receive target data output by the remote control IPTV device, wherein the target data is intercepted from the operation request received by the remote control IPTV device and output to the remote control IPTV device through an output port of the multicast network; A parsing module, used to parse and obtain the device vendor identification code, device identification code, key type, key code, key value and time information in the target data; A writing module, used to write the key type, key code, key value and time information into the target synchronous IPTV device corresponding to the device vendor identification code and the device identification code; A configuration module, configured to perform operation configuration corresponding to the operation request according to the key type, key code, key value and time information; The device further comprises a judging module, which is used for, before the writing module writes the key type, key code, key value and time information into the target synchronous IPTV device corresponding to the device vendor identification code and the device identification code, Determining whether the synchronous IPTV devices include a target synchronous IPTV device corresponding to the device vendor identification code and the device identification code; If included, write the button type, button code, button value and time information to the target synchronous IPTV device; If not, create a virtual target IPTV device in the / dev / input folder according to the device vendor identification code and the device identification code; The key type, key code, key value and time information are written to the virtual target IPTV device.
6. An electronic device, characterized in that: include: Memory, processor; The memory is used to store program instructions; The processor is used to call the program instructions to execute the automatic control method of the IPTV device according to any one of claims 1 to 3.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the automatic control method of the IPTV device according to any one of claims 1 to 3 when executed by the processor.
Citation Information
Patent Citations
Television state synchronization method and system and terminals
CN108900887A
