Voice module and set top box data interaction method, device and medium
By using a server to generate a virtual IP network card and HTTP protocol in the smart home network, the data interaction problem between the voice module and the set-top box module is solved, realizing stable data transmission and intelligent control across modules, and improving the intelligence level of the integrated gateway.
Patent Information
- Application Number
- CN202511550915.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-28
- Publication Date
- 2026-03-10
- Estimated Expiration
- 2045-10-28
AI Technical Summary
In smart home networking, the lack of a standardized data interaction channel between the voice module and the set-top box module prevents voice data from being transmitted to the set-top box module in a targeted manner, thus limiting the intelligence level of the integrated gateway.
The server in the set-top box module receives the IP address sent by the optical modem module after building a local area network, generates a fixed virtual IP network card, and uses the HTTP protocol to realize data interaction between the voice module and the set-top box module, including the conversion and parsing of voice data, to ensure data format and communication stability.
It achieves compatibility and stability of cross-module data interaction, improves the intelligent interaction efficiency of the integrated gateway, avoids user intervention, and ensures the patent protection of the technical solution.
Smart Images

Figure CN121644523A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of set-top box data interaction technology, and specifically relates to a method, device and medium for data interaction between a voice module and a set-top box. Background Technology
[0002] In the current equipment architecture, the integrated gateway is used to realize data conversion between different networks, supporting protocol translation, data re-encapsulation, and security filtering functions. It operates at the OSI model transport layer and above, is compatible with broadband access methods such as ADSL, VDSL, and LAN, and can adapt to the networking needs of various terminal devices such as telephones and smart home appliances.
[0003] In smart home networking, although the voice module, set-top box module, and optical modem module on the integrated gateway are physically integrated into the gateway, they operate logically independently: the voice module only has voice acquisition and preliminary processing functions, the set-top box module is only responsible for audio and video playback control, and the optical modem module only provides basic network access; there is no standardized data interaction channel between the three. This isolation results in: voice data collected by the voice module cannot be transmitted to the set-top box module; the set-top box module cannot receive and execute voice commands; and the network resources of the optical modem module cannot provide customized support for cross-module communication. Ultimately, the collaborative function of "voice control of the set-top box" cannot be realized, limiting the intelligence level of the integrated gateway and failing to meet the technological development needs of device interaction. Summary of the Invention
[0004] In view of the above problems, this invention proposes a method, device, and medium for data interaction between a voice module and a set-top box. This solves the problem of voice data not being able to be transmitted directionally to the set-top box module, thus hindering the coordination of voice control of the set-top box.
[0005] One embodiment of this application provides a method for data interaction between a voice module and a set-top box, including: The server in the set-top box module receives the IP address sent by the optical modem module after it has built a local area network; and executes a startup script based on the IP address to generate a fixed virtual IP network card. The server receives HTTP POST requests transmitted by the voice module, identifies the virtual IP network card in the voice module, and then parses the voice data sent by the voice module via the HTTP protocol. After the server successfully parses the voice data, it triggers the Android application to execute the specified operation in the Android application; when an error message is parsed in the voice data, the server sends an error message back to the voice module.
[0006] Furthermore, the server receives the IP address sent by the optical modem module after establishing the local area network, including: The optical modem module reads the built-in routing configuration and configures the network segment where the virtual network card is located and the network segment where the physical IP is located as interconnected routes according to the routing configuration; The DHCP service is used to assign dynamic IP addresses to the physical network card and voice module in the set-top box module and send them to the server of the set-top box module.
[0007] Furthermore, the step of generating a fixed virtual IP network card by executing a boot script based on the IP address includes: The boot script calls the IP command to obtain the IP address, executes the boot script to generate a virtual IP network card, and uses the ifconfig command to configure a fixed IP address for the virtual IP network card to generate a fixed virtual IP network card.
[0008] Furthermore, before the server receives the HTTP POST request transmitted by the voice module, it includes: When the voice module is powered on, it sends a network message control protocol Echo request message to the server through its built-in network detection unit. If the request is successful, the voice module will write the server's virtual IP address into the local communication configuration table as the target address for subsequent data transmission; If the request fails, the voice module will trigger a network error alarm.
[0009] Furthermore, the server's targeted reception of HTTP POST requests transmitted by the voice module includes: The voice module collects analog voice signals through its built-in microphone and converts the analog voice signals into digital audio data. The digital audio data is converted into text commands, and the voice module encapsulates the text commands into JSON data according to a preset format. Call the HTTP client library, use JSON data as the request body, and generate an HTTP POST request.
[0010] Furthermore, the virtual IP network card in the voice recognition module includes: After the set-top box module completes initialization, it starts the HTTP server built into the Nginx framework and configures the server listening port. After the server starts, it loads the request processing rules of the preset virtual IP network card and filters illegal requests through the preset request rules; the request processing rules include: receiving method, request body format and fields.
[0011] Furthermore, the virtual IP network card in the voice recognition module also includes: The network transmission unit of the voice module sends HTTP POST requests to the port of the virtual IP address of the set-top box module through the local area network built by the optical modem module; The set-top box module's HTTP server listens on a port with a virtual IP address. Upon receiving a request, it first verifies the request header format. If the format is valid, extract the JSON data from the request body; if the format is invalid, directly generate an invalid format response and send it back to the voice module.
[0012] Furthermore, parsing the voice data sent by the voice module via the HTTP protocol includes: The HTTP server in the set-top box module calls the JSON parsing engine to perform syntax and field validation on the JSON data extracted from the voice data; Syntax validation of the JSON data includes checking for matching brackets and closing quotes in the JSON data; Field validation of the JSON data includes: checking the required fields in the JSON data, where the required fields are a preset instruction set; After the JSON data passes syntax and field validation, the server generates a response and sends it back to the voice module via the original HTTP link. It also extracts the field values to generate the corresponding application startup command and sends it to the Android application of the set-top box module. If syntax and field validation of the JSON data fails, the server generates a failure response and sends it back to the voice module via the original HTTP link.
[0013] Based on the same inventive concept, another aspect of the embodiments of this application provides an electronic device, including: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, which stores computer programs; When the processor executes a program stored in memory, it implements a method for data interaction between the voice module and the set-top box.
[0014] Based on the same inventive concept, another aspect of the embodiments of this application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements a method for data interaction between a voice module and a set-top box.
[0015] The beneficial effects of this invention are: This application involves a server receiving the IP address sent by the optical modem module after establishing a local area network (LAN); generating a fixed virtual IP network card by executing a boot script based on the IP address; receiving HTTP POST requests transmitted by the voice module, identifying the virtual IP network card in the voice module, and parsing the voice data sent by the voice module via the HTTP protocol; and triggering a specified operation in the Android application after successful parsing of the voice data. Specifically, standardized data formats and communication protocols solve the compatibility problem of cross-module data interaction; fixed virtual IP and LAN configuration ensure communication stability; and module autonomous execution replaces user intervention, ensuring the patentability of the technical solution while improving the intelligent interaction efficiency of the integrated gateway.
[0016] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures pointed out in the description and the drawings. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present 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 the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 A flowchart illustrating a method for data interaction between a voice module and a set-top box is shown. Figure 2 A schematic diagram of the integrated gateway device architecture is shown; Figure 3 A schematic diagram of the data interaction process is shown; Figure 4 A schematic diagram of an electronic device is shown. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] It should be noted that the terms "first," "second," etc., used in this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. In this application, the terms "upper," "lower," "left," "right," "front," "rear," "top," "bottom," "inner," "outer," "middle," "vertical," "horizontal," "lateral," "longitudinal," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings.
[0021] One embodiment of this application provides a method for data interaction between a voice module and a set-top box. See [link to relevant documentation]. Figure 1 ,include: S101: The server in the set-top box module receives the IP address sent by the optical modem module after it has built a local area network; and executes the startup script to generate a fixed virtual IP network card based on the IP address. S102: The server receives the HTTP POST request transmitted by the voice module, identifies the virtual IP network card in the voice module, and then parses the voice data sent by the voice module through the HTTP protocol. S103: After the server successfully parses the voice data, it triggers the Android application to execute the specified operation in the Android application; when an error message is parsed in the voice data, the server sends an error message back to the voice module.
[0022] The voice module and set-top box data interaction method described in the embodiments of this specification are typically used in servers, which can be cloud servers or local servers. Servers can be electronic devices such as laptops, desktop computers, tablets, and all-in-one computers.
[0023] Specifically, this application uses the optical modem module to provide network support, the voice module to initiate data, and the set-top box module to process data and execute commands as the main logical thread, constructing a complete closed loop of "data acquisition - network transmission - parsing and processing - command response": Among them, the optical modem module builds a local area network through IP allocation, providing a dedicated communication environment for the voice module and the set-top box module; The set-top box module generates a fixed virtual IP and an internal server through a startup script, forming a data receiving and processing hub; The voice module converts voice data into structured JSON data and transmits it to the set-top box module via an HTTP POST request. After the internal server of the set-top box module parses the data, it triggers the Android application to execute instructions or return error information.
[0024] By using a standardized data format (JSON) and communication protocol (HTTP), the compatibility issues of cross-module data interaction are resolved; by using a fixed virtual IP and local area network configuration, the stability of communication is ensured; and by replacing "user intervention" with "module autonomous execution," the patent protection attributes of the technical solution are ensured, while improving the intelligent interaction efficiency of the integrated gateway.
[0025] Specifically, in step S101, the server receives the IP address sent by the optical modem module after it has built the local area network, including: The optical modem module reads the built-in routing configuration and configures the network segment where the virtual network card is located and the network segment where the physical IP is located as interconnected routes according to the routing configuration; The DHCP service is used to assign dynamic IP addresses to the physical network card and voice module in the set-top box module and send them to the server of the set-top box module.
[0026] Specifically, see Figure 2 After the integrated gateway supplies power, the power management unit built into the set-top box module triggers system startup, automatically calling the boot script (a pre-compiled shell program) stored in local flash memory. The boot script first checks the hardware status of the set-top box module (such as CPU, memory, and network interface). After confirming that the hardware is normal, it executes the virtual network card generation command. The boot script completes the hardware self-test to avoid subsequent interaction failures due to hardware abnormalities. The core function of generating the virtual network card is to provide a "fixed communication endpoint" for the voice module, avoiding communication interruptions caused by dynamic changes in the physical IP address.
[0027] After the optical modem module powers on, it assigns dynamic IP addresses to the set-top box module (physical network card) and the voice module via DHCP service, such as the set-top box physical IP: 192.168.1.100, and the voice module IP: 192.168.1.101. At the same time, the optical modem module reads the built-in routing configuration and configures the "192.168.88.0 / 24" network segment (the network segment where the virtual network card is located) and the "192.168.1.0 / 24" network segment (the network segment where the physical IP is located) as interconnected routes.
[0028] Dynamic IP allocation is achieved through the DHCP protocol to ensure network access for the modules; network reachability between the "voice module physical IP" and the "set-top box virtual IP" is achieved through routing configuration, thus building the local area network foundation for cross-module communication.
[0029] In step S101, the step of generating a fixed virtual IP network card by executing a boot script based on the IP address includes: The boot script calls the IP command to obtain the IP address, executes the boot script to generate a virtual IP network card, and uses the ifconfig command to configure a fixed IP address for the virtual IP network card to generate a fixed virtual IP network card.
[0030] Specifically, the boot script calls the `ip` command to generate a virtual network interface card (NIC). For example, the device name is preset to "peth0," and the `ifconfig` command is used to configure a fixed IP address for the virtual NIC: 192.168.88.88, with a subnet mask of 255.255.255.0. Once generated, the virtual NIC is used by the internal server. This fixed virtual IP address serves as the "unique and fixed communication target" for the voice module, a prerequisite for cross-module data transmission.
[0031] In this application, before the server receives the HTTP POST request transmitted by the voice module, it includes: When the voice module is powered on, it sends a network message control protocol Echo request message to the server through its built-in network detection unit. If the request is successful, the voice module will write the server's virtual IP address into the local communication configuration table as the target address for subsequent data transmission; If the request fails, the voice module will trigger a network error alarm.
[0032] Specifically, see Figure 3 After the voice module is powered on, it pings the virtual IP address of the set-top box module through the built-in network detection unit. For example, if the virtual IP address is 192.168.88.88, it verifies network connectivity. If the ping is successful, the voice module writes the virtual IP address into the local communication configuration table as the target address for subsequent data transmission. If the ping fails, the voice module triggers a network anomaly alarm.
[0033] The ping command is used to obtain network connectivity data and confirm that the communication link is available; the purpose of storing virtual IPs is to avoid repeatedly querying the target address before sending data, thereby improving interaction efficiency.
[0034] It's important to note that ping is a computer network management application, typically used to confirm the reachability of a host on the Internet. Ping is a service command operating at the application layer of the TCP / IP network architecture. Its principle is to send an ICMP (Internet Control Message Protocol) Echo Request message to a specific destination host, and based on the returned ICMP Echo Reply message, test the reachability of the destination station and obtain relevant status information such as connection packet loss rate and average round-trip time. It is used to determine whether the local host can successfully exchange (send and receive) data packets with another host. Based on the returned information, it's possible to infer whether TCP / IP parameters are set correctly, whether the system is functioning properly, and whether the network is operational.
[0035] Specifically, in step S102, the server receives the HTTP POST request transmitted by the voice module, including: The voice module collects analog voice signals through its built-in microphone and converts the analog voice signals into digital audio data. The digital audio data is converted into text commands, and the voice module encapsulates the text commands into JSON data according to a preset format. Call the HTTP client library, use JSON data as the request body, and generate an HTTP POST request.
[0036] Specifically, see Figure 2 and Figure 3 The voice module collects voice signals through a built-in microphone component and converts the analog voice signals into digital audio data, with a sampling rate of 16kHz and a bit depth of 16bit.
[0037] Voice data processing: The voice module converts digital audio data into text commands (such as "mute"); then, the voice module encapsulates the text commands into JSON data according to a preset format.
[0038] Example: {"cmd":"mute","data":{"channel":"","timestamp":"20240520100000"}}); Voice data encapsulation: The voice module calls the HTTP client library, uses JSON data as the request body, and generates an HTTP POST request (the request header contains "Content-Type: application / json", and the request URL is "http: / / 192.168.88.88:8080 / rpc").
[0039] Data Output and Function: Through the conversion from "analog signal → digital audio → text command → JSON data," unstructured voice data is converted into structured data, resolving compatibility issues in cross-module data parsing; the HTTP POST request encapsulation standardizes the data transmission format, ensuring that the set-top box module server can recognize it. Figure 2 The data flow path of "the voice module sending an HTTP request to the set-top box module".
[0040] In step S102, the virtual IP network card in the voice recognition module includes: After the set-top box module completes initialization, it starts the HTTP server built into the Nginx framework and configures the server listening port. After the server starts, it loads the request processing rules of the preset virtual IP network card and filters illegal requests through the preset request rules; the request processing rules include: receiving method, request body format and fields.
[0041] Specifically, after the set-top box module completes initialization, it automatically starts the built-in HTTP server. The HTTP server runs on the Nginx framework and is configured to listen on a port, such as port 8080. After the server starts, it loads the preset request processing rules, such as: only accepting POST methods, the request body must be in JSON format, and must contain the "cmd" and "data" fields.
[0042] Data Output and Function: The core function of the above steps is to construct the processing center for "voice module data reception and parsing," filtering illegal requests through preset request rules to ensure data security. Figure 2 The component interaction relationship of "set-top box module contains internal server".
[0043] Specifically, the virtual IP network card in the voice recognition module further includes: The network transmission unit of the voice module sends HTTP POST requests to the port of the virtual IP address of the set-top box module through the local area network built by the optical modem module; The set-top box module's HTTP server listens on a port with a virtual IP address. Upon receiving a request, it first verifies the request header format. If the format is valid, extract the JSON data from the request body; if the format is invalid, directly generate an invalid format response and send it back to the voice module.
[0044] Specifically, see Figure 2 and Figure 3 The voice module's network transmission unit sends HTTP POST requests to port 8080 of the set-top box module's virtual IP (192.168.88.88) through the local area network built by the optical modem module; The set-top box module's HTTP server listens on port 8080. Upon receiving a request, it first verifies the request header format (to confirm if it is of type "application / json"). If the format is valid, it extracts the JSON data from the request body; if the format is invalid, it directly generates a "415 UnsupportedMediaType" response and sends it back to the voice module.
[0045] The "send" operation of the voice module enables the flow of data from the acquisition end to the processing end; the "request verification" step of the set-top box module server filters non-JSON format requests and reduces the overhead of invalid data processing.
[0046] Specifically, in step S102, parsing the voice data sent by the voice module via the HTTP protocol includes: The HTTP server in the set-top box module calls the JSON parsing engine to perform syntax and field validation on the JSON data extracted from the voice data; Syntax validation of the JSON data includes checking for matching brackets and closing quotes in the JSON data; Field validation of the JSON data includes: checking the required fields in the JSON data, where the required fields are a preset instruction set; After the JSON data passes syntax and field validation, the server generates a response and sends it back to the voice module via the original HTTP link. It also extracts the field values to generate the corresponding application startup command and sends it to the Android application of the set-top box module. If syntax and field validation of the JSON data fails, the server generates a failure response and sends it back to the voice module via the original HTTP link.
[0047] Specifically, the HTTP server of the set-top box module calls the JSON parsing engine to perform two-step validation on the extracted JSON data: ① Syntax validation (checking for matching brackets, closing quotation marks, etc.); ② Field validation (checking whether it contains the required fields "cmd" and "data", and whether the value of "cmd" belongs to the preset instruction set, such as "mute" and "volume_adjust").
[0048] If the verification passes (data is normal): the server generates a "200 OK" response (JSON format: {"code":0,"msg":"parse_success"}), and sends it back to the voice module via the original HTTP link; at the same time, the server extracts the value of the "cmd" field (such as "mute"), generates the corresponding application startup command, and sends it to the Android application of the set-top box module; after receiving the command, the Android application calls the audio and video control interface of the set-top box module to perform the "mute" operation; If the validation fails (i.e., the data is abnormal, such as a missing field or an invalid "cmd" value): the server generates a "400 Bad Reques" response (JSON format: {"code":1,"msg":"parse_failed","error":"missing'cmd'field"}) and sends it back to the voice module.
[0049] JSON validation ensures data validity and prevents Android applications from crashing due to abnormal data; the "Result Feedback" step provides an interactive loop for the voice module (confirming whether the data has been received correctly); and the "Command Execution" step realizes the conversion of voice commands into device operations, which is the implementation link of the core function of "voice control set-top box".
[0050] exist Figure 2 In the process, the internal server receives an HTTP request and triggers the Android application. The core components of the integrated gateway include the optical modem module, the voice module, and the set-top box module. The interaction logic and data flow among the three are as follows: 1. Optical modem module → Voice module / Set-top box module: The optical modem module assigns dynamic IP addresses through the DHCP protocol, providing local area network access services for both, and is the "network infrastructure" for cross-module communication; 2. Voice Module → Set-Top Box Module: The voice module acts as the "data initiator," transmitting the encapsulated HTTP POST request (including JSON data) to the set-top box module. It is the "main entity for voice data collection and transmission." 3. Internal interaction of the set-top box module: The set-top box module includes an "internal server" and an "Android application". The internal server acts as the "data processing hub", receiving and parsing HTTP requests and sending start commands to the Android application. The Android application acts as the "function execution terminal", responding to commands to complete audio and video control operations and serving as the "landing carrier" of data processing results.
[0051] exist Figure 3 In this process, the data interaction flow is centered on "autonomous module execution," with no user intervention required. The correspondence between flow nodes and module execution actions is as follows: 301. Starting Node (Power-on of Integrated Gateway): Triggers the synchronous startup of the optical modem module, voice module, and set-top box module; 302. Network Configuration Node (Gateway assigns IP → Generates virtual network card → Voice module accesses LAN): The optical modem module completes IP assignment, the set-top box module generates a virtual IP, and the voice module verifies network connectivity, together building a "communicable environment"; 303. Service Startup Node (Set-top Box Startup Internal Server): The set-top box module sets up the data receiving center and waits for requests from the voice module; 304. Data transfer node (voice module sends HTTP request → server receives and processes): The voice module completes data acquisition and encapsulation, and the set-top box module completes data reception and verification; 305. Result Execution Node (Normal Startup of Android Application / Abnormal Return of Result): The set-top box module executes instructions or reports errors based on the data verification results, forming a "data interaction closed loop".
[0052] Based on the same inventive concept, this disclosure also provides an electronic device 161, see [link to previous document]. Figure 4 It includes a processor 164, a communication interface 165, a memory 162, and a communication bus, wherein the processor 164, the communication interface 165, and the memory 162 communicate with each other through the communication bus; Memory 162 stores computer program 163; When the processor 164 executes the program stored in the memory 162, it implements the aforementioned method for data interaction between the voice module and the set-top box.
[0053] The aforementioned communication bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc.
[0054] The communication interface 165 is used for communication between the aforementioned electronic device 161 and other devices.
[0055] The memory 162 may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory 162 may also be at least one storage device located remotely from the aforementioned processor 164.
[0056] The processor 164 mentioned above can be a general-purpose processor 164, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0057] Based on the same inventive concept, another aspect of the present disclosure provides a computer-readable storage medium storing a computer program 163, which, when executed by a processor 164, implements a method for data interaction between a voice module and a set-top box.
[0058] The computer-readable storage medium may be included in the device / apparatus described in the above embodiments; or it may exist independently and not assembled into the device / apparatus. The computer-readable storage medium carries one or more programs, which, when executed, implement a method for data interaction between a voice module and a set-top box according to an embodiment of this disclosure.
[0059] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for voice module and set-top box data interaction, characterized in that, The application relates to a method for realizing voice control of a set-top box module, and the method comprises the following steps: A server in a set-top box module receives an IP address sent by an optical modem module after the optical modem module constructs a local area network; A fixed virtual IP card is generated according to a startup script based on the IP address; The server receives an HTTP POST request transmitted by a voice module, and after identifying a virtual IP card in the voice module, the server analyzes voice data sent by the voice module through the HTTP protocol; When the server successfully analyzes the voice data, the server triggers an Android application to execute a specified operation in the Android application; when error information in the voice data is analyzed, the server feeds back the error information to the voice module.
2. The method of claim 1, wherein, The server receives the IP address sent by the optical modem module after the optical modem module constructs the local area network, and the method comprises the following steps: The optical modem module reads a built-in routing configuration, and according to the routing configuration, a network segment where a virtual card is located and a network segment where a physical IP is located are configured as intercommunication routing; Dynamic IP addresses of the physical card in the set-top box module and the voice module are allocated through a DHCP service and are sent to the server in the set-top box module.
3. The method of claim 2, wherein, The fixed virtual IP card is generated according to the IP address through the startup script, and the method comprises the following steps: An IP command is called to obtain the IP address, a virtual IP card is generated through the startup script, and a fixed IP address of the virtual IP card is configured through an ifconfig command to generate the fixed virtual IP card.
4. The method of claim 1, wherein, Before the server receives the HTTP POST request transmitted by the voice module, the method comprises the following steps: The server receives an echo request message of a network message control protocol sent by the voice module to the server through a built-in network detection unit under the condition of power-on; If the ping is passed, the voice module writes the virtual IP of the server into a local communication configuration table as a target address for subsequent data transmission; If the ping is not passed, the voice module triggers a network exception alarm.
5. The method of claim 1, wherein, The server receives the HTTP POST request transmitted by the voice module, and the method comprises the following steps: An analog voice signal collected by a built-in microphone component of the voice module is converted into digital audio data; The digital audio data is converted into text instructions, and the voice module encapsulates the text instructions into JSON data according to a preset format; An HTTP client library is called to generate the HTTP POST request by taking the JSON data as a request body.
6. The method of claim 5, wherein, After the set-top box module is initialized, an HTTP server based on an Nginx framework is started, and a server listening port is configured; After the server is started, a request processing rule of a preset virtual IP card is loaded, and illegal requests are filtered through the preset request processing rule; the request processing rule comprises a receiving method, a request body format and a field. The virtual IP card in the voice module further comprises the following steps:
7. The method of claim 6, wherein, The network transmission unit of the voice module sends the HTTP POST request to a port of the virtual IP address of the set-top box module through the local area network constructed by the optical modem module; The HTTP server of the set-top box module listens to the port of the virtual IP address, and after receiving the request, the HTTP server first verifies a request header format; If the format is legal, extract the JSON data in the request body; if the format is illegal, directly generate a format type illegal response and return it to the voice module.
8. The method of claim 7, wherein, The voice module sends voice data through the HTTP protocol, and the voice module includes: The HTTP server in the set-top box module calls a JSON parsing engine to perform syntax checking and field checking on the JSON data extracted from the voice data. The syntax checking on the JSON data includes checking the matching of parentheses and the closing of quotation marks in the JSON data. The field checking on the JSON data includes checking the mandatory fields in the JSON data, and the mandatory fields are a preset instruction set. After the syntax checking and the field checking on the JSON data pass, the server generates a completion response and returns it to the voice module through the original HTTP link, and extracts field values to generate corresponding application startup instructions and sends them to an Android application of the set-top box module. After the syntax checking and the field checking on the JSON data fail, the server generates a failure response and returns it to the voice module through the original HTTP link.
9. An electronic device, comprising: The voice module includes: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; the memory stores a computer program; the processor, when executing the program stored in the memory, implements the voice module and the set-top box data interaction method in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, The memory stores a computer program, and the computer program, when executed by the processor, implements the voice module and the set-top box data interaction method in any one of claims 1 to 8.
Citation Information
Patent Citations
Method for controlling IPTV set-top box through mobile terminal
CN105812863A
Interaction method and system for set-top box and intelligent terminal
CN109561331A
An operation control method and a set top box
CN109819297A
Method for simultaneously accessing public network and private network by set-top box
CN110365814A
Method for realizing control of optical modem by set top box on converged gateway
CN115733829A