Networking method and device, electronic equipment and storage medium
By enabling hotspot interfaces and creating virtual bridges in multi-vehicle systems, the hotspot interfaces and Ethernet interfaces are bridged to the virtual bridges, solving the problem of hotspot subnet interconnection and enabling seamless cross-system access for terminal devices, thereby improving user experience and the flexibility of business scenarios.
Patent Information
- Application Number
- CN202511108839.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-08
- Publication Date
- 2025-11-14
Smart Images

Figure CN120956562A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and more specifically, to a networking method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the development of in-vehicle intelligent systems, vehicle infotainment systems have become an important part of smart cockpits. Users can connect to the vehicle's hotspot to achieve functions such as screen projection, file transfer, and multimedia sharing, which has gradually become the mainstream usage scenario.
[0003] Under the existing framework, for in-vehicle platforms with multiple vehicle infotainment systems, terminal devices can usually only access the hotspot of one of the systems. This prevents clients from directly accessing server-side applications deployed in other systems. They must first disconnect from the current system and then establish a connection with other systems to access server-side applications deployed in other systems, which greatly limits the deployment and operation of complex business scenarios. Summary of the Invention
[0004] The problem solved by this invention is that hotspot subnets cannot communicate with each other in multi-vehicle infotainment systems and terminal devices have limited access.
[0005] To address the above problems, the present invention provides a networking method, apparatus, electronic device, and storage medium.
[0006] In a first aspect, the present invention provides a networking method, comprising: Enable hotspot API; Create a virtual bridge and add the hotspot interface to the virtual bridge; Enable the Ethernet interface and add the Ethernet interface to the virtual bridge, wherein different systems are used to interconnect through the Ethernet interface to form a local area network.
[0007] Optionally, the hotspot enable interface includes: Call the network connection manager's programming interface to initiate a hotspot activation request; The network connection manager coordinates resources to enable the hotspot interface based on the hotspot activation request.
[0008] Optionally, coordinating resources through the network connection manager to enable the hotspot interface according to the hotspot activation request includes: Controls the network connection manager to establish communication with the network management service; After establishing communication, in response to the hotspot activation request, the network management service calls the wireless service module, and the wireless service module configures the wireless network card interface to software access point mode to enable the hotspot interface.
[0009] Optionally, configuring the wireless network card interface as a software access point via the wireless service module includes: The wireless service module calls the configuration daemon or legacy driver module to configure the wireless network card interface as a software access point.
[0010] Optionally, after creating the virtual bridge and adding the hotspot interface to the virtual bridge, the method further includes: Configure the address pool of the virtual bridge, wherein the address pool configured for the virtual bridge is different for different systems; The virtual bridge enables the Dynamic Host Configuration Protocol (DHCP), which is used by the terminal device to obtain a dynamic address from the virtual bridge.
[0011] Optionally, enabling the Ethernet interface and adding the Ethernet interface to the virtual bridge includes: Configure the address and subnet mask of the Ethernet interface so that the Ethernet interface and the virtual bridge are in the same subnet.
[0012] Optionally, the networking method further includes: When a terminal device connects to the virtual bridge of any system through the hotspot interface, it establishes communication with other systems through the local area network.
[0013] In a second aspect, the present invention provides a networking device, comprising: The first module is used to enable the hotspot interface; The second module is used to create a virtual bridge and add the hotspot interface to the virtual bridge; The third module is used to enable the Ethernet interface and add the Ethernet interface to the virtual bridge, wherein different systems are interconnected through the Ethernet interface to form a local area network.
[0014] Thirdly, the present invention provides an electronic device, including a memory and a processor; The memory is used to store computer programs; The processor is configured to implement the networking method as described in the first aspect when executing the computer program.
[0015] Fourthly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the networking method as described in the first aspect.
[0016] The beneficial effects of the networking method of the present invention are as follows: by enabling hotspot interfaces, creating virtual bridges, and bridging the hotspot interfaces and Ethernet interfaces together to the virtual bridges, different systems can be physically interconnected through Ethernet, thereby building a unified local area network environment. Terminal devices can access the services of another system without switching hotspots, and terminal devices can seamlessly connect to any system to realize services such as screen projection, data sharing, and media playback control, thereby greatly improving the user experience and meeting the needs of complex business scenarios such as in-vehicle multi-screen interaction and service sharing. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating the networking method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the networking method according to an embodiment of the present invention; Figure 3 This is a timing diagram of the networking method according to an embodiment of the present invention; Figure 4 This is a schematic diagram illustrating the process of enabling a hotspot interface according to an embodiment of the present invention; Figure 5 This is a schematic diagram illustrating the specific process of enabling the hotspot interface according to an embodiment of the present invention; Figure 6 This is a schematic diagram illustrating the process of configuring a virtual bridge according to an embodiment of the present invention; Figure 7 This is a system architecture diagram of the networking device according to an embodiment of the present invention; Figure 8 This is a system architecture diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0018] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Although some embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the accompanying drawings and embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.
[0019] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0020] The term "comprising" and its variations as used herein are open-ended, meaning "including but not limited to"; the term "based on" means "at least partially based on"; the term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments"; and the term "optionally" means "optional embodiments". Definitions of other terms will be given in the following description. It should be noted that the concepts of "first," "second," etc., mentioned in this invention are used only to distinguish different devices, modules, or units, and are not intended to limit the order of functions performed by these devices, modules, or units or their interdependencies.
[0021] It should be noted that the terms "a" and "a plurality of" used in this invention are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0022] The names of the messages or information exchanged between the multiple devices in the embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of these messages or information.
[0023] like Figure 1 As shown, an embodiment of the present invention provides a networking method, including: S100: Enable hotspot interface.
[0024] Specifically, in combination Figure 2 and Figure 3 As shown, taking vehicle infotainment systems (such as Android systems) A and B as examples (not limited to dual vehicle infotainment systems), hotspot interfaces (Soft Access Points, or SAPs for short) are enabled through the hotspot management modules of systems A and B respectively.
[0025] S200: Create a virtual bridge and add the hotspot interface to the virtual bridge.
[0026] Specifically, virtual bridges are created through the bridge configuration modules of System A and System B, respectively, and the hotspot interfaces of each system are added to the corresponding virtual bridges.
[0027] Among them, the virtual bridge is based on the L2 network. Compared with the L3 layer network address translation (NAT), it can ensure low latency and seamless data forwarding, and improve communication performance and service compatibility.
[0028] S300: Enable the Ethernet interface and add the Ethernet interface to the virtual bridge, wherein different systems are used to interconnect through the Ethernet interface to form a local area network.
[0029] Specifically, the Ethernet interface (ETH) is enabled and added to the virtual bridge. The virtual bridge is responsible for bridging the hotspot interface and the Ethernet interface. System A and System B are directly connected via Ethernet to achieve L2 network communication. When a terminal device accesses the virtual bridge of System A (i.e. accesses the hotspot of System A), it is automatically assigned to a unified local area network.
[0030] An exemplary networking process is as follows: Each of the two vehicle-mounted systems enables its own hotspot. Using Linux network commands or system APIs, a virtual bridge is created and added to the hotspot port and Ethernet port. The subnet IP address pool corresponding to the virtual bridge is configured to ensure no conflicts. DHCP (Dynamic Host Configuration Protocol) service is started on the virtual bridge on both systems. After a terminal device connects to either hotspot (actually connecting to the virtual bridge), it automatically obtains a dynamic IP from that virtual bridge, ensuring that the two systems are directly connected via Ethernet within a unified subnet. After L2 bridging is completed, broadcast, unicast, and multicast protocols can be transparently transmitted throughout the network. The bridges of System A and System B act as communication relays for each other. Terminal devices can access the services of the other system without switching hotspots, and terminal devices can seamlessly connect to either system to perform services such as screen mirroring, data sharing, and media playback control. Therefore, service deployment can be flexibly set up on either system without adjusting the configuration or logic for the connected party.
[0031] In this embodiment, by enabling the hotspot interface, creating a virtual bridge, and bridging the hotspot interface and the Ethernet interface together to the virtual bridge, different systems are physically interconnected through Ethernet, thereby building a unified local area network environment. Terminal devices can access the services of another system without switching hotspots, and terminal devices can seamlessly connect to any system to realize services such as screen projection, data sharing, and media playback control, thereby greatly improving the user experience and meeting the needs of complex business scenarios such as in-vehicle multi-screen interaction and service sharing.
[0032] Optionally, the hotspot enable interface includes: S110: Calls the programming interface of the network connection manager to initiate a hotspot activation request.
[0033] Specifically, in combination Figure 4 As shown, after the user clicks the "Open Hotspot" button, the application notifies the system to start "preparing to create a hotspot". The application layer calls the programming interface (such as the API interface) of the system's network connection manager to initiate a hotspot opening request, triggering the system network service stack to start establishing AP (Access Point) mode.
[0034] Among them, the network connection manager is a system service in the Android system used to manage the network connection status, and provides a programming interface for controlling connections such as hotspots, cellular, and Wi-Fi.
[0035] S120: Coordinate resources through the network connection manager to enable the hotspot interface according to the hotspot activation request.
[0036] Specifically, in combination Figure 4 As shown, the network connection manager acts as a connection scheduler, responsible for coordinating the management tasks of underlying network devices. It can send requests to the kernel space or network management module to create or configure network interfaces, thereby enabling hotspot interfaces.
[0037] In this optional embodiment, the hotspot is triggered by calling the programming interface of the network connection manager, and resources are coordinated by system-level services to ensure the stable initialization of the hotspot function. It has good platform compatibility and maintainability, and is suitable for the standard network architecture of the Android system, making it easy to deploy on a large scale.
[0038] Optionally, coordinating resources through the network connection manager to enable the hotspot interface according to the hotspot activation request includes: S121: Control the network connection manager to establish communication with the network management service.
[0039] Specifically, in combination Figure 5 As shown, the Connectivity Manager establishes communication with the Network Management Service, which is responsible for communicating with the underlying network stack and drivers to perform tasks such as network interface configuration, state management, and bridging.
[0040] S122: After establishing communication, in response to the hotspot activation request, the wireless service module is invoked through the network management service, and the wireless network card interface is configured as a software access point mode through the wireless service module to enable the hotspot interface.
[0041] Specifically, in combination Figure 5 As shown, the network management service calls the wireless service module (Wifi Service), which configures the wireless network card interface (WLAN interface) to software access point mode (AP mode, allowing other devices to connect), thereby enabling the hotspot interface. The Wi-Fi module then starts broadcasting the SSID, and devices such as mobile phones can search for and connect to the hotspot.
[0042] The wireless service module controls the core services of the Wi-Fi function, including creating hotspots, scanning networks, and connecting to Wi-Fi.
[0043] In this optional embodiment, by linking the connection manager with the network management service, which in turn calls the wireless service module, the hotspot configuration operation is decoupled and modularized, improving the system's structural clarity and functional reusability, and enhancing system stability and controllability.
[0044] Optionally, configuring the wireless network card interface as a software access point via the wireless service module includes: The wireless service module calls the configuration daemon or legacy driver module to configure the wireless network card interface as a software access point.
[0045] Specifically, for newer Android systems, the wireless service module configures the daemon (Wificond) via Wi-Fi, while for other Android systems, the wireless network card interface can be configured as a software access point via the legacy driver module.
[0046] In this optional embodiment, the hotspot interface is configured using a Wi-Fi configuration daemon or an older driver module, making the solution compatible with different versions of the Android platform, with good compatibility and adaptability, ensuring that the hotspot function can be reliably enabled on different devices.
[0047] Optionally, after creating the virtual bridge and adding the hotspot interface to the virtual bridge, the method further includes: S210: Configure the address pool of the virtual bridge, wherein the IP address pool configured for virtual bridges of different systems is different.
[0048] Specifically, in combination Figure 6 As shown, System A and System B configure different address pools (e.g., IP address pools) for their respective virtual bridges. For example, System A is assigned the network segment 192.168.10.1 / 24; System B is assigned the network segment 192.168.10.100-200. This avoids IP conflicts and ensures that addresses are unique throughout the local area network.
[0049] S220: Enable Dynamic Host Configuration Protocol (DHCP) through the virtual bridge, wherein the DHCP protocol is used by the terminal device to obtain a dynamic address from the virtual bridge.
[0050] Specifically, in combination Figure 6As shown, each system independently starts a DHCP service (a network protocol used to automatically assign IP addresses to connected devices). After a terminal device connects to a hotspot, it obtains a dynamic address (such as a dynamic IP address) from the virtual bridge through the Dynamic Host Configuration Protocol. In other words, the IP address obtained by the terminal device is assigned by the DHCP service bound to the virtual bridge. Even if it connects to the hotspot of system A, its IP address range can still be consistent with that assigned by system B (the same subnet). Since Ethernet has bridged the bridges of the two systems, the terminal and the server in system B are also in the same broadcast domain, supporting broadcast discovery (such as DLNA), multicast data (such as screen mirroring), point-to-point communication (such as file transfer), and other operations.
[0051] In this optional embodiment, independent address pools are configured for each virtual bridge, and DHCP service is enabled so that terminal devices can automatically obtain dynamic addresses, avoiding the complexity brought about by fixed configurations. At the same time, the use of different address pools for each system can effectively avoid address conflicts, ensure network stability, and adapt to the needs of concurrent access by multiple terminals.
[0052] Optionally, enabling the Ethernet interface and adding the Ethernet interface to the virtual bridge includes: Configure the address and subnet mask of the Ethernet interface so that the Ethernet interface and the virtual bridge are in the same subnet.
[0053] Specifically, after completing the initialization of the hotspot and the bridge, the system needs to bridge the Ethernet interface between the vehicle and the computer to the same virtual bridge. First, configure the address and subnet mask of the Ethernet interface to ensure that the Ethernet interface and the virtual bridge are in the same subnet. Alternatively, the Ethernet interface can be configured to have no IP address, and the virtual bridge will provide network abstraction as a whole.
[0054] In this optional embodiment, by configuring a static address and subnet mask for the Ethernet interface and adding a virtual bridge, it can run in the same subnet as the hotspot interface, thereby realizing L2 layer bridging communication, effectively breaking down network isolation between the hotspot and Ethernet, and ensuring that functions such as broadcasting, multicasting, and screen projection are available across the entire network segment.
[0055] Optionally, the networking method further includes: When a terminal device connects to the virtual bridge of any system through the hotspot interface, it establishes communication with other systems through the local area network.
[0056] Specifically, when a terminal device connects to the virtual bridge of system A through a hotspot interface, it can establish communication with system B through the local area network, and thus access any service in the entire local area network.
[0057] In this optional embodiment, when a terminal device accesses any system hotspot through a hotspot interface, it can seamlessly access services in another system through the local area network, achieving multi-system interoperability and transparent communication without requiring users to switch hotspots or reconfigure the network, thereby greatly improving the user experience and meeting the needs of complex business scenarios such as in-vehicle multi-screen interaction and service sharing.
[0058] like Figure 7 As shown, an embodiment of the present invention provides a networking device 700, comprising: The first module 710 is used to enable the hotspot interface; The second module 720 is used to create a virtual bridge and add the hotspot interface to the virtual bridge; The third module 730 is used to enable the Ethernet interface and add the Ethernet interface to the virtual bridge, wherein different systems are used to interconnect through the Ethernet interface to form a local area network.
[0059] like Figure 8 As shown, an electronic device 800 provided in this embodiment of the invention includes a memory 820 and a processor 810; the memory 820 is used to store a computer program; the processor 810 is used to implement the networking method described above when the computer program is executed.
[0060] Alternatively, an electronic device 800 includes a memory 820 and a processor 810 coupled to the memory 820; the memory 820 is configured to store a computer program; and the processor 810 is configured to perform the following operations when the computer program is executed: Enable hotspot API; Create a virtual bridge and add the hotspot interface to the virtual bridge; Enable the Ethernet interface and add the Ethernet interface to the virtual bridge, wherein different systems are used to interconnect through the Ethernet interface to form a local area network.
[0061] This invention provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the networking method described above.
[0062] Alternatively, a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the following operations: Enable hotspot API; Create a virtual bridge and add the hotspot interface to the virtual bridge; Enable the Ethernet interface and add the Ethernet interface to the virtual bridge, wherein different systems are used to interconnect through the Ethernet interface to form a local area network.
[0063] The present invention will now be described an electronic device 800 that can serve as a server or client of the present invention, which is an example of a hardware device that can be applied to various aspects of the present invention. Electronic device 800 is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic device 800 can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0064] Electronic device 800 includes a computing unit that can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) or a computer program loaded from a storage unit into random access memory (RAM). The RAM may also store various programs and data required for device operation. The computing unit, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.
[0065] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc. In this application, the units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of the present invention according to actual needs. Furthermore, the functional units in the various embodiments of the present 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. The integrated units can be implemented in hardware or as software functional units.
[0066] While the present invention has been disclosed above, its scope of protection is not limited thereto. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention, and all such changes and modifications will fall within the scope of protection of the present invention.
Claims
1. A networking method, characterized in that, include: Enable hotspot API; Create a virtual bridge and add the hotspot interface to the virtual bridge; Enable the Ethernet interface and add the Ethernet interface to the virtual bridge, wherein different systems are used to interconnect through the Ethernet interface to form a local area network.
2. The networking method according to claim 1, characterized in that, The hotspot activation interface includes: Call the network connection manager's programming interface to initiate a hotspot activation request; The network connection manager coordinates resources to enable the hotspot interface based on the hotspot activation request.
3. The networking method according to claim 2, characterized in that, The step of coordinating resources through the network connection manager to enable the hotspot interface according to the hotspot activation request includes: Controls the network connection manager to establish communication with the network management service; After establishing communication, in response to the hotspot activation request, the network management service calls the wireless service module, and the wireless service module configures the wireless network card interface to software access point mode to enable the hotspot interface.
4. The networking method according to claim 3, characterized in that, The step of configuring the wireless network card interface as a software access point mode through the wireless service module includes: The wireless service module calls the configuration daemon or legacy driver module to configure the wireless network card interface as a software access point.
5. The networking method according to claim 1, characterized in that, After creating the virtual bridge and adding the hotspot interface to the virtual bridge, the process further includes: Configure the address pool of the virtual bridge, wherein the address pool configured for virtual bridges in different systems is different; The virtual bridge enables the Dynamic Host Configuration Protocol (DHCP), which is used by the terminal device to obtain a dynamic address from the virtual bridge.
6. The networking method according to claim 1, characterized in that, Enabling the Ethernet interface and adding the Ethernet interface to the virtual bridge includes: Configure the address and subnet mask of the Ethernet interface so that the Ethernet interface and the virtual bridge are in the same subnet.
7. The networking method according to any one of claims 1 to 6, characterized in that, Also includes: When a terminal device connects to the virtual bridge of any system through the hotspot interface, it establishes communication with other systems through the local area network.
8. A networking device, characterized in that, include: The first module is used to enable the hotspot interface; The second module is used to create a virtual bridge and add the hotspot interface to the virtual bridge; The third module is used to enable the Ethernet interface and add the Ethernet interface to the virtual bridge, wherein different systems are interconnected through the Ethernet interface to form a local area network.
9. An electronic device, characterized in that, Including memory and processor; The memory is used to store computer programs; The processor is configured to implement the networking method as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the networking method as described in any one of claims 1 to 7.