Data transmission method, device, system and medium based on USB shared network

By generating a USB network card in the vehicle's USB port and establishing a network bridge, the problem of devices without a network module being unable to access the external network is solved, realizing interconnection between devices and communication between the local area network and the external network.

CN116233277BActive Publication Date: 2025-11-18BEI DOU ZHI LIAN KE JI YOU XIAN GONG SI
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310246802.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-14
Publication Date
2025-11-18
Estimated Expiration
2043-03-14

AI Technical Summary

Technical Problem

During the development of the smart cockpit, devices without a network module cannot access the external network.

Method used

By detecting external devices through the vehicle's USB port, a USB network card is generated and a USB shared network is established. Network bridging is achieved using the preset network card, enabling external devices to access the external network.

Benefits of technology

It enables devices without a networking module to access the external network via USB sharing, supporting interconnection between devices and communication between local area networks and the external network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116233277B_ABST
    Figure CN116233277B_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a data transmission method, device, system and medium based on a USB shared network. The application relates to the technical field of data transmission, and comprises the following steps: when it is monitored that a USB port has an external device connected, the MAC address of the external device is acquired, and the MAC address is bound with the USB port to generate a USB network card; the USB network card is configured with a network, and a network bridge is established between the USB network card and a preset network card to generate a USB shared network; if a network data packet sent by the external device through the USB network card is received, the network data packet is forwarded to the preset network card based on the USB shared network, and is sent to an external network through the preset network card. According to the embodiment of the application, the device connected with the vehicle machine and not having a networking module can also access the external network based on the established USB shared network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data transmission technology, and in particular to a data transmission method, apparatus, system and medium based on a USB tethered network. Background Technology

[0002] With the development of technology, in the process of developing smart cockpits, various devices need to be interconnected (e.g., the interaction between the HU (Head Unit, terminal information display unit, also known as the vehicle system) and the DMS (Driver Monitoring System), the HU and the APA (Automatic Parking Assist), and the HU and the instrument panel) as well as between various devices and the external network (e.g., the HU, DMS, APA, etc., all need to access the external network). However, among these devices, only the HU device has a 4 / 5G network module and a WiFi network module; other devices do not have network modules, thus preventing them from accessing the external network. Summary of the Invention

[0003] This invention provides a data transmission method, apparatus, system, and medium based on a USB tethered network, aiming to solve the problem in existing technologies where devices without a network module cannot access the external network.

[0004] In a first aspect, embodiments of the present invention provide a data transmission method based on a USB shared network, applied to an in-vehicle infotainment system, comprising:

[0005] When an external device is detected connected to the USB port, the MAC address of the external device is obtained, and the MAC address is bound to the USB port to generate a USB network card;

[0006] Configure the USB network card for networking, and establish a network bridge between the USB network card and a preset network card to generate a USB shared network;

[0007] If a network data packet is received from the external device via the USB network card, the network data packet is forwarded to the preset network card based on the USB shared network, and then sent to the external network via the preset network card.

[0008] Secondly, embodiments of the present invention also provide a data transmission device based on a USB shared network, applied to an in-vehicle infotainment system, comprising:

[0009] The generation unit is used to obtain the MAC address of the external device when it is detected that an external device is connected to the USB port, and bind the MAC address with the USB port to generate a USB network card.

[0010] A configuration establishment unit is used to configure the USB network card for network and establish a network bridge between the USB network card and a preset network card to generate a USB shared network.

[0011] The receiving and sending unit is configured to, if it receives a network data packet sent by the external device via the USB network card, forward the network data packet to the preset network card based on the USB shared network, and then send it to the external network via the preset network card.

[0012] Thirdly, embodiments of the present invention also provide a data transmission system based on a USB shared network, which includes a vehicle-mounted unit and an external device. The vehicle-mounted unit includes a USB Hub module, a communication module, a memory, and a processor. The communication module includes a mobile communication module and a WiFi module. The memory stores a computer program, and the processor executes the computer program to implement the above-described method.

[0013] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.

[0014] This invention provides a data transmission method, apparatus, system, and medium based on a USB shared network. The method includes: when an external device is detected connected to a USB port, obtaining the MAC address of the external device and binding the MAC address to the USB port to generate a USB network card; configuring the USB network card for network access and establishing a network bridge between the USB network card and a preset network card to generate a USB shared network; if a network data packet is received from the external device via the USB network card, forwarding the network data packet to the preset network card based on the USB shared network, and then sending it to the external network via the preset network card. This invention's technical solution, when an external device is detected connected to a USB port, generates a USB network card by binding the MAC address of the external device to the USB port, and configures the USB network card for network access and establishes a network bridge to generate a USB shared network. Based on the USB shared network, devices connected to the vehicle's infotainment system that do not have a network module can also access the external network. Attached Figure Description

[0015] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. 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.

[0016] Figure 1This is a schematic diagram of a data transmission system based on a USB shared network provided in an embodiment of the present invention;

[0017] Figure 2 A schematic flowchart illustrating a data transmission method based on a USB shared network, provided in an embodiment of the present invention;

[0018] Figure 3 This is a schematic diagram of a sub-process of a data transmission method based on a USB shared network provided in an embodiment of the present invention;

[0019] Figure 4 A schematic block diagram of a data transmission device based on a USB tethered network provided for embodiments of the present invention; and

[0020] Figure 5 This is a schematic block diagram of a vehicle infotainment system provided in an embodiment of the present invention. Detailed Implementation

[0021] 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, not all, of the embodiments of the present invention. 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.

[0022] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described feature, integral, step, operation, element and / or component, but do not exclude the presence or addition of one or more other feature, integral, step, operation, element, component and / or collection thereof.

[0023] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0024] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0025] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrases "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."

[0026] Please see Figure 1 , Figure 1 This is a schematic diagram of a data transmission system based on a USB tethered network provided by an embodiment of the present invention. The data transmission method based on a USB tethered network of this invention can be applied to in-vehicle infotainment systems. For example, the data transmission method based on a USB tethered network can be implemented through software programs configured in the in-vehicle infotainment system, thereby enabling devices connected to the in-vehicle infotainment system that do not have a network module to access the external network. Specifically, the data transmission system based on a USB tethered network includes an in-vehicle infotainment system and external devices. The external devices include a DMS (Driver Monitoring System) device and an APA (Automatic Parking Assist) device. The in-vehicle infotainment system includes a USB hub module and a communication module. The USB hub module includes multiple USB ports. The communication module includes a mobile communication module and a WiFi module. The mobile communication module includes a 4G module and a 5G module. Figure 1 In this text, HU stands for vehicle infotainment system, and a 4G module is used as an example. For ease of description, DMS devices will be abbreviated as DMS, and APA devices as APA. Figure 1 The external devices shown are for illustrative purposes only. In other embodiments, other external devices may be connected, but no specific limitations are made here.

[0027] Please see Figure 2 , Figure 2 This is a flowchart illustrating a data transmission method based on a USB shared network provided in an embodiment of the present invention. Figure 2 As shown, the method includes the following steps S110-S130.

[0028] S110. When an external device is detected connected to the USB port, the MAC address of the external device is obtained, and the MAC address is bound to the USB port to generate a USB network card.

[0029] In this embodiment of the invention, the vehicle's infotainment system monitors the ports of the USB Hub module. When an external device is detected connected to a USB port, the system loads the underlying driver to obtain the MAC address of the external device through the connected USB port and binds the MAC address to the USB port to generate a USB network card. It should be noted that the number of USB ports is determined by the USB Hub module. Figure 1 As shown, the USB Hub module includes five ports: Port0, Port1, Port2, Port3, and Port4. The DMS connects to Port0, and the APA connects to Port1. Understandably, when an external device is connected to Port0, the generated USB network card is usb0; when an external device is connected to Port1, the generated USB network card is usb1, and so on. When all five ports are connected to external devices, the generated USB network cards for Port0, Port1, Port2, Port3, and Port4 are usb0, usb1, usb2, usb3, and usb4, respectively. It should also be noted that in this embodiment, when an external device is connected to a port of the USB Hub module, the vehicle system supplies power to the corresponding port to identify which USB port is connected to the external device; the USB network card is a virtual network card corresponding to the USB port.

[0030] S120. Configure the USB network card for networking and establish a network bridge between the USB network card and a preset network card to generate a USB shared network.

[0031] In this embodiment of the invention, after the USB network card is generated, network configuration is performed on the USB network card. Specifically, a corresponding IP address is configured for the USB network card; a routing table corresponding to the USB network card is created, and the routing address of the USB network card is configured in the routing table; routing rules are added to the routing table, and a corresponding DNS is configured for the USB network card, where DNS stands for Domain Name System. To facilitate understanding, let's take usb0 as an example to explain the specific process of network configuration. The code executed to configure the IP address for usb0 is: `ifconfig usb0 192.168.225.99 netmask 255.255.255.0 up`. The code executed to create the routing table corresponding to usb0 is: `ip route add 192.168.225.0 / 24dev usb0 table 200`. The code executed to configure the network card address of usb0 in the routing table is: `ip route add default via 192.168.225.1dev usb0 table 200`. The code executed to add routing rules to the routing table is: `ip rule add from all table 200 pref 22100`. The code executed to configure the corresponding DNS for usb0 is: `ndc resolver set netdns usb0 114.114.114.114`. 192.168.225.1.

[0032] After configuring the USB network adapter, a network bridge is established between the USB network adapter and a preset network adapter to create a USB shared network. The preset network adapter includes a mobile network adapter and a WiFi network adapter. The specific steps for establishing a network bridge between the USB network adapter and the preset network adapter to create a USB shared network are as follows: Figure 3As shown, the process includes: S121, establishing a mobile network bridge between the USB network card and the mobile network card to generate a first USB shared network; S122, establishing a WiFi network bridge between the USB network card and the WiFi network card to generate a second USB shared network, and using the second USB shared network and the first USB shared network as the USB shared network. It should be noted that in this embodiment, the mobile network card is started by default when the vehicle system starts. Therefore, when an external device is connected to the USB port, the first USB shared network is automatically established, while the second USB shared network is established only after the vehicle system detects that the WiFi network card has started. It should also be noted that in this embodiment, the network corresponding to the USB network card is the USB network, the network corresponding to the mobile network card is the mobile network, and the network corresponding to the WiFi network card is the WiFi network. The USB shared network is a network where the USB network, mobile network, and WiFi network are interconnected. This network allows data on the USB network card to be forwarded to the mobile network card or WiFi network card according to the configured routing rules, and then forwarded to the external network by the mobile network card or WiFi network card. Understandably, the first USB sharing network is a network interconnected with a USB network and a mobile network. This network enables data on the USB network card to be forwarded to the mobile network card according to the configured routing rules, and then forwarded to the external network by the mobile network card. In this embodiment, the mobile network card is a 4G network card. The second USB sharing network is a network interconnected with a USB network and a WiFi network. This network enables data on the USB network card to be forwarded to the WiFi network card according to the configured routing rules, and then forwarded to the external network by the WiFi network card.

[0033] Step S121 specifically includes: establishing a first data transmission channel between the USB network card and the mobile network card; adding routing rules and corresponding mobile priorities to the routing table corresponding to the USB network card; adding routes to the routing table and enabling the data forwarding mode of the first data transmission channel to establish a mobile network bridge to generate a first USB shared network. For ease of understanding, taking the USB network card as usb0 and the mobile network card as ccmni0 as an example, the specific program code for establishing a mobile network bridge is explained, as shown in code snippet 1. It should be noted that in code snippet 1, the lines "iptables -t nat -I POSTROUTING 1 -o ccmni0 -j MASQUERADE" to "iptables -t filter -Atetherctrl_counters -i ccmni0 -o usb0 -j RETURN" perform the following functions: establishing a first data transmission channel between usb0 and ccmni0; "ip rule add iif usb0tableccmni0 prio 18000" performs the following function: adding a routing rule and the corresponding mobile priority prio 18000 to the routing table of usb0; "ip route add table local_network192.168.225.0 / 24dev usb0 proto static scope link" performs the following function: adding a route to the routing table; The function of "routeflush cache" is to refresh the routing table; the function of "sysctl -wnet.ipv4.ip_forward=1" is to enable the data forwarding mode of the first data transmission channel to establish a mobile network bridge.

[0034] {

[0035] "iptables-t nat-I POSTROUTING 1-o ccmni0-j MASQUERADE",

[0036] "iptables-t filter-Atetherctrl_FORWARD-i ccmni0-o usb0-m state--stateESTABLISHED,RELATED-g tetherctrl_counters",

[0037] "iptables-t filter-Atetherctrl_FORWARD-i usb0-o ccmni0-m state--stateINVALID-j DROP",

[0038] "iptables-t filter-A tetherctrl_FORWARD-i usb0-o ccmni0-gtetherctrl_counters",

[0039] "iptables-t filter-D tetherctrl_FORWARD-j DROP",

[0040] "iptables-t filter-A tetherctrl_FORWARD-j DROP",

[0041] "iptables-t filter-D tetherctrl_counters-i usb0-o ccmni0-j RETURN",

[0042] "iptables-t filter-D tetherctrl_counters-i ccmni0-o usb0-j RETURN",

[0043] "iptables-t filter-A tetherctrl_counters-i usb0-o ccmni0-j RETURN",

[0044] "iptables-t filter-A tetherctrl_counters-i ccmni0-o usb0-j RETURN",

[0045] "ip rule add iif usb0 table ccmni0 prio 18000",

[0046] "ip route add table local_network 192.168.225.0 / 24dev usb0 protostatic scope link",

[0047] "ip route flush cache",

[0048] "sysctl-w net.ipv4.ip_forward=1",

[0049] / / Code snippet 1

[0050] Step S122 specifically includes: establishing a second data transmission channel between the USB network card and the WiFi network card; adding routing rules and WiFi priorities corresponding to the routing rules to the routing table corresponding to the USB network card; adding routes to the routing table and refreshing the routing table; and enabling the data forwarding mode of the second data transmission channel to establish a WiFi network bridge to generate a second USB shared network. For ease of understanding, taking the USB network card as usb0 and the WiFi network card as wlan0 as an example, the specific program code for establishing a WiFi network bridge is explained as shown in code snippet 2. It should be noted that in code snippet 2, the lines "iptables -t nat -I POSTROUTING 1 -o wlan0 -jMASQUERADE" to "iptables -t filter -A tetherctrl_counters -i wlan0 -o usb0 -jRETURN" establish a second data transmission channel between usb0 and wlan0; "ip rule add iif usb0 table wlan0 prio 18000" adds a routing rule and its corresponding movement priority (prio 18000) to the routing table of usb0; "ip route add table local_network 192.168.225.0 / 24dev usb0 proto static scope link" adds a route to the routing table; and "ip route flush" adds a route to the routing table. The function of "cache" is to refresh the routing table; the function of "sysctl -wnet.ipv4.ip_forward=1" is to enable the data forwarding mode of the second data transmission channel to establish a WiFi network bridge.

[0051] {

[0052] "iptables-t nat-I POSTROUTING 1-o wlan0-j MASQUERADE",

[0053] "iptables-t filter-A tetherctrl_FORWARD-i wlan0-o usb0-m state--stateESTABLISHED,RELATED-g tetherctrl_counters",

[0054] "iptables-t filter-A tetherctrl_FORWARD-i usb0-o wlan0-m state--stateINVALID-j DROP",

[0055] "iptables-t filter-A tetherctrl_FORWARD-i usb0-o wlan0-gtetherctrl_counters",

[0056] "iptables-t filter-D tetherctrl_FORWARD-j DROP",

[0057] "iptables-t filter-A tetherctrl_FORWARD-j DROP",

[0058] "iptables-t filter-D tetherctrl_counters-i usb0-o wlan0-j RETURN",

[0059] "iptables-t filter-D tetherctrl_counters-i wlan0-o usb0-j RETURN",

[0060] "iptables-t filter-A tetherctrl_counters-i usb0-o wlan0-j RETURN",

[0061] "iptables-t filter-A tetherctrl_counters-i wlan0-o usb0-j RETURN",

[0062] "ip rule add iif usb0 table wlan0 prio 18000",

[0063] "ip route add table local_network 192.168.225.0 / 24dev usb0 protostatic scope link",

[0064] "ip route flush cache",

[0065] "sysctl-w net.ipv4.ip_forward=1",

[0066] / / Code snippet 2

[0067] It should be noted that in this embodiment, whenever the vehicle system detects an external device connected to any port on the USB Hub module, it will execute the steps of generating a USB network card and a USB tethered network. Understandably, the steps of generating a USB network card and a USB tethered network will also be executed when an external device is plugged in or unplugged.

[0068] S130. If a network data packet sent by the external device via the USB network card is received, the network data packet is forwarded to the preset network card based on the USB shared network, and then sent to the external network via the preset network card.

[0069] In this embodiment of the invention, after the USB sharing network is established, if the vehicle-mounted system receives network data packets sent by the external device via the USB network card, it forwards the network data packets to the preset network card based on the USB sharing network, and then sends them to the external network via the preset network card. Specifically, the mobile priority of the mobile network bridging and the WiFi priority of the WiFi network bridging are first obtained; then, based on the mobile priority and the WiFi priority, it is determined whether the network data packets are forwarded to the mobile network card or the WiFi network card via the first USB sharing network or the second USB sharing network. More specifically, it is determined whether the value of the mobile priority is less than the value of the WiFi priority; if the value of the mobile priority is less than the value of the WiFi priority, the network data packets are forwarded to the mobile network card via the first USB sharing network; if the value of the mobile priority is not less than the value of the WiFi priority, the network data packets are forwarded to the WiFi network card via the second USB sharing network. Understandably, in this embodiment, the smaller the priority value, the higher the priority; the larger the priority value, the lower the priority. It should be noted that in this embodiment, by generating the first and second USB sharing networks, devices connected to the vehicle's infotainment system that do not have a network module, such as the APA and DMS, can also access the external network. It should also be noted that in this embodiment, by setting the vehicle's infotainment system, APA, and DMS to the same network segment, data interaction within the local area network can also be achieved. That is, in this embodiment, interconnection between the local area network and the external network can be achieved with the vehicle as the center.

[0070] Figure 4 This is a schematic block diagram of a data transmission device 200 based on a USB tethered network provided in an embodiment of the present invention. Figure 4As shown, corresponding to the above-described data transmission method based on a USB tethered network, the present invention also provides a data transmission device 200 based on a USB tethered network. This data transmission device 200 includes a unit for executing the above-described data transmission method based on a USB tethered network, and the device can be configured in a vehicle infotainment system. Specifically, please refer to... Figure 4 The data transmission device 200 based on a USB shared network includes an acquisition and generation unit 201, a configuration establishment unit 202, and a receiving and sending unit 203.

[0071] The acquisition and generation unit 201 is used to acquire the MAC address of the external device when an external device is detected connected to the USB port, and bind the MAC address to the USB port to generate a USB network card; the configuration establishment unit 202 is used to configure the USB network card and establish a network bridge between the USB network card and a preset network card to generate a USB shared network; the receiving and sending unit 203 is used to forward the network data packet sent by the external device through the USB network card to the preset network card based on the USB shared network if a network data packet is received, and then sent to the external network through the preset network card.

[0072] In some embodiments, such as this one, the configuration establishment unit 202 includes a first configuration unit, a creation unit, a second configuration unit, a first establishment unit, and a second establishment unit.

[0073] The first configuration unit is used to configure a corresponding IP address for the USB network card; the creation unit is used to create a routing table corresponding to the USB network card and configure the routing address of the USB network card in the routing table; the second configuration unit is used to add routing rules to the routing table and configure a corresponding DNS for the USB network card; the first establishment unit is used to establish a mobile network bridge between the USB network card and the mobile network card to generate a first USB sharing network; the second establishment unit is used to establish a WiFi network bridge between the USB network card and the WiFi network card to generate a second USB sharing network, and uses the second USB sharing network and the first USB sharing network as a USB sharing network.

[0074] In some embodiments, such as this one, the first establishment unit includes a first establishment subunit, a first addition unit, and a first refresh activation unit.

[0075] The first establishment subunit is used to establish a first data transmission channel between the USB network card and the mobile network card; the first addition unit is used to add routing rules and corresponding mobile priorities to the routing table corresponding to the USB network card; the first refresh activation unit is used to add routes to the routing table, refresh the routing table, and enable the data forwarding mode of the first data transmission channel to establish a mobile network bridge to generate a first USB shared network.

[0076] In some embodiments, such as this one, the second creation unit includes a second creation subunit, a second addition unit, and a second refresh activation unit.

[0077] The second establishment subunit is used to establish a second data transmission channel between the USB network card and the WiFi network card; the second adding unit is used to add routing rules and WiFi priorities corresponding to the routing rules to the routing table corresponding to the USB network card; the second refresh enabling unit is used to add routes to the routing table, refresh the routing table, and enable the data forwarding mode of the second data transmission channel to establish a WiFi network bridge to generate a second USB shared network.

[0078] In some embodiments, such as this one, the receiving and sending unit 203 includes a first acquisition unit, a second acquisition unit, and a determining sending unit.

[0079] Wherein, the first acquisition unit is used to acquire the mobile priority of the mobile network bridge; the second acquisition unit is used to acquire the WiFi priority of the WiFi network bridge; the determination and sending unit is used to determine, based on the mobile priority and the WiFi priority, whether to forward the network data packet to the mobile network card or the WiFi network card through the first USB tethered network or the second USB tethered network.

[0080] In some embodiments, such as this one, the determining sending unit includes a judging unit, a first sending unit, and a second sending unit.

[0081] The determining unit is used to determine whether the value of the mobile priority is less than the value of the WiFi priority; the first sending unit is used to forward the network data packet to the mobile network card through the first USB tethering network if the value of the mobile priority is less than the value of the WiFi priority; the second sending unit is used to forward the network data packet to the WiFi network card through the second USB tethering network if the value of the mobile priority is not less than the value of the WiFi priority.

[0082] The specific implementation of the data transmission device 200 based on a USB tethered network in this embodiment corresponds to the data transmission method based on a USB tethered network described above, and will not be repeated here.

[0083] The aforementioned data transmission device based on a USB tethered network can be implemented as a computer program, which can be used in, for example... Figure 5 The vehicle's infotainment system is running as shown.

[0084] Please see Figure 5 , Figure 5 This is a schematic block diagram of a vehicle infotainment system provided in an embodiment of this application. The vehicle infotainment system 300 is a device with a USB hub module and a communication module.

[0085] See Figure 5 The vehicle infotainment system 300 includes a processor 302, a memory, and a network interface 305 connected via a system bus 301. The memory may include a storage medium 303 and internal memory 304.

[0086] The storage medium 303 may store an operating system 3031 and a computer program 3032. When the computer program 3032 is executed, it causes the processor 302 to execute a data transfer method based on a USB tethered network.

[0087] The processor 302 provides computing and control capabilities to support the operation of the entire vehicle infotainment system 300.

[0088] The internal memory 304 provides an environment for the execution of the computer program 3032 in the storage medium 303. When the computer program 3032 is executed by the processor 302, the processor 302 can execute a data transfer method based on a USB shared network.

[0089] This network interface 305 is used for network communication with other devices. Those skilled in the art will understand that... Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the vehicle infotainment system 300 to which the present application is applied. The specific vehicle infotainment system 300 may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0090] The processor 302 is used to run a computer program 3032 stored in a memory to implement any embodiment of the above-described data transmission method based on a USB tethered network.

[0091] It should be understood that in the embodiments of this application, the processor 302 may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0092] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program may be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.

[0093] Therefore, the present invention also provides a storage medium. This storage medium can be a computer-readable storage medium. The storage medium stores a computer program. When executed by a processor, the computer program causes the processor to perform any embodiment of the data transmission method based on a USB tethered network described above.

[0094] The storage medium can be any computer-readable storage medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.

[0095] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0096] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some feature maps may be ignored or not executed.

[0097] The steps in the method of this invention can be adjusted, merged, or reduced in order according to actual needs. The units in the device of this invention can be merged, divided, or reduced according to actual needs. Furthermore, the functional units in the various embodiments of this invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0098] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a vehicle-mounted system (which may be a personal computer, terminal, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.

[0099] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0100] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Since these modifications and variations fall within the scope of the claims and their equivalents, this invention also intends to include these modifications and variations.

[0101] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A data transmission method based on a USB shared network, applied to an in-vehicle infotainment system, characterized in that, include: When an external device is detected connected to the USB port, the MAC address of the external device is obtained, and the MAC address is bound to the USB port to generate a USB network card; Configure the USB network card for network access and establish a network bridge between the USB network card and a preset network card to generate a USB shared network. The preset network card includes a mobile network card and a WiFi network card. If a network data packet is received from the external device via the USB network card, the network data packet is forwarded to the preset network card based on the USB shared network, and then sent to the external network via the preset network card; The step of establishing a network bridge between the USB network card and a preset network card to generate a USB shared network includes: A mobile network bridge is established between the USB network card and the mobile network card to generate a first USB shared network; A WiFi network bridge is established between the USB network card and the WiFi network card to generate a second USB sharing network, and the second USB sharing network and the first USB sharing network are used as a USB sharing network.

2. The method according to claim 1, characterized in that, The network configuration of the USB network card includes: Configure the corresponding IP address for the USB network card; Create a routing table corresponding to the USB network card, and configure the routing address of the USB network card in the routing table; Add routing rules to the routing table and configure the corresponding DNS for the USB network card.

3. The method according to claim 1, characterized in that, The step of establishing a mobile network bridge between the USB network card and the mobile network card to generate a first USB shared network includes: A first data transmission channel is established between the USB network card and the mobile network card; Add routing rules and corresponding movement priorities to the routing table corresponding to the USB network card; Add a route to the routing table and refresh the routing table to enable the data forwarding mode of the first data transmission channel to establish a mobile network bridge and generate the first USB tethered network.

4. The method according to claim 3, characterized in that, The step of establishing a WiFi network bridge between the USB network card and the WiFi network card to generate a second USB shared network includes: A second data transmission channel is established between the USB network card and the WiFi network card; Add routing rules and corresponding WiFi priorities to the routing table corresponding to the USB network card; Add a route to the routing table and refresh the routing table. Enable the data forwarding mode of the second data transmission channel to establish a WiFi network bridge to generate a second USB tethered network.

5. The method according to claim 4, characterized in that, The step of forwarding network data packets to the preset network card based on the USB tethered network includes: Obtain the mobility priority of the mobile network bridge; Obtain the WiFi priority of the WiFi network bridged by the WiFi network; Based on the mobile priority and the WiFi priority, it is determined whether the network data packets are forwarded to the mobile network card or the WiFi network card via the first USB tethering network or the second USB tethering network.

6. The method according to claim 5, characterized in that, The step of determining whether to forward the network data packets to the mobile network card or the WiFi network card based on the mobile priority and the WiFi priority includes: Determine whether the value of the mobile priority is less than the value of the WiFi priority; If the value of the mobile priority is less than the value of the WiFi priority, the network data packet is forwarded to the mobile network card through the first USB tethered network. If the value of the mobile priority is not less than the value of the WiFi priority, then the network data packet is forwarded to the WiFi network card through the second USB tethered network.

7. A data transmission device based on a USB shared network, applied to an in-vehicle infotainment system, characterized in that, include: The generation unit is used to obtain the MAC address of the external device when it is detected that an external device is connected to the USB port, and bind the MAC address with the USB port to generate a USB network card. A configuration establishment unit is used to configure the USB network card for network and establish a network bridge between the USB network card and a preset network card to generate a USB shared network. The preset network card includes a mobile network card and a WiFi network card. The receiving and sending unit is configured to, if it receives a network data packet sent by the external device via the USB network card, forward the network data packet to the preset network card based on the USB shared network, and then send it to the external network via the preset network card; The configuration establishment unit includes: The first establishment unit is used to establish a mobile network bridge between the USB network card and the mobile network card to generate a first USB shared network; The second establishment unit is used to establish a WiFi network bridge between the USB network card and the WiFi network card to generate a second USB sharing network, and to use the second USB sharing network and the first USB sharing network as a USB sharing network.

8. A data transmission system based on a USB shared network, characterized in that, The data transmission system includes a vehicle-mounted unit and external devices. The vehicle-mounted unit includes a USB Hub module, a communication module, a memory, and a processor. The communication module includes a mobile communication module and a WiFi module. The memory stores a computer program. When the processor executes the computer program, it implements the method as described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Network access method and device, vehicle-mounted navigator and vehicle-mounted machine

    CN108270594A

  • Method for realizing common networking among multiple devices, storage medium and integrated machine with multiple devices

    CN109039849A

  • A method and a system for realizing coexistence of a vehicle-mounted network

    CN109743771A