Dual-network access methods, devices, set-top boxes, equipment, media, and software products for set-top boxes.

By identifying data packet tags and associating them with the routing table in the set-top box, the problem of the set-top box's inability to quickly and accurately achieve dual-network access was solved, enabling stable dual-network access to the IPTV private network and the public Internet, and ensuring fast and accurate routing of data packets.

CN123123636APending Publication Date: 2026-11-17CHINA MOBILEHANGZHOUINFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510617606.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-14
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

In existing technologies, set-top boxes cannot quickly and accurately achieve dual-network access to IPTV private networks and the public Internet, making it difficult to meet user needs and affecting user experience.

Method used

By acquiring the data packets sent by the socket, the packet identifier is determined, and the corresponding routing table is associated with the identifier. The routing table includes a first routing table associated with the IPTV private network or a second routing table associated with the public Internet. The packet identifier is determined based on the application unique identifier of the application associated with the socket, and the identifier association is stored in the global instance of the operating system kernel.

Benefits of technology

It enables set-top boxes to access the IPTV private network and the public Internet quickly and accurately, improving the stability and accuracy of dual-network access and ensuring that data packets for IPTV or OTT services can be routed to the corresponding routing table quickly and accurately.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123123636A_ABST
    Figure CN123123636A_ABST
Patent Text Reader

Abstract

This invention provides a method, apparatus, set-top box, device, medium, and program product for dual-network access in a set-top box, relating to the field of communication technology. The method includes: acquiring data packets sent by a socket; determining the data packet marker; the data packet marker includes a first data packet marker associated with an IPTV private network, or a second data packet marker associated with the public internet; sending data packets based on a routing table associated with the data packet marker; the routing table includes a first routing table associated with the first data packet marker or a second routing table associated with the second data packet marker; all data packets sent by the socket are marked with the same data packet marker, and the data packet marker is determined based on the application-unique identifier of the application associated with the socket. This invention can ensure that data packets for IPTV or OTT services are quickly and accurately routed to the corresponding routing table, thus enabling fast and accurate dual-network access.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communication technology, and in particular to a method, apparatus, set-top box, device, medium, and program product for dual-network access of a set-top box. Background Technology

[0002] With the advancement of triple-play integration, IPTV (Internet Protocol Television), fixed-line telephone networks, and the public internet have been integrated into a single optical modem. The dedicated IPTV network provides users with live streaming and video-on-demand services, ensuring good network bandwidth and video quality. The public internet provides users with OTT (Over-The-Top) services. However, the complete isolation between the IPTV network and the public internet prevents IPTV set-top boxes from providing OTT services. Furthermore, OTT services are not allowed to access live channels, meaning IPTV's on-demand content is less than half that of OTT, and OTT lacks live channels, making it difficult to fully meet user needs and impacting the user experience. Therefore, neither a pure OTT nor a pure IPTV model is feasible. Consequently, it is necessary to enable simultaneous access to both the IPTV network and the public internet—a dual-network access model—to achieve both IPTV and OTT service modes.

[0003] Currently, IPTV service data packets from the set-top box are sent to the optical modem via a wired network card, while OTT service data packets are sent to the optical modem via a wireless network card. The wired network card is connected to the IPTV private network, and the wireless network card is connected to the public internet. Routing tables are established for the wired and wireless network cards so that IPTV and OTT service data packets are forwarded to the wired and wireless network cards through different routing tables. Then, by establishing a mapping between the PID (Process Identifier) ​​and Mark of the Android application, Mark markers are added to the routing table. When a service data packet is sent, it checks whether its PID is associated with a Mark. If there is an association, the service data packet is forwarded through the routing table marked with that Mark.

[0004] However, existing technology involves assigning a mark to the PID of an Android application and adding the mark tag to the routing table to establish an association between the PID and the routing table. Data packets from the application associated with the PID are then sent through the associated routing table. Since the PID of an application is different on each set-top box, and the PID changes if the device restarts for the same application, assigning a mark to the PID is difficult. This results in data packets not being routed to the appropriate routing table quickly and accurately, meaning that the current method cannot achieve fast and accurate dual-network access. Summary of the Invention

[0005] This invention provides a method, apparatus, set-top box, device, medium, and program product for dual-network access in a set-top box, which solves the defect in the prior art that data packets cannot be quickly and accurately routed to the corresponding routing table, and realizes a fast and accurate dual-network access method.

[0006] This invention provides a method for dual-network access of a set-top box, comprising: Obtain the data packet sent by the socket and determine the data packet marker; the data packet marker includes a first data packet marker associated with the Internet Protocol Television (IPTV) private network, or a second data packet marker associated with the public Internet; The data packet is sent based on a routing table associated with the data packet tag; the routing table includes a first routing table associated with the first data packet tag or a second routing table associated with the second data packet tag. In this context, all data packets sent by the Socket are marked with the same data packet tag, and the data packet tag is determined based on the application unique identifier of the application associated with the Socket.

[0007] According to a method for dual-network access of a set-top box provided by the present invention, before obtaining the data packet sent by the socket, the method further includes: After the Socket is created, the process identifier of the application process associated with the Socket is determined; Based on the identifier association relationship, the application unique identifier associated with the process identifier is determined; the identifier association relationship is used to indicate the correspondence between the process identifier and the application unique identifier. Based on the application's unique identifier, a data packet tag associated with the application type is determined; the application type is the type of application associated with the Socket, and the application type includes the application corresponding to the IPTV private network or the application corresponding to the public Internet; Set the data packet tag for the Socket to mark the data packet when the Socket sends a data packet.

[0008] According to the dual-network access method for a set-top box provided by the present invention, the identifier association relationship is obtained from the global instance of the operating system kernel, and the identifier association relationship is saved to the global instance of the operating system kernel in the following manner: When the application process of the application associated with the Socket is started, the process identifier is associated with the unique identifier of the application to obtain the identifier association relationship; The identification association is saved to the global instance of the operating system kernel.

[0009] According to a method for dual-network access of a set-top box provided by the present invention, the step of saving the identifier association relationship to a global instance of the operating system kernel includes: The identifier association is saved to the global instance of the operating system kernel via a character device; The character device is created in advance in the operating system kernel.

[0010] According to a set-top box dual-network access method provided by the present invention, the step of determining the data packet tag associated with the application type based on the application's unique identifier includes: If the application unique identifier exists in the application unique identifier set, the data packet is identified as the first data packet identifier; If the application unique identifier does not exist in the application unique identifier set, the data packet is identified as the second data packet identifier; The application unique identifier set includes unique identifiers for several applications corresponding to the IPTV private network.

[0011] According to the dual-network access method for a set-top box provided by the present invention, the application unique identifier set is obtained from the global instance of the operating system kernel, and the application unique identifier set is saved to the global instance of the operating system kernel in the following manner: Read the target file to obtain the application's unique identifier set; Save the application's unique identifier set to a global instance of the operating system kernel; Accordingly, the set-top box dual-network access method further includes: Receive a modification instruction to modify the application's unique identifier set; In response to the modification instruction, add or delete the unique identifier of the application corresponding to the IPTV private network in the target file.

[0012] According to a method for dual-network access of a set-top box provided by the present invention, sending the data packet based on a routing table associated with the data packet tag includes: Based on the first routing policy and the second routing policy, a routing table associated with the packet tag is determined; Based on the routing table, the data packet is routed to the network interface card associated with the routing table, so as to send the data packet through the network interface card; The first routing policy is used to indicate the association between the first packet tag and the first routing table, and the second routing policy is used to indicate the association between the second packet tag and the second routing table. The first routing policy is added after the first routing table is successfully established, and the second routing policy is added after the second routing table is successfully established.

[0013] According to a set-top box dual-network access method provided by the present invention, the network card includes a wired network card associated with the IPTV private network, or a wireless network card associated with the public Internet.

[0014] The present invention also provides a set-top box dual-network access device, comprising: The determination module is used to obtain data packets sent by the socket and determine the data packet marker of the data packet; the data packet marker includes a first data packet marker associated with the Internet Protocol Television (IPTV) private network, or a second data packet marker associated with the public Internet; A sending module is configured to send the data packet based on a routing table associated with the data packet tag; the routing table includes a first routing table associated with the first data packet tag or a second routing table associated with the second data packet tag; In this context, all data packets sent by the Socket are marked with the same data packet tag, and the data packet tag is determined based on the application unique identifier of the application associated with the Socket.

[0015] The present invention also provides a set-top box, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the set-top box dual-network access method as described above.

[0016] The present invention also 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 program to implement the set-top box dual-network access method as described above.

[0017] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the set-top box dual-network access method as described above.

[0018] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the set-top box dual-network access method as described above.

[0019] The present invention provides a method, apparatus, set-top box, device, medium, and program product for dual-network access in a set-top box. It acquires data packets sent by a socket, determines the data packet marker of the data packet, and sends the data packet based on a routing table associated with the data packet marker. All data packets sent by the socket are marked with the same data packet marker, which is determined based on the application unique identifier of the application associated with the socket. Thus, the socket is associated with the application unique identifier, and the application unique identifier is associated with the data packet marker. The data packet marker includes a first data packet marker associated with an IPTV private network or a second data packet marker associated with the public internet. The routing table includes a first routing table associated with the first data packet marker or a second routing table associated with the second data packet marker. Thus, the application unique identifier is associated with the routing table. Since the application unique identifier of the application does not change, it is clear that the IPTV service application is associated with the first routing table, and the OTT service corresponding to the public internet is associated with the second routing table. This allows for quick and simple setup of the association relationship, ensuring that data packets of IPTV or OTT services can be quickly and accurately routed to the corresponding routing table. In other words, the present invention can quickly and accurately achieve dual-network access. Furthermore, once the association is set, it requires minimal subsequent modification, resulting in greater system stability and improved stability of dual-network access. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0021] Figure 1 This is one of the flowcharts illustrating the dual-network access method for set-top boxes provided by the present invention; Figure 2 This is the second flowchart illustrating the dual-network access method for set-top boxes provided by the present invention; Figure 3 This is the third flowchart of the set-top box dual-network access method provided by the present invention; Figure 4 This is a schematic diagram of the dual-network access architecture for set-top boxes provided by the present invention; Figure 5 This is the fourth flowchart illustrating the set-top box dual-network access method provided by the present invention; Figure 6This is a schematic diagram of the structure of the set-top box dual-network access device provided by the present invention; Figure 7 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0023] The dual-network access method for set-top boxes provided by this invention can be applied to electronic devices, such as user terminals, for example, set-top boxes.

[0024] The current dual-network implementation method has difficulty in sending data packets to the associated routing table, which makes it difficult for data packets to be routed to the corresponding routing table quickly and accurately. In other words, the existing method cannot achieve dual-network access quickly and accurately.

[0025] Given that current dual-network implementation methods cannot achieve dual-network access quickly and accurately, this invention has conducted in-depth research, and the initial ideas were as follows:

[0026] The first method involves accessing the OTT network via a proxy gateway, which means setting up a proxy within the IPTV private network for OTT services. However, deploying a proxy gateway within the IPTV private network requires deploying the proxy gateway within the IPTV private network, and the application also needs to change its domain name to the proxy gateway's IP address (because there is no DNS server within the IPTV private network). The application server also needs to be deployed separately within the IPTV private network. This method is cumbersome to deploy and has strict performance requirements for the proxy gateway.

[0027] The second method involves the set-top box sending IPTV and OTT services to the optical modem via a wired network card. This requires a virtual network card, with different routing tables configured for the wired and virtual network cards, or different VLAN (Virtual Local Area Network) tags added. After the data packets are sent to the optical modem, the modem selects whether to forward them to the IPTV private network or the OTT network based on the protocol type, source MAC address, and VLAN tag. However, this method requires a virtualized network card, and the data packets for both IPTV and OTT services are sent to the optical modem via a single network cable through two network cards. The optical modem needs to distinguish between IPTV and OTT data packets within the single network cable, and then forward them to the IPTV private network and the OTT network accordingly. This method requires modifications not only to the set-top box system (virtual network card, routing table forwarding, etc.) but also to the optical modem's configuration, making implementation difficult.

[0028] The third method involves modifying the optical modem's configuration. This allows the modem to distinguish between IPTV and OTT service data packets based on specific fields they contain, thus enabling packet forwarding. However, this method requires modification of the optical modem, making it difficult to widely adopt and practical.

[0029] The present invention has studied the above-mentioned approach and found that although the above approach can achieve dual-network access, it requires setting up a proxy gateway or modifying the optical modem.

[0030] To address the problems with the aforementioned approaches, this invention continues its research. During the research process, it was conceived of making reasonable use of existing set-top box resources. Existing set-top boxes typically have wired and wireless network cards. The wired network card connects to the IPTV private network, and the wireless network card connects to the public internet. This allows the optical modem to directly distinguish between IPTV and OTT service data packets without requiring modem modification. In other words, this invention achieves dual-network access for IPTV and OTT services through wired and wireless network cards. IPTV and OTT service data packets are forwarded to the wired and wireless network cards respectively using different routing tables. This dual-network access method requires associating IPTV and OTT service data packets with corresponding routing tables. This invention studies three methods for associating data packets from sending them to the routing table.

[0031] The first method involves assigning a mark to the PID of an Android application and adding the mark tag to the routing table, thereby establishing an association between the PID and the routing table. Data packets from applications associated with a PID are then sent through the associated routing table. However, since the PID of an application is different on each set-top box, and the PID of the same application changes if the device restarts within the same device, assigning a mark to the PID is difficult. It's impossible to know which PIDs belong to IPTV applications, and consequently, it's impossible to know which PID's data packets should be forwarded through which routing tables and network cards, resulting in data packets not being routed quickly and accurately to the corresponding routing tables.

[0032] The second method involves directly obtaining the IPTV private network routing table from an external platform. This IPTV private network routing table is manually configured, meaning the association between the target IP and the routing table is manually set, thus associating the routing table based on the destination IP of the IPTV service. However, because the destination IP of the IPTV service changes frequently, it cannot be hardcoded into the system. The IPTV private network routing table needs to be dynamically modified frequently, and after the destination IP changes, the set-top box needs to be restarted to re-obtain the IPTV private network routing table, resulting in poor real-time performance.

[0033] The third method involves associating the routing table based on the destination IP address of the IPTV service. However, because the destination IP address of the IPTV service changes frequently, it cannot be hardcoded into the system. It requires frequent dynamic modifications to the set-top box configuration, and the routing table needs to be reconfigured by restarting the set-top box after the destination IP address changes, resulting in poor real-time performance.

[0034] To address the shortcomings of the aforementioned method of sending data packets directly to the routing table, this invention further investigates and finds that sending IPTV and OTT service data packets through different network interface cards (NICs) requires solving a problem: how to distinguish whether a data packet belongs to an IPTV application or an OTT application, and thus distribute them to different routing tables and NICs; that is, how to determine whether the data packet to be sent is an OTT service data packet or an IPTV service data packet. Based on this, this invention considers that the application's unique identifier remains constant, thus avoiding the problem of repeated configuration due to frequent changes in the destination IP of IPTV services. Ultimately, it proposes using the application's unique identifier to distinguish between IPTV and OTT service data packets.

[0035] The dual-network access method for set-top boxes provided by the present invention will be described below through the following embodiments. Figures 1-5 The present invention describes a set-top box dual-network access method.

[0036] Figure 1 This is one of the flowcharts illustrating the dual-network access method for set-top boxes provided by the present invention, such as... Figure 1 As shown, the dual-network access method for the set-top box includes the following steps 110 and 120.

[0037] Step 110: Obtain the data packet sent by the socket and determine the data packet marker of the data packet.

[0038] Here, all data packets sent by the Socket are marked with the same data packet tag. That is, the data packet tag is pre-set for the Socket so that the data packet tag is marked when the Socket sends data packets.

[0039] The data packet markers include a first data packet marker associated with the IPTV private network, or a second data packet marker associated with the public Internet. For example, the first data packet marker fwmark=1000, and the second data packet marker fwmark=1001.

[0040] Furthermore, the packet label is determined based on the application unique identifier of the application associated with the socket. That is, based on the application unique identifier of the application associated with the socket, the packet label associated with the application type is determined. The application type includes applications corresponding to IPTV private networks or applications corresponding to the public Internet.

[0041] It should be noted that one socket is associated with one application, that is, one socket provides communication services for one APP.

[0042] The application unique identifier is used to uniquely identify the application. It can be the application's package name. Since the application unique identifier does not change, it can be used to uniquely determine whether the application is an IPTV service application or an OTT service application. This allows us to determine whether the data packet tag is the first data packet tag corresponding to the IPTV service application or the second data packet tag corresponding to the OTT service application.

[0043] In one specific embodiment, to ensure that all data packets sent by the Socket are marked with the same data packet marker, and to implement a first data packet marker for IPTV services and a second data packet marker for OTT services, it is only necessary to modify the Android system Socket source code and pre-set the corresponding data packet markers for the Socket using the Socket's setsockopt function. For example, the setsockopt function sets SO_MARK fwmark=1000 for the Socket associated with the IPTV application and sets SO_MARK fwmark=1001 for the Socket associated with the OTT application. fwmark, as a kernel marker, is not embedded in the data packet; it only adds a marker to the data packets sent by the Socket. After the Socket sets the mark, all subsequent data packets sent by the Socket will be marked with that mark.

[0044] Step 120: Send the data packet based on the routing table associated with the data packet tag.

[0045] The routing table includes a first routing table associated with the first packet tag or a second routing table associated with the second packet tag.

[0046] It should be noted that the routing table associated with the first data packet tag is pre-defined as the first routing table, and the routing table associated with the second data packet tag is defined as the second routing table. Furthermore, the first routing table is associated with the IPTV private network, and the second routing table is associated with the public internet.

[0047] Specifically, based on the routing table, data packets are routed to the network interface card (NIC) associated with the routing table so that the data packets can be sent through that NIC.

[0048] In one specific embodiment, after the first routing table is successfully established, the first routing table is associated with the first data packet tag; after the second routing table is successfully established, the second routing table is associated with the second data packet tag.

[0049] For example, assuming that the execution subject of the set-top box dual-network access method of the present invention is a set-top box, the wired network card of the set-top box is connected to the IPTV private network port of the optical modem via a network cable, the wireless network card of the set-top box is connected to the router via WIFI, and the WAN port of the router is connected to the Internet port of the optical modem via a network cable; the initial default routing tables of the first routing table and the second routing table are established based on the following method: The first step is that after the set-top box is powered on, the system loads the network driver and initializes the wired network card and the wireless network card, assigning the eth0 interface to the wired network card and the wlan0 interface to the wireless network card. The second step is to connect the set-top box's wired network card to the optical modem's IPTV dedicated network port via a network cable, and connect the set-top box's wireless network card to the router via WIFI. The third step involves the set-top box creating instances for network interfaces eth0 and wlan0 using its built-in DHCP (Dynamic Host Configuration Protocol) client (e.g., dhclient or dhcpcd). The DHCP instance for the eth0 interface sends a DHCP Discover broadcast request via the wired network card. The DHCP server of the optical modem responds to this request and assigns an IP address, subnet mask, default gateway, and DNS server information to the eth0 interface. Similarly, the DHCP instance for the wlan0 interface sends a DHCP Discover broadcast request via the wireless network card. The DHCP server of the router responds to this request and assigns an IP address, subnet mask, default gateway, and DNS server information to the wlan0 interface. The fourth step involves successfully obtaining the IP addresses of the eth0 and wlan0 interfaces. The system then configures default routing tables for these interfaces based on their respective gateway addresses, i.e., configuring the first and second routing tables. For example, the default routing table (first routing table) for the eth0 interface is `table eth0 default via 10.1.1.1 dev eth0 proto static`, and the default routing table (second routing table) for the wlan0 interface is `table wlan0 default via 192.168.1.1 devwlan0 proto static`. The routing table for `table eth0` defaults to sending data packets from the eth0 interface with a next-hop gateway address of 10.1.1.1, while the routing table for `table wlan0` defaults to sending data packets from the wlan0 interface with a next-hop gateway address of 192.168.1.1.

[0050] It should be understood that since the packet tag is determined based on the application unique identifier of the application associated with the socket, that is, the application unique identifier of the APP is associated with the packet tag, and the packets sent by the socket are all tagged with the same packet tag, the application unique identifier of the APP is associated with the socket; and since the packet tag includes a first packet tag associated with the IPTV private network or a second packet tag associated with the public Internet, and the routing table includes a first routing table associated with the first packet tag or a second routing table associated with the second packet tag, the application unique identifier of the APP is associated with the first routing table corresponding to the IPTV service or the second routing table corresponding to the OTT service.

[0051] In other words, this embodiment of the invention establishes an association between the network protocol stack object Socket and the application's unique identifier. If the Socket is associated with the application's unique identifier for an IPTV service app, then an IPTV mark is set for the Socket. Thus, all data packets sent by the Socket contain the IPTV mark, and the data packets with the IPTV mark (first data packet mark) are forwarded to the first routing table, thereby sending data packets through the network interface card associated with the first routing table. If the Socket is associated with the application's unique identifier for an OTT service app, then an OTT mark is set for the Socket, and the data packets sent by the Socket are forwarded to the second routing table, thereby sending data packets through the network interface card associated with the second routing table. That is, this embodiment of the invention sets a mark for the Socket, tagging the data packets sent by the Socket pipe with a mark, so that the corresponding routing table forwards data packets based on the mark. In other words, by associating the routing table with the Socket and associating the Socket with the application's unique identifier, an association relationship between the application's unique identifier and the routing table is established. This leverages the fact that the application's unique identifier does not change, so once the association is set, it requires virtually no further modifications, resulting in greater stability. Furthermore, the association relationship can be set up quickly and easily, ensuring that data packets can be routed to the corresponding routing table quickly and accurately. Thus, this embodiment of the invention can quickly and accurately achieve dual-network access.

[0052] The set-top box dual-network access method provided in this invention obtains data packets sent by a Socket, determines the data packet tag of the data packet, and sends the data packet based on the routing table associated with the data packet tag. All data packets sent by the Socket are tagged with the same data packet tag. This data packet tag is determined based on the application unique identifier of the application associated with the Socket, thus associating the Socket with the application unique identifier, and further associating the application unique identifier with the data packet tag. The data packet tag includes a first data packet tag associated with the IPTV private network or a second data packet tag associated with the public Internet. The routing table includes a first routing table associated with the first data packet tag or a second routing table associated with the second data packet tag, thus associating the application unique identifier with the routing table. Since the application unique identifier of the application does not change, it can be clearly stated that the IPTV service application is associated with the first routing table, and the OTT service corresponding to the public Internet is associated with the second routing table. This allows for quick and simple setup of the association relationship, ensuring that data packets of the IPTV service or OTT service can be quickly and accurately routed to the corresponding routing table. In other words, this invention can quickly and accurately achieve dual-network access. Furthermore, once the association is set, it requires minimal subsequent modification, resulting in greater system stability and improved stability of dual-network access.

[0053] Based on any of the above embodiments, a specific embodiment of the dual-network regulation method is given below. Figure 2 This is the second flowchart illustrating the dual-network access method for set-top boxes provided by the present invention, as follows: Figure 2 As shown, prior to step 110 above, the method further includes steps 210, 220, 230 and 240.

[0054] Step 210: After creating the Socket, determine the process identifier of the application process associated with the Socket.

[0055] Here, the socket can be created in advance for future use, or it can be created when the application triggers a network request. For example, the APP network framework creates a socket. It should be noted that a socket is associated with an application, that is, a socket provides communication services for an APP, thereby determining the process identifier (PID).

[0056] Step 220: Based on the identifier association relationship, determine the unique identifier of the application associated with the process identifier.

[0057] The identifier association relationship is used to indicate the correspondence between process identifiers and application unique identifiers. In one embodiment, this identifier association relationship can be represented by a list.

[0058] In one specific embodiment, the identification association is obtained from the global instance of the operating system kernel. For example, the package name (application unique identifier) ​​corresponding to the PID (Process Identifier) ​​is queried through the kernel global instance struct pid_pkg_info_list, that is, the struct pid_pkg_info_list is searched to see if there is a package name associated with the PID.

[0059] Step 230: Based on the application's unique identifier, determine the data packet tag associated with the application type.

[0060] The application type refers to the type of application associated with the Socket, which includes applications corresponding to the IPTV private network or applications corresponding to the public Internet. That is, the application type includes IPTV applications or OTT applications.

[0061] It should be understood that the application type can be determined based on the application's unique identifier, and thus the corresponding data packet tag can be determined based on the application type. For example, if the application is determined to be an IPTV application based on the application's unique identifier, the data packet tag is determined to be 1000; otherwise, the data packet tag is determined to be 1001.

[0062] Step 240: Set the data packet tag for the Socket to mark the data packet when the Socket sends a data packet.

[0063] For example, by modifying the Android system Socket source code, the corresponding data packet marker for the Socket can be pre-set using the Socket's setsockopt function. For instance, the setsockopt function sets SO_MARK fwmark=1000 for the Socket associated with the IPTV application and SO_MARK fwmark=1001 for the Socket associated with the OTT application. fwmark, as a kernel marker, is not embedded in the data packet; it only adds a marker to the data packets sent by the Socket. After the Socket sets the mark, subsequent data packets sent by the Socket will be marked with that mark. Based on this, the embodiments of the present invention do not require modification of the network protocol stack; only the Socket creation part is modified, thus making the system more stable and improving the stability of dual-network access. In contrast, existing methods for establishing the association between PID and routing tables involve modifications to the network protocol stack, which is more difficult to implement.

[0064] The set-top box dual-network access method provided in this embodiment of the invention, after creating a Socket, determines the process identifier of the application process associated with the Socket, and based on the identifier association relationship, determines the application unique identifier associated with the process identifier, and based on the application unique identifier, determines the data packet tag associated with the application type, where the application type is the type of application associated with the Socket. The application type includes applications corresponding to IPTV private networks or applications corresponding to the public Internet. A data packet tag is set for the Socket so that the data packet tag is marked when the Socket sends data packets, thereby realizing the association between the application unique identifier and the data packet tag, and further realizing the association between the application unique identifier and the routing table. Since the application unique identifier of the application does not change, dual-network access can be realized quickly and accurately.

[0065] Based on any of the above embodiments, another specific embodiment of the dual-network adjustment method is given below. The identification association relationship is obtained from the global instance of the operating system kernel.

[0066] Accordingly, considering that the operating system (such as Linux) kernel network protocol stack does not recognize the package name (application unique identifier) ​​of the Android system, this embodiment of the invention proposes an implementation for synchronizing the package name to the operating system (such as Linux) kernel protocol stack on the Android system, that is, saving the identifier association relationship to the global instance of the operating system kernel. Specifically, the identifier association relationship is saved to the global instance of the operating system kernel in the following manner: When the application process of the application associated with the Socket is started, the process identifier is associated with the unique identifier of the application to obtain the identifier association relationship; The identification association is saved to the global instance of the operating system kernel.

[0067] It should be noted that when the application process is started, the correspondence between the process identifier and the application's unique identifier can be determined, thus linking the two together.

[0068] For example, the `startProcessLocke` method of the system `ActivityManagerService` is modified to obtain the association between the application process's process identifier and the application's unique identifier each time the application process is launched. As a service of the Android system, `ActivityManagerService` can detect the start and end of the app's application process.

[0069] Furthermore, the identifier association also indicates the correspondence between other process identifiers and other application unique identifiers. When any application's process starts, the process identifier of that application process is associated with the application's application unique identifier to update the associated relationship to the identifier association. For example, during each application process startup, the association between the process identifiers of all application processes in the current system and the application's application unique identifier is obtained.

[0070] Furthermore, when any application's process terminates, the association between the process identifier of that application process and the application's unique identifier is deleted from the identification association. For example, the `startProcessLocked` and `appDiedLocked` methods of the system's `ActivityManagerService` are modified to obtain the association between the application process's process identifier and the application's unique identifier each time an application process is started and terminated, thus obtaining the latest identification association.

[0071] The set-top box dual-network access method provided in this embodiment of the invention, when the application process of the application associated with the Socket is started, associates the process identifier with the application unique identifier to obtain the identifier association relationship, and saves the identifier association relationship to the global instance of the operating system kernel. This allows the system to detect the start and end of the APP's application process. After the process state changes, the association relationship between the process identifier and the application unique identifier is sent to the network protocol stack in real time, thereby ensuring that the accurate identifier association relationship can be obtained in a timely manner, thus improving the stability and accuracy of dual-network access. Furthermore, considering that the operating system (such as Linux) kernel does not have the concept of application unique identifier, but only the concept of process identifier, that is, considering that the application unique identifier is a concept of the Android framework layer, the identifier association relationship is passed to the network protocol stack, thereby improving the stability of dual-network access.

[0072] Based on any of the above embodiments, another specific embodiment of the dual-network adjustment method is given below. The identification association relationship is saved in the global instance of the operating system kernel in the following manner: When the application process of the application associated with the Socket is started, the process identifier is associated with the unique identifier of the application to obtain the identifier association relationship; The identifier association is saved to the global instance of the operating system kernel via a character device.

[0073] For example, the global instance of the operating system kernel is a global instance of the Linux kernel, meaning the operating system is a Linux system. Of course, the operating system can also be other systems; no specific limitation is made here.

[0074] For example, the character device is network_iptv_ott_device. The process identifier (PID) and the package name (application unique identifier) ​​relationship list (identifier association) are sent to the character device network_iptv_ott_device by opening network_iptv_ott_device and the device_ioctl IOCTL_SET_PID_PKG instruction. The character device network_iptv_ott_device saves the relationship list to the kernel global instance struct pid_pkg_info_list.

[0075] The character device is created in advance within the operating system kernel. This operating system kernel can be a Linux kernel, meaning the operating system can be Linux, but it can also be any other system.

[0076] For example, a character device is created as follows: A new character device is defined and registered in the kernel to receive CMD commands passed from user space via ioctl. A new character device, `network_iptv_ott_device`, is defined in the kernel; the character device addition process follows the standard Linux character device addition process. The character device `network_iptv_ott_device` registers the `ioctl` interface of `file_operations {unlocked_ioctl = device_ioctl}` with the kernel to handle CMD commands passed from user space via ioctl. CMD commands include instructions that set the mapping list between process identifiers (PIDs) and package names (application-unique identifiers), i.e., `IOCTL_SET_PID_PKG`. After receiving the above instructions, the character device `network_iptv_ott_device` saves the PID-to-package name mapping list to the kernel global instance `struct pid_pkg_info_list` via `copy_from_user`.

[0077] The set-top box dual-network access method provided in this embodiment of the invention can pass the identification association relationship to the network protocol stack through a character device. This takes into account that the operating system (such as Linux) kernel does not have the concept of application unique identifier, but only the concept of process identifier. That is, it takes into account that the application unique identifier is a concept of the Android framework layer, thereby improving the stability of dual-network access.

[0078] Based on any of the above embodiments, another specific embodiment of the dual-network adjustment method is given below. Specifically, step 230 above includes: If the application unique identifier exists in the application unique identifier set, the data packet is identified as the first data packet identifier; If the application unique identifier does not exist in the application unique identifier set, the data packet is identified as the second data packet identifier.

[0079] The application unique identifier set includes unique identifiers for several applications corresponding to the IPTV private network. For example, the application unique identifier set can be represented by an IPTV packet name whitelist, such as iptv_pkg_whitelist.

[0080] In one specific embodiment, the application unique identifier set is obtained from the global instance of the operating system kernel. For example, the existence of the packet name (application unique identifier) ​​is queried through the kernel global instance struct iptv_pkg_whitelist. For example, if it exists, the packet is marked as 1000; otherwise, it is marked as 1001.

[0081] The set-top box dual-network access method provided in this embodiment of the invention can accurately determine the data packet marker by setting an accurate data packet marker for the Socket, so as to mark the data packet marker when the Socket sends the data packet, thereby realizing the association between the application unique identifier and the data packet marker, and further realizing the association between the application unique identifier and the routing table. Since the application unique identifier of the application does not change, dual-network access can be realized quickly and accurately.

[0082] Based on any of the above embodiments, another specific embodiment of the dual-network adjustment method is given below. Specifically, step 230 above includes: If the application unique identifier exists in the application unique identifier set, the data packet is identified as the second data packet identifier; If the application unique identifier does not exist in the application unique identifier set, the data packet is identified as the first data packet identifier.

[0083] The application unique identifier set includes unique identifiers for several applications corresponding to the public internet. For example, the application unique identifier set can be represented by an OTT packet name whitelist, such as ott_pkg_whitelist.

[0084] In one specific embodiment, the application unique identifier set is obtained from the global instance of the operating system kernel. For example, the existence of the package name (application unique identifier) ​​is queried through the kernel global instance `struct ott_pkg_whitelist`. For example, if it exists, the packet is marked as 1001; otherwise, it is marked as 1000.

[0085] The set-top box dual-network access method provided in this embodiment of the invention can accurately determine the data packet marker by setting an accurate data packet marker for the Socket, so as to mark the data packet marker when the Socket sends the data packet, thereby realizing the association between the application unique identifier and the data packet marker, and further realizing the association between the application unique identifier and the routing table. Since the application unique identifier of the application does not change, dual-network access can be realized quickly and accurately.

[0086] Based on any of the above embodiments, another specific embodiment of the dual-network adjustment method is given below. The application unique identifier set is obtained from the global instance of the operating system kernel.

[0087] Accordingly, considering that the operating system (such as Linux) kernel network protocol stack does not recognize the package name (application unique identifier) ​​of the Android system, this embodiment of the invention proposes an embodiment for synchronizing the package name to the operating system (such as Linux) kernel protocol stack on the Android system, that is, saving the application unique identifier set to the global instance of the operating system kernel. Specifically, the application unique identifier set is saved to the global instance of the operating system kernel in the following manner: Read the target file to obtain the application's unique identifier set; The application's unique identifier set is saved to the global instance of the operating system kernel.

[0088] Here, the target file is used to store a unique set of application identifiers. For example, the target file is / system / etc / iptv_network_package_whitelist.xml.

[0089] In one embodiment, when the system is powered on (e.g., when a set-top box is powered on), the target file is read to obtain the application unique identifier set, and the application unique identifier set is saved to the global instance of the operating system kernel.

[0090] For example, each time the system boots up, ActivityManagerService reads the IPTV packet name whitelist (application unique identifier set) from the file / system / etc / iptv_network_package_whitelist.xml (the target file).

[0091] In another embodiment, if the application unique identifier set in the target file is updated, the target file is read to obtain the application unique identifier set, and the application unique identifier set is saved to the global instance of the operating system kernel.

[0092] The set-top box dual-network access method provided in this embodiment of the invention takes into account that the operating system (such as Linux) kernel does not have the concept of application unique identifier, but only the concept of process identifier. That is, considering that the application unique identifier is a concept of the Android framework layer, the application unique identifier set is passed to the network protocol stack, thereby improving the stability of dual-network access.

[0093] Based on any of the above embodiments, another specific embodiment of the dual-network adjustment method is given below. This set-top box dual-network access method further includes: Receive a modification instruction to modify the application's unique identifier set; In response to the modification instruction, add or delete the unique identifier of the application corresponding to the IPTV private network in the target file.

[0094] In one embodiment, the modification command can be triggered by a user based on a certain terminal, thereby transmitting the modification command to the set-top box.

[0095] For example, ` / system / etc / iptv_network_package_whitelist.xml` serves as the storage path for the application's unique identifier set. Through the RMS (Remote Management System) application, based on the TR069 protocol, the application's unique identifier set is dynamically configured remotely on the set-top box management platform (RMS platform), specifically in `iptv_network_package_whitelist.xml`. The set-top box dual-network access method provided in this embodiment of the invention supports adding or deleting the unique identifier of the application corresponding to the IPTV private network in the target file through the above method. This allows the latest application unique identifier set to be sent to the network protocol stack in real time, thereby ensuring that the accurate application unique identifier set can be obtained in a timely manner, and thus improving the stability and accuracy of dual-network access.

[0096] Based on any of the above embodiments, another specific embodiment of the dual-network adjustment method is given below. The application unique identifier set is stored in the global instance of the operating system kernel in the following manner: Read the target file to obtain the application's unique identifier set; The application's unique identifier set is saved to the global instance of the operating system kernel via a character device.

[0097] For example, the character device is network_iptv_ott_device. The whitelist list (the set of application unique identifiers) is sent to the character device network_iptv_ott_device by opening network_iptv_ott_device and the device_ioctl IOCTL_SET_IPTV_PKG_WHITELIST instruction. The character device network_iptv_ott_device saves the whitelist list to the kernel global instance struct iptv_pkg_whitelist.

[0098] The character device is created in advance within the operating system kernel. This operating system kernel can be a Linux kernel, meaning the operating system can be Linux, but it can also be any other system.

[0099] For example, a character device is created as follows: A new character device is defined and registered in the kernel to receive CMD commands passed from user space via ioctl. A new character device, `network_iptv_ott_device`, is defined in the kernel; the character device addition process follows the standard Linux character device addition process. The character device `network_iptv_ott_device` registers the `ioctl` interface of `file_operations {unlocked_ioctl = device_ioctl}` with the kernel to handle CMD commands passed from user space via ioctl. CMD commands include whitelist (application-unique identifier set) setting instructions, namely `IOCTL_SET_IPTV_PKG_WHITELIST`. After receiving the above instructions, the character device `network_iptv_ott_device` saves the whitelist to the kernel global instance `struct iptv_pkg_whitelist` via `copy_from_user`.

[0100] The set-top box dual-network access method provided in this embodiment of the invention can pass the application unique identifier set to the network protocol stack through a character device. This takes into account that the operating system (such as Linux) kernel does not have the concept of application unique identifier, but only the concept of process identifier. In other words, it takes into account that the application unique identifier is a concept of the Android framework layer, thereby improving the stability of dual-network access.

[0101] Based on any of the above embodiments, another specific embodiment of the dual-network regulation method is given below. Figure 3 This is the third flowchart illustrating the dual-network access method for set-top boxes provided by this invention, as follows: Figure 3 As shown, step 120 above includes steps 121 and 122.

[0102] Step 110: Obtain the data packet sent by the socket and determine the data packet marker of the data packet.

[0103] Step 121: Determine the routing table associated with the packet tag based on the first routing policy and the second routing policy.

[0104] The first routing policy is used to indicate the association between the first packet tag and the first routing table, and the second routing policy is used to indicate the association between the second packet tag and the second routing table. The first routing policy is added after the first routing table is successfully established, and the second routing policy is added after the second routing table is successfully established.

[0105] To configure the first and second routing policies, the following embodiment can be used. For example, the routing policy configuration service is initialized. This service has built-in policy routes that distinguish between IPTV and OTT services. The built-in policy route for IPTV services is fwmark=1000, and the policy route for OTT services is fwmark=1001. The fwmark values ​​for IPTV and OTT services can be customized according to system requirements; no specific limitation is made here. For instance, the routing policy configuration service is a shell script named add_policy_routing.sh. The linux init.rc is configured to start add_policy_routing.sh. After starting, add_policy_routing.sh polls every preset interval (e.g., 5 seconds) to check whether the first routing table `table eth0` and the second routing table `table wlan0` have been successfully established. If both are successfully established, the first and second routing policies are added by executing the scripts `Ip rule add fwmark 1000 table eth0` and `Ip rule add fwmark 1001 table wlan0`. The first routing policy means that packets with a Mark value of 1000 are forwarded using the first routing table in table eth0, and packets with a Mark value of 1001 are forwarded using the second routing table in table wlan0.

[0106] Step 122: Based on the routing table, route the data packet to the network interface card associated with the routing table, so as to send the data packet through the network interface card.

[0107] Here, network interface cards (NICs) include those associated with a private IPTV network or those associated with the public internet.

[0108] Furthermore, the network interface card (NIC) includes a wired NIC associated with the IPTV private network or a wireless NIC associated with the public internet. That is, this invention forwards IPTV service data packets and OTT service data packets to the wired and wireless NICs through different routing tables. Based on this, it makes reasonable use of the resources of existing set-top boxes, which typically already possess wired and wireless NICs. The wired NIC connects to the IPTV private network, and the wireless NIC connects to the public internet. Thus, the optical modem can directly distinguish between IPTV service data packets and OTT service data packets without requiring modification to the optical modem, thereby reducing the cost of dual-network access. In short, it achieves IPTV and OTT dual-network access through wired and wireless NICs.

[0109] The set-top box dual-network access method provided in this embodiment of the invention accurately determines the routing table associated with the data packet tag based on the first routing strategy and the second routing strategy. Based on the routing table, the data packet is accurately routed to the network card associated with the routing table, thereby ensuring that the data packets of IPTV service or OTT service can be routed to the corresponding network card quickly and accurately. That is, the present invention can quickly and accurately realize dual-network access.

[0110] To facilitate understanding of the above embodiments, a specific embodiment will be described here. For example... Figure 4 As shown, the set-top box's wired network card connects to the optical modem's IPTV dedicated network port via a network cable, thereby accessing IPTV resources on the platform. The set-top box's wireless network card connects to the router via Wi-Fi, and the router's WAN port connects to the optical modem's Internet port via a network cable, thereby accessing public Internet resources or RMS platform resources on the platform. IPTV data packets from the IPTV soft terminal and IPTV applications in the set-top box are routed to the wired network card via a policy routing component, and the wired network card sends and receives IPTV data packets. Similarly, Internet applications and RMS applications route OTT data packets to the wireless network card via a policy routing component, and the wireless network card sends and receives OTT data packets.

[0111] Among these, the construction of the aforementioned policy routing component is the most crucial. For example, after the default routing tables (first routing table and second routing table) of the set-top box's wired and wireless network cards are generated, the construction process of the policy routing component begins. The policy routing component consists of multiple system modules, including four parts: routing policy configuration Service, network_iptv_ott_device character device, ActivityManagerService, and Socket.

[0112] After the above-mentioned policy routing component is constructed, the business APP starts and requests to establish a network connection. The network data packet routing and forwarding process of the business APP is illustrated in the following embodiment. Specifically, taking the IPTV data packet sending process as an example, it is divided into the following seven steps.

[0113] The first step is to create a Socket. When the IPTV App triggers a network request, the App's network framework creates a Socket. The kernel protocol stack checks if the packet name corresponding to the process PID that created the Socket is in the IPTV packet name whitelist. Specifically, it searches the `struct pid_pkg_info_list` for a packet name associated with the Socket's PID and checks the `struct iptv_pkg_whitelist` for that packet name. If found, it adds a flag of `fwmark=1000` to the Socket. The Socket then calls `connect` to initiate a handshake and establish a connection with the server.

[0114] The second step is to add TCP / UDP headers. Add a TCP or UDP header to the data. The header includes the source port and destination port. The source port is generated and maintained by the system, while the destination port is specified by the IPTV app, such as port 80 for HTTP requests.

[0115] The third step is routing policy determination. The data packet is passed down the network protocol stack to the protocol stack routing module. The protocol stack routing module finds that the data packet's Mark=1000. According to the routing policy, fwmark=1000 points to the eth0 routing table, which indicates that the data packet needs to be sent out from the eth0 network interface.

[0116] The fourth step is to add an IP header. Add an IP header to the data packet, including the source IP and the destination IP. The destination IP is obtained through a DNS lookup of the domain name requested in the network request, and the source IP is set to the IP address of the eth0 interface.

[0117] Step 5: Add a data link layer frame header. Add a data link layer frame header to the data packet, including the source MAC address and the destination MAC address. The source MAC address is the MAC address of the wired network card eth0, and the destination MAC address is the MAC address of the IPTV private network interface card of the optical modem or the MAC address of the optical modem.

[0118] The sixth step is to convert the data frames into a physical layer data bit stream. The data frames are encapsulated into a bit stream according to the physical layer protocol, and the bit stream is sent to the IPTV private network port of the optical modem via a network cable.

[0119] Step 7: The optical modem receives the bit stream, checks the port binding mechanism configured by default, and finds that the IPTV private network port is bound to the IPTV VLAN tag. Therefore, it decapsulates the bit stream and adds the IPTV VLAN tag to the data frame. The data frame with the added VLAN tag is then encapsulated into a bit stream according to the physical layer protocol, and the bit stream is sent to the IPTV server through the optical fiber.

[0120] Furthermore, the process of receiving IPTV data packets will be explained as an example, which is divided into the following five steps.

[0121] The first step involves the optical modem receiving the data bitstream via fiber optic cable. After decapsulation, it discovers the VLAN tag is for IPTV. Based on the port binding mechanism configured on the optical modem, it determines to forward the data packet via the IPTV dedicated network port. The optical modem removes the VLAN tag, modifies the source MAC address in the frame header to either the MAC address of the IPTV dedicated network port's network card or the optical modem's MAC address, and sets the destination MAC address to the MAC address of the set-top box's wired network card eth0. Finally, it encapsulates the data into a bitstream based on physical layer protocols and sends it to the set-top box's wired network card eth0 via the network cable.

[0122] The second step is that after the set-top box's wired network card eth0 receives the data stream, it decapsulates the bit stream to obtain the data frame. If the destination MAC is consistent with the MAC of the wired network card eth0, the data frame is decapsulated into a data packet.

[0123] The third step is to determine if the destination IP of the data packet matches the IP of the wired network card eth0, and then continue to decapsulate and check the destination port.

[0124] The fourth step is for the system to query the Socket list to find which Socket is associated with the destination port, and then send the decapsulated data packet to that Socket.

[0125] The fifth step involves the Socket copying data from kernel space to user space and notifying the IPTV application to retrieve network data.

[0126] Furthermore, it should be noted that the OTT data packet process is similar to that of IPTV data packets, except that the data packet transmission involves an additional router forwarding process. Also, after the optical modem receives the data frame from the Internet port, it adds an Internet VLAN tag and sends it to the public Internet platform via fiber optic cable. The IPTV VLAN tag and the Internet VLAN tag on the optical modem are determined during the operator's network planning.

[0127] To facilitate a further understanding of the above embodiments, a specific embodiment will be described here. Figure 5 This is the fourth flowchart illustrating the dual-network access method for set-top boxes provided by this invention, as follows: Figure 5 As shown, the dual-network access method of this set-top box includes: Step 501: After creating the Socket, determine the process identifier of the application process associated with the Socket; Step 502: Based on the identifier association relationship, determine the unique identifier of the application associated with the process identifier; Step 503: If the application unique identifier exists in the application unique identifier set, determine that the data packet is marked as the first data packet identifier; if the application unique identifier does not exist in the application unique identifier set, determine that the data packet is marked as the second data packet identifier. Step 504: Set the data packet tag for the Socket to mark the data packet when the Socket sends a data packet; Step 505: Obtain the data packet sent by the socket and determine the data packet marker of the data packet; Step 506: Based on the first routing policy and the second routing policy, determine the routing table associated with the packet tag; Step 507: Based on the routing table, route the data packet to the network interface card associated with the routing table, so as to send the data packet through the network interface card.

[0128] Based on the above embodiments, this invention requires no modification to the optical modem or the business app; only modifications are needed from the set-top box manufacturer. The modifications only involve changes to the source code, and it makes reasonable use of currently idle wireless network cards in set-top boxes without increasing hardware costs. Therefore, it has strong applicability for widespread deployment and can be widely applied to set-top boxes.

[0129] The set-top box dual network access device provided by the present invention is described below. The set-top box dual network access device described below and the set-top box dual network access method described above can be referred to in correspondence.

[0130] Figure 6 This is a schematic diagram of the structure of the set-top box dual-network access device provided by the present invention, as shown below. Figure 6 As shown, the set-top box dual-network access device includes a determination module 610 and a transmission module 620.

[0131] The determination module 610 is used to obtain the data packets sent by the socket and determine the data packet marker of the data packets; the data packet marker includes a first data packet marker associated with the Internet Protocol Television (IPTV) private network, or a second data packet marker associated with the public Internet.

[0132] The sending module 620 is configured to send the data packet based on a routing table associated with the data packet tag; the routing table includes a first routing table associated with the first data packet tag or a second routing table associated with the second data packet tag.

[0133] In this context, all data packets sent by the Socket are marked with the same data packet tag, and the data packet tag is determined based on the application unique identifier of the application associated with the Socket.

[0134] The set-top box dual-network access device provided in this embodiment of the invention obtains data packets sent by a Socket, determines the data packet tag of the data packet, and sends the data packet based on the routing table associated with the data packet tag. All data packets sent by the Socket are tagged with the same data packet tag. This data packet tag is determined based on the application unique identifier of the application associated with the Socket, thus associating the Socket with the application unique identifier, and further associating the application unique identifier with the data packet tag. The data packet tag includes a first data packet tag associated with the IPTV private network or a second data packet tag associated with the public Internet. The routing table includes a first routing table associated with the first data packet tag or a second routing table associated with the second data packet tag, thus associating the application unique identifier with the routing table. Since the application unique identifier of the application does not change, it can be clearly stated that the IPTV service application is associated with the first routing table, and the OTT service corresponding to the public Internet is associated with the second routing table. This allows for quick and simple setup of the association relationship, ensuring that data packets of the IPTV service or OTT service can be quickly and accurately routed to the corresponding routing table. In other words, this invention can quickly and accurately achieve dual-network access. Furthermore, once the association is set, it requires minimal subsequent modification, resulting in greater system stability and improved stability of dual-network access.

[0135] Based on any of the above embodiments, the device further includes: The identifier determination module is used to determine the process identifier of the application process associated with the Socket after the Socket is created; The identifier determination module is used to determine the application unique identifier associated with the process identifier based on the identifier association relationship; the identifier association relationship is used to indicate the correspondence between the process identifier and the application unique identifier. The tag determination module is used to determine the data packet tag associated with the application type based on the application's unique identifier; the application type is the type of application associated with the Socket, and the application type includes the application corresponding to the IPTV private network or the application corresponding to the public Internet; A tag setting module is used to set the data packet tag for the Socket, so as to mark the data packet tag when the Socket sends a data packet.

[0136] Based on any of the above embodiments, the identifier association is obtained in the global instance of the operating system kernel, and the identifier association is saved to the global instance of the operating system kernel based on the following modules: The identification association module is used to associate the process identifier with the unique identifier of the application when the application process of the application associated with the Socket is started, thereby obtaining the identification association relationship. The relationship storage module is used to save the identification association relationship to the global instance of the operating system kernel.

[0137] Based on any of the above embodiments, the relationship storage module is specifically used for: The identifier association is saved to the global instance of the operating system kernel via a character device.

[0138] The character device is created in advance in the operating system kernel.

[0139] Based on any of the above embodiments, the marker determination module is specifically used for: If the application unique identifier exists in the application unique identifier set, the data packet is identified as the first data packet identifier; If the application unique identifier does not exist in the application unique identifier set, the data packet is identified as the second data packet identifier.

[0140] The application unique identifier set includes unique identifiers for several applications corresponding to the IPTV private network.

[0141] Based on any of the above embodiments, the application unique identifier set is obtained from the global instance of the operating system kernel, and the application unique identifier set is saved to the global instance of the operating system kernel based on the following modules: The file reading module is used to read the target file and obtain the application's unique identifier set; The identifier set storage module is used to save the application's unique identifier set to the global instance of the operating system kernel.

[0142] Accordingly, the device also includes: The instruction receiving module is used to receive modification instructions that modify the application's unique identifier set; The instruction response module is used to respond to the modification instruction by adding or deleting the unique identifier of the application corresponding to the IPTV private network in the target file.

[0143] Based on any of the above embodiments, the sending module 620 is specifically used for: Based on the first routing policy and the second routing policy, a routing table associated with the packet tag is determined; Based on the routing table, the data packet is routed to the network interface card (NIC) associated with the routing table, so that the data packet can be sent through the NIC.

[0144] The first routing policy is used to indicate the association between the first packet tag and the first routing table, and the second routing policy is used to indicate the association between the second packet tag and the second routing table. The first routing policy is added after the first routing table is successfully established, and the second routing policy is added after the second routing table is successfully established.

[0145] Based on any of the above embodiments, the network card includes a wired network card associated with the IPTV private network, or a wireless network card associated with the public Internet.

[0146] Figure 7 This example illustrates a schematic diagram of the physical structure of an electronic device or set-top box, such as... Figure 7 As shown, the electronic device or set-top box may include: a processor 710, a communications interface 720, a memory 730, and a communication bus 740, wherein the processor 710, communications interface 720, and memory 730 communicate with each other through the communication bus 740. The processor 710 can call logical instructions in the memory 730 to execute a dual-network access method for the set-top box. This method includes: acquiring data packets sent by a socket; determining the data packet tag of the data packet; the data packet tag includes a first data packet tag associated with an IPTV private network or a second data packet tag associated with the public Internet; sending the data packet based on a routing table associated with the data packet tag; the routing table includes a first routing table associated with the first data packet tag or a second routing table associated with the second data packet tag; wherein all data packets sent by the socket are tagged with the same data packet tag, and the data packet tag is determined based on the application unique identifier of the application associated with the socket.

[0147] Furthermore, the logical instructions in the aforementioned memory 730 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 the present invention, essentially, 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 the present invention. 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.

[0148] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the set-top box dual-network access method provided by the above methods. The method includes: acquiring data packets sent by a socket, determining the data packet tag of the data packet; the data packet tag includes a first data packet tag associated with an Internet Protocol Television (IPTV) private network, or a second data packet tag associated with the public Internet; sending the data packet based on a routing table associated with the data packet tag; the routing table includes a first routing table associated with the first data packet tag or a second routing table associated with the second data packet tag; wherein the data packets sent by the socket are all tagged with the same data packet tag, and the data packet tag is determined based on the application unique identifier of the application associated with the socket.

[0149] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the set-top box dual-network access method provided by the above methods. The method includes: acquiring data packets sent by a socket; determining a data packet marker for the data packets; the data packet marker includes a first data packet marker associated with an Internet Protocol Television (IPTV) private network, or a second data packet marker associated with the public Internet; sending the data packets based on a routing table associated with the data packet marker; the routing table includes a first routing table associated with the first data packet marker or a second routing table associated with the second data packet marker; wherein the data packets sent by the socket are all marked with the same data packet marker, and the data packet marker is determined based on the application unique identifier of the application associated with the socket.

[0150] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0151] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0152] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention 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; and these 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 the present invention.

Claims

1. A method for dual-network access of a set-top box, characterized in that, include: Obtain the data packets sent by the socket and determine the data packet marker of the data packets; The packet tagging includes a first packet tag associated with the Internet Protocol Television (IPTV) private network, or a second packet tag associated with the public Internet; The data packet is sent based on a routing table associated with the data packet tag; the routing table includes a first routing table associated with the first data packet tag or a second routing table associated with the second data packet tag. In this context, all data packets sent by the Socket are marked with the same data packet tag, and the data packet tag is determined based on the application unique identifier of the application associated with the Socket.

2. The set-top box dual-network access method according to claim 1, characterized in that, Before obtaining the data packet sent by the socket, the method further includes: After the Socket is created, the process identifier of the application process associated with the Socket is determined; Based on the identifier association relationship, the application unique identifier associated with the process identifier is determined; the identifier association relationship is used to indicate the correspondence between the process identifier and the application unique identifier. Based on the application's unique identifier, a data packet tag associated with the application type is determined; the application type is the type of application associated with the Socket, and the application type includes the application corresponding to the IPTV private network or the application corresponding to the public Internet; Set the data packet tag for the Socket to mark the data packet when the Socket sends a data packet.

3. The set-top box dual-network access method according to claim 2, characterized in that, The identifier association is obtained from the global instance of the operating system kernel, and the identifier association is saved to the global instance of the operating system kernel in the following manner: When the application process of the application associated with the Socket is started, the process identifier is associated with the unique identifier of the application to obtain the identifier association relationship; The identification association is saved to the global instance of the operating system kernel.

4. The set-top box dual-network access method according to claim 3, characterized in that, Saving the identifier association to the global instance of the operating system kernel includes: The identifier association is saved to the global instance of the operating system kernel via a character device; The character device is created in advance in the operating system kernel.

5. The set-top box dual-network access method according to claim 2, characterized in that, The step of determining the data packet marker associated with the application type based on the application's unique identifier includes: If the application unique identifier exists in the application unique identifier set, the data packet is identified as the first data packet identifier; If the application unique identifier does not exist in the application unique identifier set, the data packet is identified as the second data packet identifier; The application unique identifier set includes unique identifiers for several applications corresponding to the IPTV private network.

6. The set-top box dual-network access method according to claim 5, characterized in that, The application unique identifier set is obtained from the global instance of the operating system kernel, and the application unique identifier set is saved to the global instance of the operating system kernel in the following manner: Read the target file to obtain the application's unique identifier set; Save the application's unique identifier set to a global instance of the operating system kernel; Accordingly, the set-top box dual-network access method further includes: Receive a modification instruction to modify the application's unique identifier set; In response to the modification instruction, add or delete the unique identifier of the application corresponding to the IPTV private network in the target file.

7. The set-top box dual-network access method according to any one of claims 1 to 6, characterized in that, Sending the data packet based on the routing table associated with the data packet tag includes: Based on the first routing policy and the second routing policy, a routing table associated with the packet tag is determined; Based on the routing table, the data packet is routed to the network interface card associated with the routing table, so as to send the data packet through the network interface card; The first routing policy is used to indicate the association between the first packet tag and the first routing table, and the second routing policy is used to indicate the association between the second packet tag and the second routing table. The first routing policy is added after the first routing table is successfully established, and the second routing policy is added after the second routing table is successfully established.

8. The set-top box dual-network access method according to claim 7, characterized in that, The network interface card (NIC) includes a wired NIC associated with the IPTV private network or a wireless NIC associated with the public Internet.

9. A set-top box dual-network access device, characterized in that, include: The determination module is used to obtain the data packets sent by the socket and determine the data packet marker of the data packets; The packet tagging includes a first packet tag associated with the Internet Protocol Television (IPTV) private network, or a second packet tag associated with the public Internet; A sending module is configured to send the data packet based on a routing table associated with the data packet tag; the routing table includes a first routing table associated with the first data packet tag or a second routing table associated with the second data packet tag; In this context, all data packets sent by the Socket are marked with the same data packet tag, and the data packet tag is determined based on the application unique identifier of the application associated with the Socket.

10. A set-top box, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the set-top box dual-network access method as described in any one of claims 1 to 8.

11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the set-top box dual-network access method as described in any one of claims 1 to 8.

12. A non-transitory 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 dual-network access method as described in any one of claims 1 to 8.

13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the set-top box dual-network access method as described in any one of claims 1 to 8.