Set top box and gateway data interaction method based on UART serial port and Ethernet
By setting up a UART serial port and Ethernet interface between the gateway and the set-top box, and using the AES algorithm to encrypt and transmit the gateway's network configuration information, the communication anomaly problem caused by gateway IP changes is solved, the development and maintenance process is simplified, and the stability and maintainability of the system are ensured.
Patent Information
- Application Number
- CN202511068438.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-31
- Publication Date
- 2025-10-10
AI Technical Summary
In the existing technology, the data interaction scheme between the gateway and the set-top box is complicated, resulting in communication anomalies when the gateway IP address changes. It is also difficult to develop and maintain, and it is impossible to independently troubleshoot the problem.
A UART serial port and Ethernet interface are set up between the set-top box and the gateway. The gateway sends network configuration information through the UART serial port, and the set-top box re-logs into the gateway web server to ensure normal communication. The AES algorithm is used to encrypt transmission, simplifying development and troubleshooting.
It ensures normal communication between top boxes when the gateway IP changes, simplifies the development and maintenance process, reduces the complexity of synchronous modification, and improves the stability and maintainability of the system.
Smart Images

Figure CN120769128A_ABST
Abstract
Description
Technical Field
[0001] The present invention mainly relates to the field of communication technology, and in particular to a data interaction method between a set-top box and a gateway based on a UART serial port and Ethernet. Background Art
[0002] Broadband converged terminals primarily consist of two modules: a gateway and a set-top box. Necessary data interactions occur between the gateway and the set-top box, such as configuring the gateway's WAN connection and Wi-Fi parameters on the set-top box, displaying basic set-top box information on the gateway's web page, and upgrading the gateway module through the set-top box. Currently, the mainstream solution for data interaction between gateways and set-top boxes uses Ethernet as the medium and a traditional client-server architecture, where the gateway provides a service interface to the set-top box, and the set-top box configures the gateway using an app. This approach introduces numerous difficulties to software development and maintenance. For example, changes to the gateway's IP address and other configurations can prevent the set-top box from communicating properly with the gateway. Adding new service interfaces requires collaborative modifications on both the gateway and the set-top box. Set-top box developers must monitor the functionality of the gateway module, and any issues with related functions require simultaneous troubleshooting on both the gateway and the set-top box. Summary of the Invention
[0003] The technical problems we want to solve are: A method for data interaction between a set-top box and a gateway based on a UART serial port and Ethernet is provided, the purpose of which is to ensure that the set-top box and the gateway can communicate normally after the network configuration information of the gateway is changed.
[0004] The technical solution adopted by the present invention to solve the above technical problems is: A method for data interaction between a set-top box and a gateway based on a UART serial port and Ethernet, the method comprising: Set up UART serial port and Ethernet interface between the set-top box and the gateway; The gateway sends the network configuration information of the gateway web server to the set-top box through the UART serial port. The set-top box accesses the gateway web server, confirms that the gateway web server is started normally, and then logs in to the gateway web server based on the received network configuration information. When the gateway detects that the network configuration information of the gateway web server has changed, it will forcibly end the web session with the set-top box and send the changed network configuration information to the set-top box through the UART serial port. The set-top box will then log in to the gateway web server again. After the set-top box completes data interaction with the gateway, it logs out of the gateway web server.
[0005] Furthermore, the set-top box accesses the gateway web server through the Webkit browser.
[0006] Furthermore, the network configuration information of the gateway web server includes the IP, port, account and password of the web server.
[0007] Furthermore, the web server account and password sent by the gateway to the set-top box through the UART serial port is a randomly generated password.
[0008] Furthermore, the network configuration information is encrypted using an AES algorithm before being transmitted via the UART serial port.
[0009] The beneficial effects of the present invention are as follows: the gateway sends the network configuration information of the web server to the set-top box based on the UART serial port. Even if the configuration information such as the IP address of the gateway changes, the set-top box can obtain the new network configuration information of the web server through the UART serial port and re-login to the gateway without affecting the normal communication between the gateway and the set-top box; and the set-top box accesses the gateway web server through the Webkit browser. When debugging the gateway web service, the gateway developer only needs to debug directly through the PC browser, without the need to synchronously modify the data on the set-top box side, which simplifies the procedures and complexity of adding new service interfaces and gateway fault troubleshooting. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 This is a flow chart of the set-top box logging into the gateway web server after power-on; Figure 2 This is the interaction process between the set-top box and the gateway after the network configuration information of the gateway web server changes. DETAILED DESCRIPTION
[0011] The core idea of the set-top box and gateway data interaction method based on UART serial port and Ethernet described in the present invention to solve the above technical problems is: a UART serial port and an Ethernet interface are set between the gateway and the set-top box, and the set-top box obtains network configuration information such as the IP, account and password for logging into the gateway web server based on the UART serial port. After the set-top box logs in to the gateway web server, the gateway provides web services to the set-top box through Ethernet. When the network configuration information such as the IP of the gateway server changes, the gateway directly transmits the changed network configuration information to the set-top box through the UART serial port. The set-top box exits the current login and re-logs into the gateway based on the obtained new network configuration information, ensuring that after the network configuration information of the web server is changed, the gateway and the set-top box can communicate normally.
[0012] After the system is powered on, the flow chart of the set-top box logging into the gateway web server is as follows Figure 1 Shown, including: Step S1: The set-top box obtains the IP and port of the gateway web server The gateway web server IP address is the gateway address, the port value is 8080 or 80 for providing http service, and the port value is 443 for providing https service.
[0013] Step S2: The set-top box obtains the web server account and password To ensure the security of the converged terminal, a new web server password is randomly generated each time the gateway is powered on. The web server account password is encrypted using the AES algorithm and then transmitted to the set-top box through the UART serial port.
[0014] Step S3: The set-top box's IP address, subnet mask, gateway address, DNS server address, and gateway WAN connection status are transmitted to the gateway via the UART serial port or Ethernet. The specific transmission method can be selected based on the data volume and data transmission stability requirements. If data stability requirements are high and the data transmission volume is small, the UART serial port can be used for transmission; otherwise, Ethernet can be used for data transmission.
[0015] Step S4: The set-top box obtains the status of the web server Broadband converged terminals are used in hotels, businesses, homes, and other scenarios. In these scenarios, system startup time must be minimized to ensure that the set-top box (STB) can quickly retrieve homepage data from the network. Currently, STBs with mainstream chip solutions boot much faster than gateways. To shorten startup time, gateways often delay the startup of modules like web and Wi-Fi. Consequently, the gateway's web server may not be started even after the STB and gateway complete basic data exchange via the UART serial port. Therefore, before the STB logs into the gateway, it's important to confirm that the web server has successfully started.
[0016] Step S5: The set-top box logs in to the gateway web server After the set-top box generates the correct URL access path according to the information obtained in steps S1 and S2, it starts the webkit browser to access the gateway web and logs in using the account and password obtained from the UART serial port. After logging in, data interaction can be carried out through Ethernet.
[0017] Step S6: The set-top box logs out of the web server In order to prevent conflicts caused by simultaneous configuration of the gateway through web accounts, the gateway web server is designed to only be logged in by one account. Therefore, when the set-top box exits the gateway configuration, it is necessary to log out of the web server to prevent the web server from being locked and unable to log in again.
[0018] The set-top box logs into the gateway web server. After the network configuration information of the web server changes, the data interaction process between the set-top box and the gateway is as follows: Figure 2Shown, including: Step T1: When the gateway's IP address or web server account and password information changes, the gateway forces the user who has logged into the web server to log out, and the gateway encrypts the changed information and informs the set-top box through the UART serial port.
[0019] Step T2: The set-top box logs out of the web server Step T3: The set-top box decodes the changed network configuration information obtained through the UART serial port, generates a new URL access path, and re-logs into the web server. After logging in, data interaction can continue.
[0020] Step T4: After the set-top box and the gateway complete information exchange, log out of the gateway web server.
Claims
1. A method for data interaction between a set-top box and a gateway based on a UART serial port and Ethernet, characterized in that: The method comprises: Set up UART serial port and Ethernet interface between the set-top box and the gateway; The gateway sends the network configuration information of the gateway web server to the set-top box through the UART serial port. The set-top box accesses the gateway web server, confirms that the gateway web server is started normally, and then logs in to the gateway web server based on the received network configuration information. When the gateway detects that the network configuration information of the gateway web server has changed, it will forcibly end the web session with the set-top box and send the changed network configuration information to the set-top box through the UART serial port. The set-top box will then log in to the gateway web server again. After the set-top box completes data interaction with the gateway, it logs out of the gateway web server.
2. The method for interacting data between a set-top box and a gateway based on a UART serial port and Ethernet according to claim 1, wherein: The set-top box accesses the gateway web server through the Webkit browser.
3. The method for interacting data between a set-top box and a gateway based on a UART serial port and Ethernet according to claim 1 or 2, wherein: The network configuration information of the gateway web server includes the IP, port, account and password of the web server.
4. The method for interacting data between a set-top box and a gateway based on a UART serial port and Ethernet according to claim 3, wherein: The web server account and password sent by the gateway to the set-top box through the UART serial port are randomly generated passwords.
5. The method for interacting data between a set-top box and a gateway based on a UART serial port and Ethernet according to claim 3, wherein: The network configuration information is encrypted using the AES algorithm before being transmitted through the UART serial port.