Networking method and system based on vehicle-mounted terminal, electronic equipment and computer readable medium
By establishing a direct WiFi connection channel and virtual network card between the vehicle terminal and the smartphone, and utilizing SOCKS5 and ICMP proxy protocols, the problem of customized interconnection and transmission between the smartphone and the vehicle terminal is solved, achieving seamless and unobtrusive Internet access for the vehicle terminal. It supports diverse network protocols, meets the needs of vehicle networking, and provides high-speed, stable, and low-latency network connectivity.
Patent Information
- Application Number
- CN202511780152.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-02-24
AI Technical Summary
In existing technologies, the content transmitted between smartphones and in-vehicle terminals is customized, which cannot meet the networking needs of third-party applications in the vehicle terminal system.
By establishing a direct WiFi connection between the vehicle terminal and the smartphone, a virtual network card is created, and SOCKS5 and ICMP proxy protocols are used to encapsulate and forward network data packets, achieving compatibility with TCP, UDP, and ICMP protocols. The vehicle terminal's application can access the Internet without modification.
It achieves seamless and unobtrusive internet access for in-vehicle terminals, supports diverse network protocols, meets the needs of vehicle networking, provides high-speed, stable, and low-latency network connectivity, and reduces user operation complexity and power consumption.
Smart Images

Figure CN121568073A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the automotive field, and in particular to a networking method, system, electronic device, and computer-readable medium based on an in-vehicle terminal. Background Technology
[0002] Currently, smartphones connect to in-vehicle terminals via WiFi and 4G communication modules. Images from the in-vehicle terminal's reversing camera, turn-around camera, body camera, and under-vehicle camera are processed and converted by the MCU module and the N141 UCOSII audio / video module before being transmitted to the smartphone via WiFi and 4G, thus achieving interconnection between the smartphone and the in-vehicle terminal. Furthermore, in-vehicle cameras and smoke sensors are also installed, allowing for data transmission to the phone when no one is in the vehicle. The power module is connected to a solar panel for energy saving, effectively enabling interconnection between smartphones and in-vehicle terminals, and allowing for the projection of reversing images and multi-view images. However, current technology only interconnects the smartphone and the in-vehicle terminal, and the transmitted content is customized, failing to meet the networking needs of third-party applications within the in-vehicle terminal system. Summary of the Invention
[0003] The present invention aims to solve at least one of the technical problems existing in the prior art, and proposes a networking method and approach based on an in-vehicle terminal.
[0004] In a first aspect, embodiments of the present invention provide a networking method based on a vehicle-mounted terminal, which includes the following steps:
[0005] The vehicle terminal establishes a direct WiFi connection with the smartphone, and the vehicle terminal creates a virtual network card;
[0006] The application of the vehicle terminal initiates a network request and directs the network request to the virtual network card, and listens to the device data of the virtual network card to extract network packets;
[0007] The vehicle-mounted terminal sends the network packet to the smartphone via the WiFi direct connection channel;
[0008] The vehicle terminal receives response data packets from the network packets returned by the smartphone, and the virtual network card distributes the response data packets to the network ports bound to each application.
[0009] In some embodiments, the in-vehicle terminal establishes a WiFi direct connection with the smartphone, including:
[0010] After establishing a Bluetooth RFCOMM connection between the vehicle terminal and the smartphone, they exchange the proxy service IP and port number in a specified format.
[0011] A direct WiFi connection is established between the vehicle terminal and the smartphone based on the interactive proxy service IP and port number.
[0012] In some embodiments, the application of the vehicle terminal initiates a network request and directs the network request to the virtual network interface card (NIC), and listens to the device data of the virtual NIC to extract network packets, including:
[0013] The application in the vehicle terminal initiates a network request, and the routing rules in the vehicle terminal direct the network request to the virtual network card.
[0014] The proxy client of the vehicle terminal listens to the device data of the virtual network card and captures network packets; the network requests include requests of TCP protocol, UDP protocol or ICMP protocol, and the proxy client includes a client of SOCKS5 protocol or ICMP protocol.
[0015] In some embodiments, the network requests sent by the application are read through the virtual network card, and the source IP address, source port number, destination IP address, destination port number of UDP and TCP packets, as well as the source IP address and destination IP address of ICMP packets, are extracted using the lwip open-source protocol library.
[0016] In some embodiments, the TCP or UDP protocol request: The SOCKS5 protocol proxy client encapsulates the data packet in SOCKS5 protocol format and sends it to the smartphone's SOCKS5 proxy server via the WiFi Direct channel;
[0017] The ICMP protocol request: The ICMP proxy client encapsulates the ICMP message into a custom proxy protocol and sends it to the ICMP proxy server on the smartphone via WiFi direct connection.
[0018] In some embodiments, an application in the vehicle terminal initiates a network request, and routing rules in the vehicle terminal direct the network request to a virtual network interface card, including:
[0019] The application uses a socket to send network request packets to the kernel network protocol stack, which then forwards the network request packets to the virtual network interface device according to the configured routing rules of the virtual network interface.
[0020] In some embodiments, the vehicle terminal receives response data packets from the network packets returned by the smartphone, and the virtual network card distributes the response data packets to the network ports bound to various applications, including:
[0021] The vehicle terminal encapsulates the received response data packet and writes the encapsulated response data packet into a virtual network interface card (NIC). The virtual NIC then distributes the encapsulated response data packet to the network port of the application that initiated the request.
[0022] Secondly, the present invention also provides a network system based on an in-vehicle terminal, including...
[0023] The vehicle-mounted terminal is used to initiate network requests in applications and direct the network requests to a virtual network interface card (NIC), and to listen to the device data of the virtual NIC to extract network packets; the network packets are sent to the smartphone through the WiFi Direct channel; the terminal receives response data packets of the network packets returned by the smartphone, and the virtual NIC distributes the response data packets to the network ports bound to each application;
[0024] The smartphone receives and parses network packets from the vehicle terminal, and initiates a real network request to the target server based on the parsed data; it also receives response data from the target server and sends the response data back to the vehicle terminal.
[0025] The vehicle-mounted terminal establishes a direct WiFi connection with the smartphone.
[0026] Thirdly, the present invention also provides an electronic device, comprising:
[0027] One or more processors;
[0028] Memory, used to store one or more programs;
[0029] When the one or more programs are executed by the one or more processors, the one or more processors implement any of the methods.
[0030] Thirdly, the present invention also provides a computer-readable medium on which a computer program is stored, wherein the computer program, when executed by a processor, implements the steps in any of the methods described.
[0031] The in-vehicle terminal-based networking method provided by this invention seamlessly, imperceptibly, and without loss of data access to the Internet via a smartphone. Existing applications on the in-vehicle system (such as navigation, online music, voice assistant, and app store) can connect to the Internet in this way without any modification. Ultimately, in terms of user experience, it achieves seamless networking that can be used immediately upon entering the vehicle, without requiring users to manually turn on WiFi hotspots or other shared network methods in the smartphone settings menu. Functionally, it achieves compatibility with all network protocols, and commercially, it provides the possibility of high-end networking functions for low-cost in-vehicle systems. Attached Figure Description
[0032] Figure 1This is a logical schematic diagram of an embodiment of the networking method based on an in-vehicle terminal of the present invention;
[0033] Figure 2 This is a schematic diagram of the architecture of one embodiment of the WiFi Direct Connection Channel of the present invention;
[0034] Figure 3 This is a schematic diagram of an embodiment of the virtual network card Tun0 of the present invention;
[0035] Figure 4 This is a logical schematic diagram of an embodiment of the SOCKS5 communication process of the present invention;
[0036] Figure 5 This is a proxy flowchart of an embodiment of the ICMP of the present invention;
[0037] Figure 6 This is a logical diagram of the upper-layer application network data flow of the vehicle terminal of the present invention;
[0038] Figure 7 This is a schematic diagram of the structure of an embodiment of the electronic device of the present invention. Detailed Implementation
[0039] To enable those skilled in the art to better understand the technical solutions of the present invention, exemplary embodiments of the present invention are described below in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to aid understanding. These should be considered merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0040] Where there is no conflict, the various embodiments of the present invention and the features thereof may be combined with each other.
[0041] As used herein, the term “and / or” includes any and all combinations of one or more related enumerated entries.
[0042] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used herein, the singular forms “a” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that when the terms “comprising” and / or “made of” are used in this specification, the presence of the stated feature, integral, step, operation, element, and / or component is specified, but the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof is not excluded. Terms such as “connected” or “linked” are not limited to physical or mechanical connections but can include electrical connections, whether direct or indirect.
[0043] Unless otherwise specified, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having the meaning consistent with their meaning in the context of the relevant art and the invention, and will not be interpreted as having an idealized or overly formal meaning unless expressly so defined herein.
[0044] In the technical solution of this invention, the collection, storage, use, processing, transmission, provision, and disclosure of user personal information all comply with relevant laws and regulations and do not violate public order and good morals. The use of user data in this technical solution follows relevant national laws and regulations (e.g., the "Information Security Technology - Personal Information Security Specification"). For example: appropriate measures are taken for personal information access control; restrictions are imposed on the display of personal information; the purpose of using personal information does not exceed the scope of direct or reasonable association; and explicit identity targeting is eliminated when using personal information to avoid precisely locating a specific individual.
[0045] In related technologies, existing technologies only connect smartphones and vehicle terminals, and the content transmitted is customized, which cannot meet the networking needs of third-party applications in the vehicle terminal system.
[0046] To address at least one of the technical problems existing in the aforementioned related technologies, the present invention provides a networking method based on an in-vehicle terminal. Figure 1 This is a logical schematic diagram of a networking method based on a vehicle terminal provided in an embodiment of the present invention.
[0047] The vehicle-mounted terminal-based networking method includes the following steps:
[0048] Step S10: The vehicle terminal establishes a WiFi direct connection channel with the smartphone, and the vehicle terminal creates a virtual network card.
[0049] In this embodiment, the step of establishing a WiFi direct connection channel between the smartphone and the vehicle terminal includes: the smartphone and the vehicle terminal automatically discover and pair via Bluetooth RECOMM; once pairing is successful, both parties automatically activate the WiFi direct connection module to establish a P2P WiFi direct connection channel.
[0050] Please see Figure 2The WiFi Direct Connection Channel provided in this embodiment is implemented as follows: The architecture defines three components: one device and two roles. These three components are: P2P Device (the entity representing a role in the P2P architecture, any hardware device supporting the Wi-Fi P2P protocol, such as smartphones, in-vehicle infotainment screens, smart TVs, etc. Before establishing a connection, all devices are in an equal "P2P Device" state); P2P Group Owner (GO, a role in the protocol, equivalent to an Access Point (AP), with only one GO in a group); and P2P Group Client (GC, another role, with multiple GCs in a group). Before forming a P2P Group (i.e., a P2P network), smart terminals are individual P2P Devices. After these P2P Devices complete P2P negotiation, one and only one Device will play the role of GO, while the others will play the role of GC.
[0051] like Figure 2 This illustrates the structure of a typical P2P Group, where: a P2P Group can have only one GO (Goal Provider), and a GO can support one or more (i.e., 1:n) GC (Controller Provider) connections. Since the GO functions similarly to an Access Point (AP), nearby Wi-Fi STAs that do not support P2P can also discover and associate with the GO. These Wi-Fi STAs are called Legacy Clients.
[0052] Furthermore, the device discovery process utilizes the Probe Request and Probe Response frames from the IEEE 802.11 standard to search for nearby P2P devices, and requires that the data in the Probe Request frame must contain P2P IE information; otherwise, no response will be given. Through the WiFi Direct protocol, smartphones and in-vehicle systems can scan and discover each other and initiate connections.
[0053] As you can understand, WiFi Direct establishes a wireless connection between a smartphone and the vehicle system, assigns corresponding IP addresses to the connected devices to form an internal local area network (LAN), through which the two devices can communicate with each other, but cannot access external networks.
[0054] Create a virtual network card on the vehicle terminal and set up network routing and configuration rules.
[0055] Specifically, the application in the vehicle terminal initiates network requests and guides these network requests to the tun0 virtual network card based on routing rules. The proxy client of the vehicle terminal listens to the device data of the tun0 virtual network card and captures network packets. The network requests include requests using the TCP protocol, UDP protocol, or ICMP protocol. The proxy client includes clients using the SOCKS5 protocol or ICMP protocol.
[0056] Please see Figure 3 The vehicle terminal creates a virtual network interface card (NIC) tun0 and sets up network routing and configuration rules. The application uses a socket to send network request (remote network) packets to the kernel network protocol stack. The network protocol stack forwards the remote network request packets to the virtual NIC device according to the configured routing rules. The proxy program opens the virtual network device and reads the data on the device, obtaining all IP packets forwarded to the virtual network device. The proxy client program uses the lwip open-source TCP / IP protocol stack to extract the source IP address, source port number, destination IP address, destination port number of UDP and TCP packets, as well as the source IP address and destination IP address of ICMP packets, for the corresponding proxy protocol to forward.
[0057] It's important to note that SOCKS5 is a proxy protocol that acts as an intermediary between front-end machines and server machines communicating using TCP / IP. This allows front-end machines on an intranet to access servers on the Internet or enhances communication security. The SOCKS5 proxy server simulates the behavior of a front-end by forwarding requests from the front-end to the actual target server. Here, communication between the front-end and SOCKS5 also uses TCP / IP. The front-end sends requests originally intended for the real server to the SOCKS5 server, which then forwards them. This invention uses the SOCKS5 proxy protocol for proxying and forwarding UDP and TCP network packets.
[0058] Please see Figure 4 The SOCKS5 communication flow logic diagram includes:
[0059] 1) The client establishes a TCP connection with the SOCKS proxy server. (Regardless of whether the client wants to establish a TCP or UDP connection with the target server, the client needs to establish a TCP connection with the SOCKS proxy server first.)
[0060] 2) After establishing a connection with the SOCKS proxy server, authentication begins, for example, using either no authentication or username / password.
[0061] 3) After successful authentication, the client begins to request the corresponding proxy commands from the SOCKS server. The SOCKS5 protocol specifies three proxy commands (connect, bind, udp).
[0062] 4) The SOCKS proxy server executes the corresponding proxy mode according to the command requested by the client and establishes a connection with the target server.
[0063] 5) Next, the client begins network communication as if it were a normal network packet sending and receiving operation.
[0064] It's important to note that ICMP (Internet Control Message Protocol) is a sub-protocol of the TCP / IP protocol suite used to transmit control messages between IP hosts and routers. Control messages refer to network-related information such as network connectivity, host reachability, and route availability. While these control messages do not transmit user data, they play a crucial role in the transmission of user data.
[0065] Please see Figure 5 This is a flowchart of the ICMP proxy process. The main functions of the ICMP protocol are divided into two categories:
[0066] 1. Confirm whether the IP packet can successfully reach the target address. When two devices are interconnected, if an IP packet sent by one device to the other device does not arrive, an ICMP packet will be generated and sent to the device.
[0067] 2. For network diagnostics, two commonly used terminal programs for ICMP packets are ping and traceroute. The traceroute program displays possible paths between two internet devices and measures packet latency on the IP network. The ping program is a simplified version of traceroute. We often use the ping command to test whether the network between two devices is normal. ping can also display the latency between two devices and accurately report the time it takes for a packet to reach its destination and return.
[0068] The use of ICMP protocol proxy in this invention is mainly due to the fact that some video applications use ICMP protocol to determine whether the target server address is reachable.
[0069] As can be understood, the routing configuration rules of the virtual network interface card (NIC) provided in this embodiment can be used to obtain network request IP packets sent by upper-layer applications and to distribute remote service response packets; UDP, TCP, and ICMP network packets are extracted and encapsulated. The virtual NIC device is opened, and the network request IP packets sent by upper-layer applications are read through the NIC device. The lwip open-source protocol library is used to extract the source IP address, source port number, and destination IP address and destination port number of UDP and TCP network packets, as well as the source IP and destination IP addresses of ICMP packets. The response packets returned by the remote server are encapsulated into IP network packets using the lwip open-source protocol, and then written to the virtual NIC device, which distributes them to various upper-layer applications. UDP, TCP, and ICMP network packet proxy forwarding is performed using the Sockets5 proxy protocol for UDP and TCP network packet proxy forwarding, and a custom ICMP proxy protocol for ICMP network packet forwarding.
[0070] Step S20: The application of the vehicle terminal initiates a network request and directs the network request to the virtual network card, and listens to the device data of the virtual network card to extract network packets.
[0071] Specifically, the application in the vehicle terminal initiates network requests, the routing rules in the vehicle terminal direct these requests to the tun0 virtual network interface card, the proxy client of the vehicle terminal listens to the device data of the tun0 virtual network interface card and captures network packets, the network requests include requests of TCP protocol, UDP protocol or ICMP protocol, and the proxy client includes a client of SOCKS5 protocol or ICMP protocol.
[0072] Step S30: The vehicle terminal sends the network packet to the smartphone through the WiFi Direct channel.
[0073] In this embodiment, for TCP / UDP requests: the SOCKS5 proxy client encapsulates the data packet into the SOCKS5 protocol format and sends it to the SOCKS5 proxy server on the smartphone via the WiFi Direct channel.
[0074] In this embodiment, for ICMP requests (such as ping): the ICMP proxy client encapsulates the ICMP message into a custom proxy protocol (or encapsulates it through a U-tunnel) and sends it to the ICMP proxy server on the smartphone via WiFi direct connection.
[0075] It's understandable that a proxy client program runs on the vehicle's infotainment system. This program opens the ` / dev / net / tun` character device and continuously reads raw IP packets received from the `tun0` virtual network interface. The proxy client doesn't directly forward the raw IP packets; instead, it processes them according to the protocol type.
[0076] For TCP / UDP traffic: SOCKS5 protocol is used for encapsulation. The SOCKS5 client packages the target address, port, and other information into SOCKS5 protocol format, and then sends it to the SOCKS5 server on the mobile device through a reliable TCP connection.
[0077] For ICMP traffic (such as the Ping command): Use a custom ICMP proxy protocol. Because the SOCKS5 standard does not support ICMP, an ICMP proxy client needs to be implemented at the application layer to encapsulate the payload and metadata (type, code, ID, etc.) of the ICMP message in a custom protocol format (usually based on UDP or TCP transmission) before sending it to the smartphone.
[0078] The processed proxy protocol data is sent to the smartphone via the previously established WiFi Direct physical channel. The Bluetooth channel at this stage is typically only used to maintain a heartbeat, ensuring the connection remains open.
[0079] Step S40: The vehicle terminal receives the response data packet of the network packet returned by the smartphone, and the virtual network card distributes the response data packet to the network port bound to each application.
[0080] Specifically, the smartphone receives and parses network packets from the vehicle terminal, and initiates a real network request to the target server based on the parsed data, including the following steps:
[0081] The smartphone runs a corresponding SOCKS5 server and an ICMP proxy server. The SOCKS5 server parses the received request and extracts the real address and port of the target server. The ICMP proxy server parses the custom protocol packet and restores the original ICMP request.
[0082] It's understandable that the smartphone runs a corresponding SOCKS5 server and an ICMP proxy server. The SOCKS5 server parses the received request and extracts the target server's real address and port. The ICMP proxy server parses the custom protocol packets and reconstructs the original ICMP request. The smartphone, using its own network environment (4G / 5G / WiFi), acts as a proxy to initiate a real network request to the target server. For SOCKS5 TCP requests from the vehicle's infotainment system, the phone establishes a TCP connection to the target server; for ICMP requests, the phone initiates a real Ping request.
[0083] It is understandable that the response data packet returned by the remote target server is processed by the proxy program and written to the virtual network interface card (NIC). This NIC then distributes the response data packet to the network ports bound to each application, thus completing the distribution of the remote cloud server's response data. This networking solution uses a virtual NIC to acquire and forward network incoming and outgoing IP data packets from applications.
[0084] Specifically, the smartphone receives response data from the target server and sends the response data back to the vehicle terminal via a WiFi direct connection channel. The vehicle terminal encapsulates the response data and writes the encapsulated response data packet into the virtual network card to complete network communication.
[0085] Furthermore, the IP response data includes TCP data, UDP data, or ICMP replies.
[0086] Please see Figure 6 The data flow of third-party applications accessing the network cloud server in the vehicle terminal can be roughly divided into the following eight processes:
[0087] 1. When the vehicle system application initiates a network request, the network data packet is routed to the virtual network card device tun0 according to the configured routing rules.
[0088] 2. The vehicle system agent client program reads IP network data packets from the tun0 virtual network card device and extracts UDP, TCP and ICMP protocol network data packets.
[0089] 3. The extracted UDP and TCP network packets are forwarded via the Socks5 protocol, and the ICMP packets are encapsulated using a custom protocol before being forwarded via a proxy.
[0090] 4. Network data packets on the vehicle system side are sent to the smartphone through the established WiFi direct connection local area network channel.
[0091] 5. The smartphone-side proxy server program sends the received network packets to the destination cloud server.
[0092] 6. After processing the network request, the cloud server responds with the corresponding network data packets to the smartphone.
[0093] 7. The smartphone forwards the data packets from the cloud server to the vehicle system.
[0094] 8. The vehicle system encapsulates the network packets and writes them into the tun0 network interface for distribution to the corresponding applications.
[0095] The in-vehicle terminal-based networking method provided by this invention is completely transparent to in-vehicle applications, boasts excellent compatibility, and allows existing applications on the in-vehicle system (such as navigation, online music, voice assistants, and app stores) to connect to the network without any modification. Users do not need to manually enable hotspots or set passwords on their phones, nor do they need to manually select Wi-Fi or enter passwords on the in-vehicle system. It's ready to use upon entering the vehicle and automatically disconnects upon exiting, providing a smooth experience. It supports comprehensive network protocols to meet diverse in-vehicle networking needs, supporting not only common web browsing (TCP) and video streaming (UDP), but also the ICMP protocol commonly used in network diagnostic tools. It fully utilizes mobile network resources, offering superior performance compared to traditional Bluetooth sharing, providing a high-speed, stable, and low-latency network connection sufficient to support high-bandwidth applications such as real-time updates of high-definition maps and online audio and video playback. It provides an economical and efficient networking solution for in-vehicle systems without a networking module, and for "basic" in-vehicle systems without a built-in 4G / 5G cellular network module, this solution is a low-cost "functionality upgrade" method. While ensuring a good user experience, it minimizes the consumption of mobile phone power, thus avoiding the high energy consumption issues caused by continuous Wi-Fi scanning and connection.
[0096] In summary, this networking method seamlessly, imperceptibly, and without loss connects the vehicle's terminal to the internet via a smartphone. Existing applications on the vehicle system (such as navigation, online music, voice assistants, and app stores) can connect to the internet in this way without any modification. Ultimately, in terms of user experience, it achieves seamless networking that is usable as soon as you get in the car, without requiring users to manually turn on a WiFi hotspot or other shared network methods in their smartphone settings menu. Functionally, it achieves compatibility with all network protocols. Commercially, it provides the possibility of high-end networking functions for low-cost vehicle systems.
[0097] Based on the same inventive concept, the present invention also provides a vehicle-mounted terminal-based networking system, which is applied to the vehicle-mounted terminal-based networking method provided in the above embodiments, specifically including:
[0098] The vehicle-mounted terminal is used to initiate network requests in applications and direct the network requests to a virtual network interface card (NIC), and to listen to the device data of the virtual NIC to extract network packets; the network packets are sent to the smartphone through the WiFi Direct channel; the terminal receives response data packets of the network packets returned by the smartphone, and the virtual NIC distributes the response data packets to the network ports bound to each application;
[0099] The smartphone receives and parses network packets from the vehicle terminal, and initiates a real network request to the target server based on the parsed data; it also receives response data from the target server and sends the response data back to the vehicle terminal.
[0100] The vehicle-mounted terminal establishes a direct WiFi connection with the smartphone. Specifically, this includes the following solutions:
[0101] Smartphones and in-vehicle terminals establish a direct WiFi connection.
[0102] In this embodiment, the step of establishing a WiFi direct connection channel between the smartphone and the vehicle terminal includes: the smartphone and the vehicle terminal automatically discover and pair via Bluetooth RECOMM; once pairing is successful, both parties automatically activate the WiFi direct connection module to establish a P2P WiFi direct connection channel.
[0103] The smartphone assigns an internal network IP address to the vehicle terminal, the vehicle terminal creates a virtual network card, sets its IP address to the assigned internal network IP address, and directs all non-local traffic to the virtual network card.
[0104] Specifically, the application in the vehicle terminal initiates network requests, the routing rules in the vehicle terminal direct these requests to the tun0 virtual network interface card, the proxy client of the vehicle terminal listens to the device data of the tun0 virtual network interface card and captures network packets, the network requests include requests of TCP protocol, UDP protocol or ICMP protocol, and the proxy client includes a client of SOCKS5 protocol or ICMP protocol.
[0105] The vehicle terminal initiates a network request and directs the network request to the virtual network card, and listens to the device data of the virtual network card to capture network packets.
[0106] Specifically, the application in the vehicle terminal initiates network requests, the routing rules in the vehicle terminal direct these requests to the tun0 virtual network interface card, the proxy client of the vehicle terminal listens to the device data of the tun0 virtual network interface card and captures network packets, the network requests include requests of TCP protocol, UDP protocol or ICMP protocol, and the proxy client includes a client of SOCKS5 protocol or ICMP protocol.
[0107] The vehicle-mounted terminal sends the network packet to the smartphone via the WiFi Direct channel.
[0108] In this embodiment, for TCP / UDP requests: the SOCKS5 proxy client encapsulates the data packet into the SOCKS5 protocol format and sends it to the SOCKS5 proxy server on the smartphone via the WiFi Direct channel.
[0109] In this embodiment, for ICMP requests (such as ping): the ICMP proxy client encapsulates the ICMP message into a custom proxy protocol (or encapsulates it through a U-tunnel), and sends it to the ICMP proxy server on the smartphone via WiFi direct connection. The ICMP proxy server on the smartphone then forwards the message to the server.
[0110] The smartphone receives the response data from the target server and sends the response data back to the vehicle terminal via a WiFi direct connection channel. The vehicle terminal encapsulates the response data packet and writes the encapsulated response data packet into the virtual network card. The virtual network card then distributes the encapsulated data packet to the network port bound to the application that initiated the network request.
[0111] The in-vehicle terminal-based networking method provided by this invention seamlessly, imperceptibly, and without loss of data access to the Internet via a smartphone. Existing applications on the in-vehicle system (such as navigation, online music, voice assistant, and app store) can connect to the Internet in this way without any modification. Ultimately, in terms of user experience, it achieves seamless networking that can be used immediately upon entering the vehicle, without requiring users to manually turn on WiFi hotspots or other shared network methods in the smartphone settings menu. Functionally, it achieves compatibility with all network protocols, and commercially, it provides the possibility of high-end networking functions for low-cost in-vehicle systems.
[0112] Based on the same inventive concept, embodiments of the present invention also provide an electronic device. Figure 3 This is a structural block diagram of an electronic device provided in an embodiment of the present invention. Figure 3 As shown, an embodiment of the present invention provides an electronic device including: one or more processors 101, a memory 102, and one or more I / O interfaces 103. The memory 102 stores one or more programs, which, when executed by the one or more processors, enable the one or more processors to implement any of the vehicle-mounted terminal-based networking methods described in the above embodiments; the one or more I / O interfaces 103 are connected between the processor and the memory, configured to enable information interaction between the processor and the memory.
[0113] The processor 101 is a device with data processing capabilities, including but not limited to a central processing unit (CPU); the memory 102 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); the I / O interface (read / write interface) 103 is connected between the processor 101 and the memory 102, and can realize information interaction between the processor 101 and the memory 102, including but not limited to a data bus (Bus).
[0114] In some embodiments, the processor 101, memory 102, and I / O interface 103 are interconnected via bus 104, and thus connected to other components of the computing device.
[0115] In some embodiments, the one or more processors 101 include a field-programmable gate array.
[0116] This invention also provides a computer-readable medium. The computer-readable medium stores a computer program, which, when executed by a processor, implements the steps of any of the vehicle-mounted terminal-based networking methods described in the above embodiments. The computer-readable storage medium can be volatile or non-volatile.
[0117] This invention also provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code. When the computer-readable code is run in the processor of an electronic device, the processor in the electronic device executes the above-described networking method based on a vehicle terminal.
[0118] Those skilled in the art will understand that all or some of the steps, systems, and apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software can be distributed on a computer-readable storage medium, which may include computer storage media (or non-transitory media) and communication media (or transient media).
[0119] As is known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable program instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), flash memory or other memory technologies, portable compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, it is known to those skilled in the art that communication media typically contain computer-readable program instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0120] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0121] The computer program instructions used to perform the operations of this invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing state information from the computer-readable program instructions. This electronic circuitry can execute the computer-readable program instructions to implement various aspects of the invention.
[0122] The computer program product described herein can be implemented specifically through hardware, software, or a combination thereof. In one alternative embodiment, the computer program product is specifically embodied in a computer storage medium; in another alternative embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.
[0123] Various aspects of the present invention are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0124] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0125] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0126] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction, which contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0127] Example embodiments have been disclosed herein, and while specific terminology has been used, it is for illustrative purposes only and should be construed as such, and is not intended to be limiting. In some instances, it will be apparent to those skilled in the art that features, characteristics, and / or elements described in conjunction with particular embodiments may be used alone, or in combination with features, characteristics, and / or elements described in conjunction with other embodiments, unless otherwise expressly indicated. Therefore, those skilled in the art will understand that various changes in form and detail may be made without departing from the scope of the invention as set forth in the appended claims.
Claims
1. A networking method based on a vehicle-mounted terminal, characterized in that, It includes the following steps: The vehicle terminal establishes a direct WiFi connection with the smartphone, and the vehicle terminal creates a virtual network card; The application of the vehicle terminal initiates a network request and directs the network request to the virtual network card, and listens to the device data of the virtual network card to extract network packets; The vehicle-mounted terminal sends the network packet to the smartphone via the WiFi direct connection channel; The vehicle terminal receives response data packets from the network packets returned by the smartphone, and the virtual network card distributes the response data packets to the network ports bound to each application.
2. The networking method based on a vehicle-mounted terminal according to claim 1, characterized in that, The in-vehicle terminal establishes a direct WiFi connection with the smartphone, including: After establishing a Bluetooth RFCOMM connection between the vehicle terminal and the smartphone, they exchange the proxy service IP address and port number of each other in a specified format. A WiFi direct connection channel is established between the vehicle terminal and the smartphone based on the IP address and port number of the interactive proxy service.
3. The networking method based on a vehicle-mounted terminal according to claim 1, characterized in that, The application of the vehicle terminal initiates a network request and directs the network request to the virtual network interface card (NIC), and listens to the device data of the virtual NIC to extract network packets, including: The application in the vehicle terminal initiates a network request, and the routing rules in the vehicle terminal direct the network request to the virtual network card. The proxy client of the vehicle terminal listens to the device data of the virtual network card and captures network packets; the network requests include requests of TCP protocol, UDP protocol or ICMP protocol, and the proxy client includes a client of SOCKS5 protocol or ICMP protocol.
4. The networking method based on a vehicle-mounted terminal according to claim 3, characterized in that, The virtual network card reads network requests sent by the application, and the lwip open-source protocol library is used to extract the source IP address, source port number, destination IP address, destination port number of UDP and TCP packets, as well as the source IP address and destination IP address of ICMP packets.
5. The networking method based on a vehicle-mounted terminal according to claim 3, characterized in that, The request for the TCP or UDP protocol: The SOCKS5 protocol proxy client encapsulates the data packet into SOCKS5 protocol format and sends it to the SOCKS5 proxy server of the smartphone through the WiFi Direct channel; The ICMP protocol request: The ICMP proxy client encapsulates the ICMP message into a custom proxy protocol and sends it to the ICMP proxy server on the smartphone via WiFi direct connection.
6. The networking method based on a vehicle-mounted terminal according to claim 3, characterized in that, The application in the vehicle terminal initiates a network request, and the routing rules in the vehicle terminal direct the network request to the virtual network card, including: The application uses a socket to send network request packets to the kernel network protocol stack, which then forwards the network request packets to the virtual network interface device according to the configured routing rules of the virtual network interface.
7. The networking method based on a vehicle-mounted terminal according to claim 1, characterized in that, The vehicle-mounted terminal receives response data packets from the network packets returned by the smartphone, and the virtual network card distributes the response data packets to the network ports bound to various applications, including: The vehicle terminal encapsulates the received response data packet and writes the encapsulated response data packet into a virtual network interface card (NIC). The virtual NIC then distributes the encapsulated response data packet to the network port of the application that initiated the request.
8. A network system based on a vehicle-mounted terminal, characterized in that, include: The vehicle-mounted terminal is used to initiate network requests in the application and direct the network requests to the virtual network card, and to listen to the device data of the virtual network card to extract network packets; The network packet is sent to the smartphone via the WiFi Direct channel; The virtual network card receives response data packets from the network packets returned by the smartphone and distributes these response data packets to the network ports bound to each application. The smartphone receives and parses network packets from the vehicle terminal, and initiates a real network request to the target server based on the parsed data; it also receives response data from the target server and sends the response data back to the vehicle terminal. The vehicle-mounted terminal establishes a direct WiFi connection with the smartphone.
9. An electronic device, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1 to 7.
10. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 7.