Set top box control method, system and device based on local area network and storage medium
By constructing a two-way interactive architecture within a local area network and utilizing an optimized service discovery protocol and a non-blocking communication framework, the problem of two-way collaborative control in set-top box remote control technology was solved, achieving efficient and stable multi-screen interaction and improved user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-19
- Publication Date
- 2026-03-13
AI Technical Summary
Existing set-top box remote control technology relies on third-party servers or uses a one-way communication mechanism, making it difficult to achieve true two-way collaborative control and resulting in a poor user experience.
By constructing a bidirectional interactive architecture based on a local area network and utilizing an optimized simple service discovery protocol and a non-blocking input/output communication framework, efficient collaborative control between mobile terminals and set-top boxes is achieved, including standardized processing of device discovery, data acquisition, and control commands.
It enables low-latency, high-reliability two-way collaborative control between mobile terminals and set-top boxes, improves the real-time performance and stability of multi-screen interaction, reduces operating costs and network latency, and provides a good user experience.
Smart Images

Figure CN121665049A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of set-top box control technology, specifically to a set-top box control method, system, device, and storage medium based on a local area network. Background Technology
[0002] Currently, the technical implementation paths for mobile phone remote control of set-top boxes mainly include the following three solutions: First, based on local area network screen projection technology, after the mobile terminal obtains media resources, it transmits the content one-way to the set-top box device through wireless screen mirroring technology; Second, based on media server architecture, the mobile terminal obtains program metadata and displays it, and sends control commands to the set-top box through the server relay or directly; Third, based on infrared or Bluetooth communication technology, the mobile phone realizes one-way control command transmission by simulating physical remote control key value signals.
[0003] Existing technical solutions have the following limitations: the first two types of solutions rely on third-party server support, which not only increases operating costs but also makes them susceptible to network fluctuations, while the development cost for set-top box compatibility is relatively high; while solutions using infrared or Bluetooth technology lack content visualization and interactive functions, have limited practical value, and have certain requirements for mobile phone hardware configuration, making the operation process relatively complex. Therefore, existing set-top box remote control technologies rely on third-party servers or use one-way communication mechanisms, making it difficult to achieve true two-way collaborative control, and there is an urgent need to improve the user experience. Summary of the Invention
[0004] In view of the above-mentioned shortcomings of the prior art, this application provides a set-top box control method, system, device and storage medium based on local area network, which effectively solves the problem that the existing set-top box remote control technology cannot effectively achieve two-way collaborative control.
[0005] In a first aspect, this application provides a set-top box control method based on a local area network, the method being applied to a mobile terminal, the method comprising: Based on the optimized Simple Service Discovery Protocol, a device discovery request is sent within the local area network to obtain the set-top box's network connection information; Establish a communication connection with the set-top box based on the network connection information, and send a data acquisition request; Obtain standardized data sent by the set-top box, and generate a user interface based on the standardized data; Control commands are generated based on the touch operations of the user interface, and the control commands are sent to the set-top box to control the set-top box to perform corresponding operations.
[0006] In an optional implementation, the optimized simple service discovery protocol includes: When querying services, filters can be performed based on service type, service version, and service attributes, and a list of similar services can be returned in batches.
[0007] In an optional implementation, the control command is a triplet control command, and the generation of the control command based on the touch operation of the user interface includes: The operation type code is obtained by performing single-byte hexadecimal encoding based on the operation type of the touch operation. The target identifier code is obtained by performing a mixed string and number encoding on the touch target identifier corresponding to the touch operation; Dynamically adapt the operation parameters according to the operation type to obtain the operation parameter code; The operation type code, the target identifier code, and the operation parameter code are encapsulated to generate the triplet control instruction.
[0008] Secondly, this application provides a set-top box control method based on a local area network, the method being applied to a set-top box, the method comprising: Based on a non-blocking input / output communication framework, listen for device discovery requests from mobile terminals within the local area network and send network connection information to the mobile terminals; Receive the data acquisition request from the mobile terminal, standardize and encapsulate the full desktop data using a standard data structure, obtain standardized data, and send it to the mobile terminal; The system receives control commands from the mobile terminal, performs corresponding operations based on the control commands, and sends the execution results to the mobile terminal.
[0009] In an optional implementation, the standardization and encapsulation of the entire desktop data using a standard data structure includes: Perform format analysis and field extraction on the full desktop data to obtain data fields and hierarchical relationships; Design the basic key-value pair fields and hierarchical indexing rules of the standard data structure; The data fields are converted into normalized fields based on the basic key-value pair fields, and the hierarchical relationship is converted into a hierarchical index based on the hierarchical indexing rules; The standardized fields and the hierarchical index are encapsulated into the standard data structure, and the standard data structure is validated and adjusted.
[0010] In an optional implementation, the method further includes: A heartbeat message is periodically generated and sent to the mobile terminal. The heartbeat message is set with an update flag. When the standardized data is updated, the update flag becomes valid.
[0011] Thirdly, this application provides a set-top box control system based on a local area network, the system being applied to a mobile terminal, the system comprising: The information acquisition module is used to send device discovery requests within the local area network based on the optimized Simple Service Discovery Protocol to obtain the set-top box's network connection information; A communication connection module is used to establish a communication connection with the set-top box based on the network connection information and to send a data acquisition request; The interface generation module is used to acquire standardized data sent by the set-top box and generate a user interface based on the standardized data. The operation control module is used to generate control commands based on the touch operation of the user interface, and send the control commands to the set-top box to control the set-top box to perform corresponding operations.
[0012] Fourthly, this application provides a set-top box control system based on a local area network (LAN), the system being applied to a set-top box, the system comprising: The information sending module is used to listen for device discovery requests from mobile terminals within the local area network based on a non-blocking input / output communication framework, and to send network connection information to the mobile terminals. The data encapsulation module is used to receive the data acquisition request from the mobile terminal, encapsulate the full desktop data in a standardized manner using a standard data structure, obtain standardized data, and send it to the mobile terminal. The operation execution module is used to receive control commands from the mobile terminal, perform corresponding operations according to the control commands, and send the execution results to the mobile terminal.
[0013] Fifthly, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the set-top box control method based on a local area network as described in the first or second aspect of this application.
[0014] Sixthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the set-top box control method based on a local area network as described in the first or second aspect of this application.
[0015] The set-top box control method, system, device, and storage medium provided in this application, based on a local area network (LAN), achieves efficient collaborative control between mobile terminals and set-top boxes by constructing a bidirectional interactive architecture based on direct LAN connection, significantly improving the real-time performance and stability of multi-screen interaction. A non-blocking input / output communication framework is used to establish a communication connection, combined with an optimized simple service discovery protocol to achieve rapid device discovery, eliminating dependence on third-party servers and reducing end-to-end costs and network latency. By using a standard data structure combining value pairs and hierarchical index keys, the full data format of the set-top box desktop is unified, enabling full synchronous display and dynamic updates of native set-top box content on mobile terminals, resulting in a superior user experience and broad application prospects. Attached Figure Description
[0016] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a first schematic diagram of the set-top box control method based on a local area network provided in the embodiments of this application; Figure 2 This is a second schematic diagram of the set-top box control method based on a local area network provided in the embodiments of this application; Figure 3 This is a first schematic diagram of the structure of a set-top box control system based on a local area network provided in an embodiment of this application; Figure 4 This is a second schematic diagram of the structure of a set-top box control system based on a local area network provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0018] Explanation of key component symbols: 200. Local area network-based set-top box control system; 210. Information acquisition module; 220. Communication connection module; 230. Interface generation module; 240. Operation control module; 250. Information transmission module; 260. Data encapsulation module; 270. Operation execution module; 300. Electronic device; 310. Processor; 320. Communication interface; 330. Memory; 340. Communication bus. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be further described clearly and completely below with reference to the accompanying drawings of the embodiments. It should be noted that the described embodiments are merely some embodiments of this application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0020] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of this application.
[0022] In set-top box remote control solutions, both LAN-based and media server-based solutions require third-party server support. This not only increases operational costs for hardware deployment, software development, and security authentication, but also makes them susceptible to network fluctuations, leading to issues such as program loading delays and command loss. Furthermore, the set-top box needs to adapt to various complex screen mirroring technologies, resulting in high compatibility development costs. Infrared or Bluetooth-based solutions only support one-way command transmission, lacking content visualization and interaction. Their practicality is limited by communication distance and obstructions, and they also have special hardware requirements, needing to be compatible with the same screen mirroring protocol as the set-top box, resulting in high operational complexity. Therefore, existing set-top box remote control technologies rely on third-party servers or use one-way communication mechanisms, making it difficult to achieve true two-way collaborative control, and there is an urgent need to improve the user experience.
[0023] Example 1 This application provides a set-top box control method based on a local area network (LAN), effectively solving the problem that existing set-top box remote control technologies cannot effectively achieve bidirectional collaborative control. The method is applied to both a mobile terminal and a set-top box, which connect to the same routing device via a wireless network, forming a LAN. This routing device, acting as the physical transmission channel of the LAN, supports the TCP / IP protocol, ensuring low-latency data and command transmission. The routing device provides IP address allocation and data forwarding, placing all three on the same subnet, achieving low-latency and highly reliable data interaction, and providing the basic network environment for bidirectional collaboration between the mobile terminal and the set-top box.
[0024] Figure 1This is a first schematic diagram of the set-top box control method based on a local area network provided in the embodiments of this application, as shown below. Figure 1 As shown, when applied to a mobile terminal, this method includes the following steps: S110: Based on the optimized Simple Service Discovery Protocol, a device discovery request is sent within the local area network to obtain the network connection information of the set-top box.
[0025] In this embodiment, the standard Simple Service Discovery Protocol (SSDP) is optimized. The mobile terminal uses the optimized SSDP to traverse network nodes within the same local area network (LAN), enabling rapid scanning and identification of set-top box devices within the same LAN within 2 seconds. Based on the scan results, the mobile terminal can display the model information, IP address, and service port number of each set-top box device, facilitating intuitive selection and connection establishment by the user.
[0026] The optimized Simple Service Discovery Protocol (SLP) improves scanning efficiency through service classification and filtering mechanisms and batch discovery mechanisms. The service classification and filtering mechanism introduces refined service matching rules into device discovery requests, supporting filtering by service type, version number, and custom attributes, such as `urn:schemas-upnp-org:service:PrintService:1`. By carrying explicit service identifiers in the query messages, the set-top box only responds to requests that match the criteria, effectively avoiding redundant responses from irrelevant devices, significantly reducing the risk of network broadcast storms, and improving the accuracy and response speed of the device discovery process.
[0027] The batch discovery mechanism allows mobile terminals to initiate discovery requests for multiple service types at once, reducing the number of times probe packets are sent repeatedly. Simultaneously, the server has batch response capabilities; when multiple instances of the same type of set-top box are detected, information from multiple set-top boxes can be integrated into a single response message or sent in short bursts of concise responses, thereby improving communication efficiency and shortening overall scanning time.
[0028] When a mobile terminal discovers a set-top box, it obtains the set-top box's network connection information, which includes, but is not limited to, IP address, service port number, and device model.
[0029] S120. Establish a communication connection with the set-top box based on the network connection information and send a data acquisition request.
[0030] In this embodiment, the mobile terminal establishes a one-to-one long connection with the set-top box's server via TCP protocol based on the obtained IP address and service port number, while ensuring connection stability and avoiding frequent disconnections through a non-blocking input / output (NIO) communication framework.
[0031] Optionally, the mobile terminal allows users to customize the set-top box device name to facilitate differentiation among multiple set-top box scenarios, and automatically saves connection records for quick reconnection upon next startup.
[0032] After the communication connection is established, the mobile terminal automatically sends a data acquisition request for the full data of the Launcher desktop launcher to the set-top box, supporting switching between incremental requests and full requests, where incremental requests only acquire updated data.
[0033] S130: Obtain standardized data sent by the set-top box and generate a user interface based on the standardized data.
[0034] In this embodiment, the mobile terminal receives standardized data sent by the set-top box. This standardized data fully maps the original interface layout and content information of the set-top box launcher, including but not limited to homepage sections, live channels, movie and TV categories, and user favorites. The mobile terminal parses the received standardized data and dynamically reconstructs a user interface that is consistent with the structure of the set-top box launcher and has a coordinated visual presentation based on its hierarchical relationship and control attributes, thereby achieving cross-terminal content visualization synchronization.
[0035] As an optional implementation of this application, in order to adapt to diverse mobile device screen sizes and users' personalized operating habits, the layout ratio and typography strategy of user interface elements can be automatically adjusted according to display parameters such as the resolution and aspect ratio of the mobile terminal screen, so as to ensure that the user interface can be presented completely and beautifully on different models of devices, and avoid problems such as layout disorder and text truncation.
[0036] It also supports user gesture zooming of the user interface, with the zoom range adjustable from 0.8 to 2.0 times to meet the visual needs of different scenarios. For example, elderly users can zoom in to more clearly identify channel names and icons, while on smaller screens, they can zoom out to view more content. All zooming operations maintain consistency in the relative positions of the original controls and the interaction logic, ensuring a smooth user experience.
[0037] In addition, users can drag and drop to adjust or preset the order of the columns displayed on the user interface according to usage frequency or personal preference. The mobile terminal will save the customized layout locally and can restore it after reconnection or restart, improving the convenience and user-friendliness of long-term use.
[0038] Optionally, when a state change occurs on the set-top box, such as when a user switches TV channels, launches a new application, or updates a program guide using another remote control, the mobile terminal identifies the data change by obtaining the update flag from the heartbeat information sent by the set-top box and triggers an incremental update process. After receiving the update notification, the mobile terminal actively retrieves the latest data and refreshes the corresponding user interface area, ensuring that the mobile terminal interface always remains consistent with the current state of the set-top box, achieving true two-way state synchronization.
[0039] S140. Generate control commands based on the touch operation of the user interface, and send the control commands to the set-top box to control the set-top box to perform the corresponding operation.
[0040] In this embodiment, the mobile terminal captures user touch operations based on the user interface, such as clicking a live channel, swiping to switch categories, and long-pressing to favorites. This touch operation is encapsulated into a triplet control instruction consisting of "operation type + target identifier + parameter." The number of bytes transmitted for this triplet control instruction is ≤64B, and it is sent to the set-top box in real time via the NIO communication framework. The specific steps for generating the triplet control instruction based on the user interface touch operations include the following: First, the operation type of the touch operation is encoded in hexadecimal using a single byte to obtain the operation type code. Specifically, the operation type is encoded using a single byte of hexadecimal, covering the core touch operations, where the byte length of the operation type code is 1 byte.
[0041] For example, the core touch operation codes are as follows: 0x01 represents a single click, 0x02 represents a double click, 0x03 represents a long press, 0x04 represents a swipe, 0x05 represents a drag, 0x06 represents a pinch to zoom, 0x07 represents a rotation, and 0x00 represents an invalid operation, i.e., a placeholder or error handling.
[0042] Next, the target identifier is encoded by a mixture of strings and numbers based on the touch target identifier corresponding to the touch operation to obtain the target identifier code.
[0043] In this embodiment of the application, it is necessary to ensure that the byte length of the target identifier encoding is 8B. If the byte length after encoding is less than 8B, it is padded with 0x00. If the byte length exceeds 8B, it is truncated and the first 8 characters are used for encoding.
[0044] Optionally, the touch target identifier may include, but is not limited to, control ID, region number, and screen partition. For example, if the control ID is "btn_submit", then the target identifier after mixed string and number encoding is 0x62746E5F7375626D.
[0045] Then, the operation parameters are dynamically adapted according to the operation type to obtain the operation parameter encoding, which has a byte length not exceeding 55 bytes. Operation-related parameters, such as coordinates, duration, and sliding direction, are stored, dynamically adapted according to the operation type, and padded with 0x00 if no parameters are present.
[0046] For example, when the operation type is a single click or double click, the parameter is the x-coordinate (4B) + y-coordinate (4B), with a total length of 8 bytes. It is stored in decimal to hexadecimal format. For example, when the x-coordinate is 320, the corresponding parameter code is 0x00000140. When the operation type is a long press, the parameter is the x-coordinate (4B) + y-coordinate (4B) + long press duration (2B), with a total length of 10 bytes. The duration is in milliseconds (ms). For example, 3000ms corresponds to the parameter code 0x0BB8. When the operation type is a swipe or drag, the parameter is the starting x-coordinate (4B) + starting y-coordinate (4B) + ending x-coordinate (4B) + ending y-coordinate (4B) + swipe duration (2B), with a total length of 18 bytes. The direction is derived from the starting and ending coordinates. When the operation type is pinch-to-zoom, the parameters are the center point x-coordinate (4B) + center point y-coordinate (4B) + scaling ratio (2B) + operation duration (2B), with a total length of 12 bytes. The scaling ratio is multiplied by 100. For example, the parameter code corresponding to a scaling ratio of 1.5 is 0x0096. When the operation type is rotation, the parameters are the center point x-coordinate (4B) + center point y-coordinate (4B) + rotation angle (2B) + operation duration (2B), with a total length of 12 bytes. The angle unit is degrees. For example, the parameter code corresponding to 90 degrees is 0x005A.
[0047] Finally, the operation type encoding, target identifier encoding, and operation parameter encoding are encapsulated to generate a triplet control instruction.
[0048] For example, for the touch operation of "clicking the login button (btn_login), coordinates (320, 480)," the generated triplet control instruction is "0x01 0x62746E5F6C6F6769 0x00000140 0x000001E0". For the touch operation of "long pressing list item 3 (item_03), coordinates (200, 300), duration 3 seconds", the generated triplet control instruction is "0x030x6974656D5F303300 0x000000C8 0x0000012C 0x00000BB8". For the touch operation of "sliding from coordinates (100,200) to coordinates (500,400) for 1.5 seconds", the generated triplet control command is "0x040x73637265656E0000 0x00000064 0x000000C8 0x000001F4 0x00000190 0x000005DC".
[0049] The lightweight triplet control instruction generated in this embodiment has a simple structure, with only 64 bytes, significantly reducing transmission overhead and improving response speed. The standardized format of the triplet control instruction is compatible with various touch operations, shielding the hardware differences between mobile terminals and set-top boxes, enabling precise control. Its lightweight design is adaptable to ordinary smartphones and other terminals, requiring no dedicated modules, lowering the barrier to user access, and enhancing data transmission stability and real-time interactive experience.
[0050] Figure 2 This is a second schematic diagram of the set-top box control method based on a local area network provided in the embodiments of this application, as shown below. Figure 2 As shown, when applied to a set-top box, this method includes the following steps: S210: Based on a non-blocking input / output communication framework, listen for device discovery requests from mobile terminals within the local area network and send network connection information to the mobile terminals.
[0051] In this embodiment, the set-top box server adopts a non-blocking input / output communication framework based on NIO (Non-blocking I / O) to efficiently listen to and process device discovery requests from mobile terminals within the local area network. This non-blocking input / output communication framework supports the entire process management of device discovery, connection establishment, data interaction, and control command transmission, and has high concurrency capabilities, allowing a single set-top box to stably respond to simultaneous connections from multiple mobile terminals.
[0052] As an optional implementation of this application, a non-blocking input / output communication framework centered on a selector is constructed, which mainly includes the following key components: The Selector, acting as a multiplexer, uniformly monitors I / O events of all registered channels, including but not limited to connection, read, and write, enabling single-threaded processing of multiple connections and significantly reducing resource consumption.
[0053] The TCP server-side channel, ServerSocketChannel, is used to listen for TCP connection requests from mobile terminals and is the basic channel for establishing long-lived connections.
[0054] The UDP channel DatagramChannel is responsible for receiving device discovery requests sent by mobile terminals within the local area network based on an optimized Simple Service Discovery Protocol.
[0055] The TCP connection channel SocketChannel established with the mobile terminal is used for bidirectional data transmission with the mobile terminal after the TCP connection is established, carrying real-time interaction of data requests and control commands.
[0056] The ByteBuffer buffer serves as a temporary buffer for read and write operations, supporting efficient data storage and parsing.
[0057] In this embodiment, the request processing flow based on the non-blocking input / output communication framework is as follows: The mobile terminal sends a device discovery request within the local area network via a UDP channel using an optimized simple service discovery protocol. The set-top box listens on a designated port via a UDP channel, and upon receiving the device discovery request, immediately sends back its own IP address, service port number, and device model information, which the mobile terminal then uses to initiate a communication connection.
[0058] After obtaining network connection information, the mobile terminal initiates a TCP connection request to the set-top box. After the TCP server channel ServerSocketChannel listens for the connection event, it creates the corresponding TCP connection channel SocketChannel with the mobile terminal through the accept() method, completes the connection establishment, and enters the data interaction stage.
[0059] After the communication connection is established, the mobile terminal can send data acquisition requests or control commands through the established TCP connection channel SocketChannel. The set-top box server listens for the read-ready event of the established TCP connection channel SocketChannel through a selector, triggering data reading and business logic processing.
[0060] The non-blocking input / output communication framework provided in this application embodiment polls the I / O ready status of all registered channels through an infinite loop of continuous method calls. Once an event is detected, it is dispatched to the corresponding processor for asynchronous processing, thereby achieving high concurrency and low latency communication capabilities.
[0061] S220: Receive data acquisition request from mobile terminal, standardize and encapsulate all desktop data using standard data structure, obtain standardized data, and send it to mobile terminal.
[0062] In this embodiment, key-value pairs combined with a hierarchical index standard data structure are used to standardize and encapsulate the full set-top box launcher data, mapping heterogeneous data from different sources into a unified format. This full set-top box launcher data includes, but is not limited to, data on homepage, live broadcasts, movies, children's programs and their subcategories, a list of live broadcast channels, and user favorites information.
[0063] Standardizing and encapsulating the full desktop data using a standard data structure involves the following steps: First, format analysis and field extraction are performed on the full desktop data to obtain data fields and hierarchical relationships. This involves analyzing the raw Launcher data from the set-top box, covering dynamic data returned via API interfaces and locally stored configuration files, among other sources. Structured parsing of these data samples comprehensively records the data fields in each data domain, including but not limited to field names, data types, nesting levels, value ranges, and their actual display uses. Semantic normalization analysis is then performed on a domain-by-domain basis, dividing the Launcher content into several typical business data domains, such as live channels, film and television categories, user favorites, and recommendation sections. For each data domain, the field representation of the corresponding information in the set-top box is compared one by one, establishing a hierarchical relationship between the original fields and their underlying business meanings.
[0064] Secondly, the basic key-value pair fields and hierarchical indexing rules of the standard data structure are designed. In this embodiment, to achieve standardized encapsulation and efficient parsing of full data from different set-top box launchers, a standard data structure template integrating basic key-value pair fields and hierarchical indexing rules is designed. The design of the basic key-value pair fields includes defining a set of standardized general fields for various business data domains, using unified string encoding to ensure stable parsing under different operating systems and programming environments, avoiding compatibility issues caused by data type differences. Table 1 is a schematic diagram of the basic key-value pair field structure. As shown in Table 1, each data item is represented as an independent set of key-value pairs.
[0065] Table 1. Design illustration of basic key-value pair fields
[0066] The hierarchical indexing rules are designed to record the hierarchical relationship of data through an index table, such as from first-level category to second-level category to content, to avoid the original data being too deeply nested, which would lead to complex parsing.
[0067] For example, the index structure can be: index: { hierarchy path: list of unique_ids corresponding to the data}. Taking the hierarchical index of film and television categories as an example, the following index structure is designed: { "index": { "movie": ["category_101", "category_102"], / / The primary movie category contains two secondary categories "movie / category_101": ["content_2001", "content_2002"] / / Second-level category 101 contains 2 pieces of content. } } Here, category_101 corresponds to the unique_id of the "Action Movies" category, and content_2001 corresponds to the unique_id of the specific movie.
[0068] Then, the data fields are converted into normalized fields based on the basic key-value pair fields, and the hierarchical relationships are converted into hierarchical indexes based on the hierarchical indexing rules.
[0069] In this application embodiment, considering the differences in data fields of different set-top boxes in terms of field naming, data type, encoding format, etc., the original data fields are converted into standardized fields in the standard data structure according to the designed basic key-value pair fields, and common processing operations such as type normalization, string concatenation and default value filling are supported.
[0070] Based on hierarchical indexing rules, the hierarchical relationship is converted into a hierarchical index. For example, if the original data is a nested structure, such as { "movie": { "action movie": [movie1, movie2]}}, then the unique_id of each level node is extracted, for example: "movie" → category_root, "action movie" → category_101). The association between the path and the ID is recorded in the index, for example: "movie / category_101": [content_2001].
[0071] Finally, the standardized fields and hierarchical indexes are encapsulated into a standard data structure, and the standard data structure is validated and adjusted.
[0072] For example, the standardized fields and hierarchical indexes are eventually encapsulated to output a standard data structure in JSON format.
[0073] Optionally, multi-dimensional data validation rules can be applied to the standard data structure to ensure the consistency of output data quality. For example, integrity checks can be performed to verify whether each data item contains all required fields; consistency checks can be performed to verify whether the pointer relationship of the same unique_id is consistent in the master data list and the hierarchical index table; and uniqueness checks can be performed to perform a global deduplication check on all generated unique_ids to ensure that they are unique throughout the entire standard data structure.
[0074] Optionally, intelligent adaptation and fault-tolerant optimization can be performed on standard data structures to improve system robustness and long-term maintainability. For example, field missing fault handling: when some set-top boxes do not provide specific fields, the conversion process will not be interrupted; instead, preset default values will be used to fill the gaps, effectively preventing overall data parsing crashes due to missing individual fields and ensuring the normal display of basic functions. Another example is data format unification and normalization, addressing common heterogeneous situations such as different time representation formats and numerical encoding methods through format recognition and conversion.
[0075] Optionally, to address API structure adjustments and field naming changes resulting from subsequent system upgrades by set-top box manufacturers, the system can also support periodic updates of field mapping rules via a remote configuration center or local incremental packages. New rules can be hot-loaded and take effect without restarting the service, enabling rapid adaptation to the new standard data structure and significantly reducing operational costs and response latency.
[0076] S230: Receive control commands from the mobile terminal, perform corresponding operations according to the control commands, and send the execution results to the mobile terminal.
[0077] In this embodiment, the set-top box server receives control commands sent by the mobile terminal through the NIO communication framework, including three fields: "operation type," "target identifier," and "parameters." Upon receiving the command, it first performs protocol parsing to extract the operation semantics and associated information. Then, according to preset mapping rules, it converts the abstract operation into a control command that can be executed locally on the set-top box, and calls the corresponding system interface to complete the specific functional operation.
[0078] For example, for channel switching commands: when the operation type is "click" and the target identifier points to a live channel item, the unique ID of the corresponding channel is parsed and the playback kernel is triggered to switch to that channel; for volume adjustment commands: based on the sliding direction and the offset in the parameters, the volume increase or decrease is calculated, and the audio management module is called to update the volume level; for category jump commands: if the target identifier is a specific functional area, the Launcher interface is driven to jump to the corresponding category homepage.
[0079] Finally, after the set-top box completes the local operation corresponding to the command, the set-top box server generates an execution result feedback message, which includes the operation status, current status information and necessary prompts. This message is then transmitted back to the mobile terminal in real time through the established TCP long connection. The mobile terminal updates the content displayed on the user interface accordingly, ensuring that the user interface is consistent with the actual state of the set-top box, thus achieving closed-loop two-way interactive control.
[0080] As a further implementation of the embodiments of this application, the set-top box periodically generates heartbeat messages and sends them to the mobile terminal. The heartbeat messages are set with an update flag, which becomes effective when a standardized data update is detected.
[0081] Optionally, the periodic interval can be dynamically adjusted based on the network environment or system load, for example, set to 3 seconds. The set-top box sends a heartbeat message every 3 seconds, and the mobile terminal sends a confirmation after receiving it. If no heartbeat information is received for 3 consecutive times or the mobile terminal operation times out, the reconnection mechanism is automatically triggered.
[0082] For example, when the local Launcher data on the set-top box changes, such as adding favorites, adjusting channel order, or updating program information, the set-top box server compares the latest standardized data structure with the previous version in the cache. If any inconsistency is detected in any data field, the update flag is set to active; otherwise, it is set to inactive, indicating that the user interface on the mobile terminal does not need to be refreshed. Upon receiving the heartbeat message, the mobile terminal parses the update flag. If it is active, it immediately sends a data update request to the set-top box server, supporting full retrieval or incremental fetching to reduce bandwidth consumption. If it is inactive, the current display state is maintained without further action.
[0083] The set-top box control method based on a local area network provided in this application implements a low-overhead, high-efficiency state synchronization strategy. While ensuring that the mobile terminal and the set-top box Launcher interface are always consistent, it effectively reduces network resource consumption and system processing burden, and improves response speed and user experience in multiple scenarios.
[0084] Example 2 Based on the same technical concept as Embodiment 1 above, this application provides a set-top box control system based on a local area network. Figure 3 This is a first schematic diagram of the structure of a set-top box control system based on a local area network provided in an embodiment of this application, as shown below. Figure 3 As shown, when applied to a mobile terminal, the local area network-based set-top box control system 200 includes: The information acquisition module 210 is used to send a device discovery request within the local area network based on the optimized Simple Service Discovery Protocol to obtain the network connection information of the set-top box.
[0085] The communication connection module 220 is used to establish a communication connection with the set-top box based on network connection information and to send a data acquisition request.
[0086] The interface generation module 230 is used to acquire standardized data sent by the set-top box and generate a user interface based on the standardized data.
[0087] The operation control module 240 is used to generate control commands based on the touch operation of the user interface and send the control commands to the set-top box to control the set-top box to perform corresponding operations.
[0088] Figure 4 This is a second schematic diagram of the structure of a set-top box control system based on a local area network provided in an embodiment of this application, as shown below. Figure 4 As shown, when applied to a set-top box, the local area network-based set-top box control system 200 includes: Information sending module 250 is used to listen for device discovery requests from mobile terminals within the local area network based on a non-blocking input / output communication framework, and to send network connection information to the mobile terminals. The data encapsulation module 260 is used to receive data acquisition requests from mobile terminals, encapsulate all desktop data in a standardized manner using a standard data structure, obtain standardized data, and send it to the mobile terminal. The operation execution module 270 is used to receive control commands from the mobile terminal, perform corresponding operations according to the control commands, and send the execution results to the mobile terminal.
[0089] The set-top box control system based on a local area network provided in this application realizes efficient collaborative control between the mobile terminal and the set-top box by constructing a two-way interactive architecture based on direct connection of the local area network. It significantly improves the real-time performance and stability of multi-screen interaction, and realizes full synchronous display and dynamic updating of the set-top box's native content on the mobile terminal. It has a good user experience and broad application prospects.
[0090] It is understood that the implementation method of the set-top box control method based on local area network in Embodiment 1 above is also applicable to this embodiment and can achieve the same technical effect, so it will not be described again here.
[0091] Example 3 Based on the same concept, this application also provides an electronic device. Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 5 As shown, the electronic device 300 may include a processor 310, a communication interface 320, a memory 330, and a communication bus 340, wherein the processor 310, the communication interface 320, and the memory 330 communicate with each other via the communication bus 340. The processor 310 can call logical instructions in the memory 330 to execute the steps of the set-top box control method based on a local area network as described in the above embodiments. For example, this includes: S110: Based on the optimized Simple Service Discovery Protocol, send a device discovery request within the local area network to obtain the set-top box's network connection information; S120. Establish a communication connection with the set-top box based on the network connection information and send a data acquisition request; S130: Obtain standardized data sent by the set-top box and generate a user interface based on the standardized data; S140. Generate control commands based on the touch operation of the user interface, and send the control commands to the set-top box to control the set-top box to perform the corresponding operation.
[0092] For example, it also includes: S210. Based on a non-blocking input / output communication framework, listen for device discovery requests from mobile terminals within the local area network and send network connection information to the mobile terminals. S220: Receive the data acquisition request from the mobile terminal, encapsulate the full desktop data in a standardized manner using a standard data structure, obtain the standardized data, and send it to the mobile terminal; S230: Receive control commands from the mobile terminal, perform corresponding operations according to the control commands, and send the execution results to the mobile terminal.
[0093] The processor 310 can be a central processing unit (CPU). The processor can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations of the above types of chips.
[0094] Furthermore, the logical instructions in the aforementioned memory 330 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0095] The memory 330 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created by the processor, etc. Furthermore, the memory may include high-speed random access memory and non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include memory remotely located relative to the processor, which can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0096] Example 4 Based on the same concept, embodiments of this application also provide a computer-readable storage medium storing a computer program. This computer program includes at least one piece of code that can be executed by a main control device to control the main control device to implement the steps of the set-top box control method based on a local area network as described in the above embodiments. For example, it includes: S110: Based on the optimized Simple Service Discovery Protocol, send a device discovery request within the local area network to obtain the set-top box's network connection information; S120. Establish a communication connection with the set-top box based on the network connection information and send a data acquisition request; S130: Obtain standardized data sent by the set-top box and generate a user interface based on the standardized data; S140. Generate control commands based on the touch operation of the user interface, and send the control commands to the set-top box to control the set-top box to perform the corresponding operation.
[0097] For example, it also includes: S210. Based on a non-blocking input / output communication framework, listen for device discovery requests from mobile terminals within the local area network and send network connection information to the mobile terminals. S220: Receive the data acquisition request from the mobile terminal, encapsulate the full desktop data in a standardized manner using a standard data structure, obtain the standardized data, and send it to the mobile terminal; S230: Receive control commands from the mobile terminal, perform corresponding operations according to the control commands, and send the execution results to the mobile terminal.
[0098] Based on the same technical concept, this application also provides a computer program, which, when executed by a main control device, is used to implement the above-described method embodiments.
[0099] The computer program may be stored, in whole or in part, on a computer-readable storage medium packaged with the processor, or in part or in whole on a memory not packaged with the processor.
[0100] Based on the same technical concept, this application also provides a processor for implementing the above-described method embodiments. The processor can be a chip.
[0101] In summary, the set-top box control method, system, device, and storage medium provided in this application, through the construction of a bidirectional interactive architecture based on direct LAN connection, achieve efficient collaborative control between the mobile terminal and the set-top box, significantly improving the real-time performance and stability of multi-screen interaction. By utilizing a non-blocking input / output communication framework to establish a communication connection, combined with an optimized simple service discovery protocol, rapid device discovery is achieved, eliminating dependence on third-party servers and reducing end-to-end costs and network latency. Through a standard data structure combining value pairs and hierarchical index keys, the full data format of the set-top box desktop is unified, enabling the full synchronous display and dynamic updating of native set-top box content on the mobile terminal, resulting in a superior user experience and broad application prospects.
[0102] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0103] The embodiments described above are merely examples of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these modifications and improvements all fall within the protection scope of this application.
[0104] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A set-top box control method based on a local area network, characterized in that, The method is applied to a mobile terminal, and the method includes: Based on the optimized Simple Service Discovery Protocol, a device discovery request is sent within the local area network to obtain the set-top box's network connection information; Establish a communication connection with the set-top box based on the network connection information, and send a data acquisition request; Obtain standardized data sent by the set-top box, and generate a user interface based on the standardized data; Control commands are generated based on the touch operations of the user interface, and the control commands are sent to the set-top box to control the set-top box to perform corresponding operations.
2. The set-top box control method based on a local area network according to claim 1, characterized in that, The optimized simple service discovery protocol includes: When querying services, filters can be performed based on service type, service version, and service attributes, and a list of similar services can be returned in batches.
3. The set-top box control method based on a local area network according to claim 1, characterized in that, The control command is a triplet control command, and the generation of control commands based on the touch operation of the user interface includes: The operation type code is obtained by performing single-byte hexadecimal encoding based on the operation type of the touch operation. The target identifier code is obtained by performing a mixed string and number encoding on the touch target identifier corresponding to the touch operation; Dynamically adapt the operation parameters according to the operation type to obtain the operation parameter code; The operation type code, the target identifier code, and the operation parameter code are encapsulated to generate the triplet control instruction.
4. A set-top box control method based on a local area network, characterized in that, The method is applied to a set-top box, and the method includes: Based on a non-blocking input / output communication framework, listen for device discovery requests from mobile terminals within the local area network and send network connection information to the mobile terminals; Receive the data acquisition request from the mobile terminal, standardize and encapsulate the full desktop data using a standard data structure, obtain standardized data, and send it to the mobile terminal; The system receives control commands from the mobile terminal, performs corresponding operations based on the control commands, and sends the execution results to the mobile terminal.
5. The set-top box control method based on a local area network according to claim 4, characterized in that, The standardization and encapsulation of all desktop data using a standard data structure includes: Perform format analysis and field extraction on the full desktop data to obtain data fields and hierarchical relationships; Design the basic key-value pair fields and hierarchical indexing rules of the standard data structure; The data fields are converted into normalized fields based on the basic key-value pair fields, and the hierarchical relationship is converted into a hierarchical index based on the hierarchical indexing rules; The standardized fields and the hierarchical index are encapsulated into the standard data structure, and the standard data structure is validated and adjusted.
6. The set-top box control method based on a local area network according to claim 4, characterized in that, The method further includes: A heartbeat message is periodically generated and sent to the mobile terminal. The heartbeat message is set with an update flag. When the standardized data is updated, the update flag becomes valid.
7. A set-top box control system based on a local area network, characterized in that, The system is applied to a mobile terminal, and the system includes: The information acquisition module is used to send device discovery requests within the local area network based on the optimized Simple Service Discovery Protocol to obtain the set-top box's network connection information; A communication connection module is used to establish a communication connection with the set-top box based on the network connection information and to send a data acquisition request; The interface generation module is used to acquire standardized data sent by the set-top box and generate a user interface based on the standardized data. The operation control module is used to generate control commands based on the touch operation of the user interface, and send the control commands to the set-top box to control the set-top box to perform corresponding operations.
8. A set-top box control system based on a local area network, characterized in that, The system is applied to a set-top box, and the system includes: The information sending module is used to listen for device discovery requests from mobile terminals within the local area network based on a non-blocking input / output communication framework, and to send network connection information to the mobile terminals. The data encapsulation module is used to receive the data acquisition request from the mobile terminal, encapsulate the full desktop data in a standardized manner using a standard data structure, obtain standardized data, and send it to the mobile terminal. The operation execution module is used to receive control commands from the mobile terminal, perform corresponding operations according to the control commands, and send the execution results to the mobile terminal.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the set-top box control method based on a local area network as described in any one of claims 1-6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the set-top box control method based on a local area network as described in any one of claims 1-6.