A multi-terminal interconnection method, system, electronic device and storage medium

By configuring priorities and role state machines for Bluetooth devices, a star topology network centered on high-priority devices is constructed, which solves the problems of topology chaos and high resource consumption in Bluetooth networking and improves network stability and reliability.

CN122269252APending Publication Date: 2026-06-23WUHAN QIWU TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
WUHAN QIWU TECH CO LTD
Filing Date
2026-03-18
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Existing Bluetooth networking technologies suffer from problems such as chaotic connection topology, excessive burden on peripheral devices, and inability to adapt to dynamic changes when dynamically and heterogeneously interconnected. This results in poor network stability, high resource consumption, and inconsistent states.

Method used

Each wireless communication device is assigned a priority and its role state machine is initialized. Through priority comparison and role state switching, a star topology network centered on high-priority devices is constructed to realize a dynamic self-organizing mechanism, ensuring the deterministic convergence of the network topology from disorder to order, and the data interaction between peripheral devices is uniformly forwarded through the central device.

Benefits of technology

It enables automatic optimization and clear management of network topology, reduces the resource management burden and power consumption of peripheral devices, improves network stability and reliability, simplifies communication paths and protocol stack complexity, and ensures high efficiency in global state synchronization and topology management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122269252A_ABST
    Figure CN122269252A_ABST
Patent Text Reader

Abstract

The application provides a multi-terminal interconnection method, system, electronic device and storage medium, priority of each wireless communication device is preset, and a role state containing independent, central and peripheral three states is initialized, a dynamic self-organizing mechanism taking priority as the only decision basis is constructed. When a first device in the independent state discovers a second device through a device discovery process, priority comparison is triggered: if the first device has higher priority, the first device is switched from the independent state to the central device state after actively establishing a connection, and the second device is assigned to enter the peripheral device state and stop the active device discovery process. The first device in the central device state continuously performs device discovery, actively discovers and connects all other devices with lower priority, and automatically constructs a star-shaped topology network with itself as the center. By completely giving the connection decision-making right to the high-priority device, the network topology from disorder to order is determined to converge.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of short-range wireless communication technology, and in particular to a multi-terminal interconnection method and system. Background Technology

[0002] With the popularization of IoT technology, users often need to coordinate multiple heterogeneous Bluetooth devices (such as smart bike watches, sports watches, heart rate monitors, smart car lights, remote controls, etc.) in fields such as sports and fitness, smart homes, and automotive electronics to build an intelligent personal area network. Bluetooth Low Energy (BLE) technology, due to its low power consumption and widespread availability, has become the mainstream choice for achieving interconnection of such short-range devices. In classic Bluetooth networking modes, to achieve data communication between devices, a mesh topology is typically used where devices directly connect to each other, or a star topology where a pre-set central device connects to multiple peripheral devices.

[0003] However, existing Bluetooth networking technologies have significant technical shortcomings when dealing with the self-organized interconnection of dynamic, heterogeneous device groups. First, in a decentralized mesh network, each device needs to maintain complex connections with multiple other devices. This places a huge processing and power consumption burden on peripheral devices (such as headlights and sensors) with limited computing resources, memory, and battery capacity, becoming a bottleneck for product feature expansion. Second, whether in a complex mesh network or a star topology with a pre-defined fixed center, the network cannot dynamically and optimally elect a suitable central device based on real-time device additions and removals, as well as the individual processing capabilities of each device, and guide other devices to connect to it. Therefore, it cannot automatically converge to a clearly structured and efficiently managed network structure. Finally, when the network dynamically changes (such as the addition of higher-performance devices or the central device going offline), existing solutions lack an intelligent topology reconstruction and global state synchronization mechanism. This easily leads to network connection conflicts, role confusion, and inconsistent perceptions among devices regarding network membership and central affiliation, ultimately affecting the stability and reliability of the entire system. Summary of the Invention

[0004] This invention provides a multi-terminal interconnection method, system, electronic device, and storage medium to solve the technical problems of poor network stability, high resource consumption, and inconsistent states caused by chaotic connection topology, excessive burden on peripheral devices, and inability to adapt to dynamic changes in existing multi-terminal networking technologies.

[0005] In a first aspect, embodiments of the present invention provide a multi-terminal interconnection method, applied to a system including multiple wireless communication devices, comprising: Configure the priority of each wireless communication device and initialize a role state machine for each wireless communication device; the role state machine includes at least an independent state, a central device state, and a peripheral device state.

[0006] When the first wireless communication device is in an independent state and discovers the second wireless communication device through the device discovery process, the first wireless communication device compares the priorities of the first wireless communication device and the second wireless communication device.

[0007] If the first wireless communication device has a higher priority than the second wireless communication device, then the first wireless communication device will actively initiate a connection to the second wireless communication device.

[0008] After the connection is established, the first wireless communication device switches from the independent state to the central device state and assigns the second wireless communication device to the peripheral device state; the wireless communication device in the peripheral device state stops the active device discovery process.

[0009] The first wireless communication device in the central device state continuously performs the device discovery process, discovers and connects all other wireless communication devices with lower priority than the first wireless communication device that are in an independent state or a peripheral device state, and constructs a star topology network centered on the first wireless communication device.

[0010] A wireless communication device in peripheral device state communicates only with a connected wireless communication device in central device state. Data interaction between any two wireless communication devices in peripheral device state is forwarded by the wireless communication device in central device state connected to the two wireless communication devices in peripheral device state.

[0011] Preferably, the priority is uniquely determined by the type of the wireless communication device, and different types of wireless communication devices have different preset priority values.

[0012] Preferably, the device discovery process includes wireless broadcasting and wireless scanning; wherein, the wireless communication device in the peripheral device state stops performing wireless scanning and continues to perform wireless broadcasting for discovery by the wireless communication device in the central device state.

[0013] As a preferred option, the inclusion of high-priority devices is also included: When a first wireless communication device in the central device state discovers a third wireless communication device through the device discovery process, and the third wireless communication device has a higher priority than the first wireless communication device, the first wireless communication device waits for the third wireless communication device to initiate a connection.

[0014] After the first wireless communication device successfully connects with the third wireless communication device, the first wireless communication device synchronizes the currently maintained network information to the third wireless communication device and switches from the central device state to the peripheral device state.

[0015] The third wireless communication device switches from the peripheral device state or the independent state to the central device state, and based on the network information, actively initiates connections to other wireless communication devices in the peripheral device state recorded in the network information, so as to take over the star topology network.

[0016] As a preferred option, offline processing by the central equipment is also included: When a wireless communication device in peripheral device state detects that the connection with the currently connected wireless communication device in central device state has been lost, the wireless communication device in peripheral device state reverts from peripheral device state to independent state and re-executes the device discovery process.

[0017] As a preferred option, topology state synchronization is also included: The wireless communication device in the central device state maintains a list of connections across the entire network, and generates a topology update message carrying an incrementing version number when a wireless communication device connection or disconnection event occurs in the star topology network.

[0018] The wireless communication device in the central device state will forcibly push the topology update message to all currently online wireless communication devices in the peripheral device state.

[0019] Preferably, it also includes at least one of power consumption management, special device handling, and same-priority conflict handling; The power consumption management includes: a wireless communication device in the central device state enters a low-frequency device discovery mode after confirming that it has connected to all discoverable wireless communication devices; a wireless communication device in the independent state extends the execution interval of the device discovery process if it does not discover a higher-priority wireless communication device and is not connected to any wireless communication device within a preset time.

[0020] The special device processing includes: the system also includes a special wireless communication device defined as a purely passive peripheral device. The special wireless communication device has a preset minimum priority and never has the ability to actively perform the device discovery process. It can only passively accept connections.

[0021] The same priority conflict handling includes: when two wireless communication devices with the same priority need to exist in the same star network at the same time, the removal and addition of wireless communication devices are performed through the human-machine interface of the wireless communication device currently in the central device state, and the wireless communication device in the central device state coordinates the update and synchronization of the entire network topology.

[0022] Secondly, embodiments of the present invention provide a multi-terminal interconnection system, including multiple wireless communication devices, each of which is configured with a priority configuration module, a role status module, a device discovery module, a connection decision module, and a data communication module.

[0023] The priority configuration module is used to configure the priority of the wireless communication device.

[0024] The role state module is used to initialize and maintain the role state machine of the wireless communication device, and can switch between different role state machines according to the trigger command; the role state machine includes at least an independent state, a central device state, and a peripheral device state.

[0025] The device discovery module is used to perform the device discovery process and realize mutual discovery with other wireless communication devices.

[0026] The connection decision module is used for: When the first wireless communication device to which the connection decision module belongs is in an independent state, and the device discovery module of the first wireless communication device discovers the second wireless communication device, the priorities of the first wireless communication device and the second wireless communication device are compared.

[0027] If the first wireless communication device has a higher priority than the second wireless communication device, then the first wireless communication device is controlled to actively initiate a connection to the second wireless communication device.

[0028] After the connection is established, a command to switch to the central device state is sent to the role status module of the first wireless communication device, and an assignment command to enter the peripheral device state is sent to the role status module of the second wireless communication device.

[0029] When the first wireless communication device is in the central device state, the control module continuously executes the device discovery process through the device discovery module to discover and connect all other wireless communication devices with lower priority than the first wireless communication device that are in an independent state or a peripheral device state, and to build a star topology network centered on the first wireless communication device.

[0030] The data communication module is used for: The wireless communication device in the peripheral device state communicates only with the connected wireless communication device in the central device state.

[0031] Data interaction between any two wireless communication devices in peripheral device state is forwarded by the data communication module of the wireless communication device in central device state, which is connected to the two wireless communication devices in peripheral device state.

[0032] The assignment instruction to enter the peripheral device state is used to trigger the role state module of the assigned wireless communication device to switch to the peripheral device state, and to trigger the device discovery module of the assigned wireless communication device to stop executing the active device discovery process.

[0033] Thirdly, embodiments of the present invention provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the multi-terminal interconnection method as described in the first aspect of the present invention.

[0034] Fourthly, embodiments of the present invention provide a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the multi-terminal interconnection method as described in the first aspect of the present invention.

[0035] This invention provides a multi-terminal interconnection method, system, electronic device, and storage medium. By pre-prioritizing each wireless communication device and initializing a role state machine containing independent, central, and peripheral states, a dynamic self-organizing mechanism is constructed, with priority as the sole decision-making criterion. When a first device in the independent state discovers a second device through the device discovery process, a priority comparison is immediately triggered: if the first device has a higher priority, it actively initiates the connection. After the connection is established, the first device switches from the independent state to the central device state, simultaneously assigning the second device to the peripheral device state and ceasing its active device discovery process. Subsequently, the first device in the central device state continues to perform device discovery, actively discovering and connecting to all other devices with lower priorities, thereby automatically constructing a star topology network centered on itself. In this network, all peripheral devices communicate directly only with the connected central device, and data interaction between any two peripheral devices is uniformly forwarded by the central device. By completely granting connection decision-making power to high-priority devices, deterministic convergence of the network topology from disorder to order is achieved, avoiding the topology chaos caused by direct pairwise connections between devices in traditional networking methods. By embedding network organization logic at the device level, automatic networking between multiple devices without manual intervention is achieved, significantly improving the user experience. By forcing peripheral devices to communicate only with the central device and stopping active scanning, the connection management burden and power consumption of resource-constrained devices such as sensors and vehicle lights are greatly reduced, simplifying their hardware design and protocol stack complexity. The star topology with the central device at its core provides a unified routing hub for data interaction. All cross-device communication is forwarded through the central device, which not only simplifies the communication path and improves reliability, but also lays the foundation for the central device to implement global state synchronization and topology management, thereby ensuring the stability and maintainability of the entire network. Attached Figure Description

[0036] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0037] Figure 1 This is a flowchart of a multi-terminal interconnection method according to an embodiment of the present invention; Figure 2 This is a block diagram of a multi-terminal interconnection system according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the physical structure according to an embodiment of the present invention. Detailed Implementation

[0038] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0039] In the embodiments of this application, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.

[0040] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0041] This invention provides a multi-terminal interconnection method, applicable to a system including multiple wireless communication devices, such as... Figure 1 As shown, the method includes: S1. Configure the priority of each wireless communication device and initialize a role state machine for each wireless communication device; the role state machine includes at least an independent state, a central device state, and a peripheral device state. The method of this invention can be applied to systems composed of multiple heterogeneous Bluetooth wireless communication devices in sports scenarios such as cycling and running, as well as in fields such as smart homes and automotive electronics. The priority is a preset value uniquely associated with the device type of the wireless communication device. Different device types correspond to different priorities and form a total order relationship, such as smart bike meter > mobile APP > smartwatch > headlight > taillight > sensor > remote control. The priority determines the device's network dominance. The role state machine is a logical state management module configured for each wireless communication device, including three core states: independent state, central device state, and peripheral device state. The device can adaptively switch between different states according to the networking rules. The independent state indicates that the device has not joined any network; the central device state indicates that the device acts as the sole hub of the network, responsible for networking and data routing; and the peripheral device state indicates that the device has connected to the central device and communicates only through the central device.

[0042] Specifically, each wireless communication device in the system is configured with a unique preset priority based on its device type. The priority value matches the device's computing resources, connection limit, and functional positioning, with devices having richer resources and stronger core capabilities configured with higher priorities. Simultaneously, a role state machine is initialized for each wireless communication device, with three core states and basic behavioral rules for each state. In the independent state, the device can simultaneously perform Bluetooth broadcasting and scanning operations; in the central device state, the device can perform scanning, connection management, and data forwarding operations; and in the peripheral device state, the device only retains basic broadcasting capabilities. Existing technologies lack clear role divisions and priority rules for device networking, leading to blind connection establishment between devices and a lack of a unified leading party in network formation. This embodiment, by pre-configuring priorities and initializing state machines, lays the foundation for intelligent device networking and role switching, solving the technical problems of ruleless networking and unfounded role allocation in existing technologies. It standardizes the pre-rules for device networking, providing a logical basis for subsequent topology construction and role switching. Furthermore, the configuration method of matching priorities with device capabilities ensures that the network center is occupied by devices with superior resources, providing an underlying guarantee for network stability.

[0043] S2. When the first wireless communication device is in an independent state and discovers the second wireless communication device through the device discovery process, the first wireless communication device compares the priorities of itself and the second wireless communication device. The independent state is one of the core states of the role state machine, referring to the initial state where the device is not connected to any star topology network and is not acting as a network center. In this state, the device has full Bluetooth broadcast and scanning capabilities. The device discovery process is the process by which wireless communication devices achieve mutual awareness through Bluetooth broadcast and Bluetooth scanning. Devices broadcast their own device type, priority, current status identifier, etc., and receive broadcast information from other devices through scanning, thus completing mutual discovery. Priority comparison refers to the operation where, after two devices complete mutual discovery, each retrieves its own and the other's preset priority values ​​and performs a comparison. The result of this comparison serves as the core basis for subsequent connection decisions and role allocation.

[0044] It should be noted that after all wireless communication devices are powered on, except for remote controls defined as purely passive peripheral devices, all other devices enter the independent state of the role state machine by default, and periodically alternate between performing Bluetooth broadcasting and Bluetooth scanning operations according to a preset cycle. The broadcast data includes core information such as its own device type, preset priority, and current role status identifier. When the first wireless communication device in the independent state receives the broadcast information of the second wireless communication device through scanning and completes device discovery, the first wireless communication device immediately parses and extracts the priority value of the second wireless communication device from the broadcast information, and at the same time retrieves its own priority value to perform a comparison operation between the priorities of the two devices to determine the priority relationship between them.

[0045] In existing technologies, there is no unified priority comparison rule after device discovery, leading to arbitrary connections between devices and the formation of mesh topologies. This embodiment solves the technical problem of existing technologies where connection decisions after device discovery are unfounded and prone to chaotic connections by limiting the basic discovery behavior of independent state devices and standardizing the priority comparison process after device discovery. It realizes pre-screening of devices for networking, allowing high-priority devices to become the dominant party in networking, avoiding resource consumption caused by low-resource devices being frequently connected. At the same time, the standardized broadcast information content ensures the accuracy and efficiency of priority comparison.

[0046] S3. If the first wireless communication device has a higher priority than the second wireless communication device, then the first wireless communication device actively initiates a connection to the second wireless communication device.

[0047] Specifically, after comparing the priorities of the first wireless communication device and the second wireless communication device, if the first wireless communication device determines that its priority is higher than that of the second wireless communication device, then the first wireless communication device actively sends a Bluetooth connection request to the second wireless communication device according to the Bluetooth communication protocol, initiating a point-to-point Bluetooth connection. If the first wireless communication device determines that its priority is lower than that of the second wireless communication device, then the first wireless communication device does not perform any connection operation, maintains an independent state, and continues to perform periodic broadcasting and scanning, waiting for a higher-priority device to discover it and initiate a connection. If the priorities are the same, the first wireless communication device also does not initiate a connection, avoiding network conflicts between devices of the same priority. In the prior art, devices initiate connections indiscriminately, resulting in multiple devices simultaneously initiating connection requests to a single device, causing connection conflicts and resource waste. This embodiment solves the technical problems of irregular connection initiation and easy connection conflicts in the prior art by using high priority as the sole condition for initiating a connection. It achieves unidirectional and orderly connection initiation, allowing the network formation process to be dominated by high-priority devices, avoiding invalid connection operations by low-priority devices, and avoiding connection conflicts between devices of the same priority, thereby reducing the ineffective power consumption of devices and the resource occupation of communication links.

[0048] After the connection is established, the first wireless communication device switches from the independent state to the central device state, and assigns the second wireless communication device to the peripheral device state; the wireless communication device in the peripheral device state stops the active device discovery process. The central device state is one of the core states of the role state machine, referring to the core state in which the device acts as the sole hub of the star topology network, responsible for device discovery, connection management, data routing, and state synchronization for the entire network. Role switching is the operation by which a device changes its state between the independent state, central device state, and peripheral device state according to the networking rules; it is a core step in star topology construction. Assigning the peripheral device state involves the high-priority device initiating the connection sending a state switching command to a low-priority device, instructing the low-priority device to switch from the independent state to the peripheral device state. The active device discovery process involves the device actively performing Bluetooth scanning and actively initiating Bluetooth connection operations; it is the core behavior of the device as the network leader, distinct from the passive discovery behavior of merely broadcasting.

[0049] Specifically, once the Bluetooth connection request between the first and second wireless communication devices is accepted and a communication link is successfully established, the first wireless communication device immediately triggers a state switch in its own role state machine, officially switching from an independent state to a central device state. At the same time, it sends a role assignment instruction to the second wireless communication device, instructing the second wireless communication device to complete the role state machine switch and enter the peripheral device state from an independent state. After receiving the role assignment instruction, the second wireless communication device immediately stops all active device discovery processes, disables the Bluetooth scanning function, and no longer actively initiates any connection operations. It only retains the Bluetooth broadcast function at the minimum necessary frequency for being identified and having its connection status confirmed by the central device.

[0050] In existing technologies, there is no role distinction after devices establish a connection. All devices retain their full discovery and connection capabilities and continue to establish connections with other devices, ultimately forming a chaotic mesh topology. This embodiment solves the technical problem of existing technologies where there are no role constraints after device connection and mesh topology is easily formed by switching roles immediately after connection is established and strictly limiting the proactive discovery behavior of peripheral devices. It realizes the role-based division of device networking, clarifies the behavioral boundaries between central and peripheral devices, fundamentally avoids peripheral devices establishing invalid connections with other devices, and the operation of peripheral devices to disable scanning functions significantly reduces the hardware resource consumption and power consumption of peripheral devices, solving the pain point of excessive resource burden on peripheral devices in existing technologies.

[0051] S4. The first wireless communication device in the central device state continues to execute the device discovery process, discovering and connecting all other wireless communication devices with lower priority than the first wireless communication device that are in an independent state or a peripheral device state, thus constructing a star topology network centered on the first wireless communication device. The star topology network, with a central device at its core, is a network structure where all other devices establish a unique communication link directly with the central device and do not directly connect to other devices; it is the core network form of this invention.

[0052] Specifically, after the first wireless communication device switches to the central device state, it continuously performs Bluetooth scanning operations to maintain the continuity of the device discovery process. It scans surrounding wireless communication devices in real time and performs priority resolution and comparison operations on all scanned devices. Once a device with a lower priority than itself is found, regardless of whether the device is in an independent state or in the peripheral device state of another temporary star network, it actively initiates a Bluetooth connection request to it. For devices that successfully connect, they are assigned to the peripheral device state and their behavior is restricted according to the rules in step four, until the central device discovers and connects to all discoverable low-priority devices in the surrounding area, gradually building a star topology network with itself as the sole center, all low-priority devices as peripheral nodes, and no direct communication links between peripheral nodes. If a central device of another temporary star network is scanned and its priority is lower than its own, it actively initiates a connection to that temporary central device. The temporary central device switches to the peripheral device state and synchronizes the peripheral device information it manages to the central device, which then takes over and connects to that part of the peripheral devices.

[0053] Existing technologies cannot automatically construct an ordered network topology from a chaotic initial state, nor can they integrate multiple temporary networks, resulting in a chaotic network structure and difficult management. This embodiment solves the technical problems of existing technologies being unable to automatically construct the optimal topology and integrate temporary networks by having the central device continuously perform discovery and connection operations, as well as take over other temporary low-priority central devices. It achieves deterministic convergence from a disordered initial state to an ordered star topology, making the network structure clear and easy to manage. At the same time, the central device uniformly takes over all low-priority devices, allowing all peripheral devices to establish a single connection with the central device, which greatly reduces the connection management burden of peripheral devices and improves the stability of the entire network.

[0054] S5. A wireless communication device in peripheral device mode communicates only with a connected wireless communication device in central device mode. Data interaction (including the sending and receiving of various information such as control commands, status data, and sensing data) between any two wireless communication devices in peripheral device mode is forwarded by the wireless communication device in central device mode connected to the two peripheral device wireless communication devices. A standardized data transmission protocol designed to achieve central device forwarding adds a network layer transparent transmission service on top of the Bluetooth application layer protocol, defining a unified data packet format that includes a packet header, target device information, source device information, and raw application data.

[0055] In the network of Example 1, the user presses a button via a remote control (which has been connected to the network via the headlights) to control the taillights to change their flashing mode.

[0056] Implementation Process: 1. The remote controller (peripheral device) generates a control command data packet. This data packet follows a unified transparent transmission format, with the target device type field set to "taillight," the source device identifier being the remote controller's MAC address, and the payload being the specific control command. 2. The remote controller sends this data packet to its connected central device (code table). 3. Upon receiving the packet, the code table (central device) parses it and finds the target is "taillight." The code table queries its maintained connection table, finds the connection handle corresponding to the taillight, and forwards the data packet to the taillight as is. 4. The taillight receives the data packet from the code table, parses it, and performs a blinking mode switch.

[0057] Communication Results: Path: Remote Control → Codebook (Center) → Taillight. Results: Verifies the effectiveness of the unified data routing protocol. No direct connection is needed between the remote control and the taillight, simplifying inter-device communication logic. All complex routing is handled by the resource-rich central device, reducing the implementation complexity of peripheral devices.

[0058] Specifically, all wireless communication devices in peripheral device state complete all data interaction activities only with the connected central device and do not establish direct communication links with any other peripheral devices. When any two peripheral devices need to interact, the source peripheral device initiating the data interaction encapsulates a data packet containing header verification information, the type and MAC address of the target peripheral device, the source peripheral device identifier, and the original application data according to a unified data transparent transmission protocol, and sends the data packet uniquely to the central device. After receiving the data packet, the central device first parses the header to complete the verification, then extracts the target device information, queries its own maintained network connection list, finds the communication link corresponding to the target peripheral device, and forwards the data packet to the target peripheral device as is. If the target of the data packet is the central device itself, the central device directly receives it and hands it over to the application layer for processing; if the data packet is broadcast data, the central device forwards the data packet to all connected peripheral devices. In existing technologies, peripheral devices directly establish connections to complete data interaction, resulting in each peripheral device needing to maintain multiple communication links. This leads to high protocol stack complexity and resource consumption. Furthermore, the lack of a unified data transmission protocol makes data loss and parsing errors prone to occur. This embodiment solves the technical problems of complex peripheral device communication links and the lack of a unified data transmission standard by limiting peripheral devices to communicating only with a central device, and having the central device perform cross-device data forwarding according to a unified protocol. This achieves a significant simplification of peripheral device communication logic, requiring each peripheral device to implement only a single communication interface with the central device. This greatly reduces the protocol stack complexity and hardware resource consumption of peripheral devices. Simultaneously, the unified data pass-through protocol ensures the accuracy and integrity of data transmission, improving the reliability of data communication across the entire network.

[0059] For example, a user can simultaneously power on four devices: a speedometer, headlights, taillights, and a remote control. All devices are initially in an independent state.

[0060] 1. All devices (except the remote control, which is not subject to the rules) enter independent mode, starting periodic scanning (e.g., scanning 200ms per second) and broadcasting (broadcasting interval 1s). 2. The code reader (priority 10) detects broadcasts from the headlights (priority 5), taillights (priority 3), and remote control (priority 1) through scanning. Since the code reader has the highest priority, it actively initiates Bluetooth connections to these three devices and successfully establishes them. 3. After being connected to the code reader, the headlights, taillights, and heart rate monitor immediately change their role from "independent" to "peripheral device" and stop scanning, only maintaining broadcasting. 4. After successfully connecting to these three devices, the code reader is established as the "central device" and continues scanning to discover potential new devices. 5. Since the headlights, taillights, and remote control are all in peripheral device mode and have stopped scanning, they will not establish any connections with each other.

[0061] Final Network Topology and Results: Topology: Without any manual user pairing intervention, the network automatically forms a clean star topology within seconds: the code reader acts as the central node, with the headlights, taillights, and remote control as three peripheral nodes directly connected to the code reader. Results: The "connection chaos" problem was resolved, verifying that the method can achieve automatic optimization and clear management of the network topology. All peripheral devices maintain only one connection to the code reader, significantly reducing resource consumption.

[0062] Based on the above embodiments, as a preferred implementation, the priority is uniquely determined by the type of the wireless communication device, and different types of wireless communication devices have different preset priority values.

[0063] This embodiment is a preferred implementation of the multi-terminal interconnection method, applied to heterogeneous Bluetooth wireless communication device systems in outdoor sports scenarios such as cycling and running, as well as in smart homes and in-vehicle electronics. The system includes various types of wireless communication devices such as smart bike computers, mobile apps, smartwatches, headlights, taillights, motion sensors, and remote controls. The priority of each wireless communication device is uniquely determined by its device type. Different device types are configured with different preset priority values. The priority value is positively correlated with the device's computing resources, connection limit, and functional coreness. The richer the resources and the more core the function in the scenario, the higher the configured priority value of the device type. The priorities of all device types form a total order relationship.

[0064] Based on the above embodiments, as a preferred implementation, the device discovery process includes wireless broadcasting and wireless scanning; wherein, the wireless communication device in the peripheral device state stops performing wireless scanning and continues to perform wireless broadcasting for discovery by the wireless communication device in the central device state.

[0065] Among them, wireless broadcasting is the behavior of a device actively sending out Bluetooth signals containing core information such as its own device type, preset priority, current role status, and MAC address to publicly identify itself. For example, in a cycling scenario, bike lights and heart rate monitors broadcast to allow nearby cycling computers and watches to recognize their presence. Wireless scanning is the proactive detection behavior of a device actively probing for surrounding Bluetooth broadcast signals and parsing and extracting core information of other devices. It is a key action for a device to discover nearby connectable devices. For example, a cycling computer discovers nearby bike lights and remote controls by scanning.

[0066] Specifically, this embodiment, based on a star topology network with multi-terminal interconnection, implements refined and role-based control over the device discovery process for devices with different roles. It clarifies the dual-core operation attributes of the device discovery process and strictly limits wireless communication devices in the peripheral device state to immediately stop performing wireless scanning operations after completing the role switch. They only maintain wireless broadcasts at the minimum necessary frequency matching their own device type. These broadcasts are only used to allow wireless communication devices in the central device state to perceive their online status and confirm the validity of the connection through continuous scanning. The central device, on the other hand, always maintains continuous wireless scanning and achieves connection management and status monitoring of all peripheral devices in the network by parsing the broadcast signals of the peripheral devices. Existing technologies lack unified role-based control rules for the device discovery process. Even when peripheral devices are connected to the network, they indiscriminately perform wireless broadcasting and scanning. This places an additional hardware processing burden on resource-constrained peripheral devices such as headlights and sensors, resulting in unnecessary power consumption and significantly shortened battery life. Furthermore, the indiscriminate scanning by peripheral devices easily leads to invalid connection attempts with other devices, causing the star topology network to revert to a chaotic mesh connection state. Simultaneously, the central device cannot accurately perceive the status of peripheral devices through standardized broadcast signals, resulting in difficulties in network topology management and poor connection stability. This embodiment fundamentally solves the problems of peripheral devices in existing technologies by deconstructing the device discovery process and implementing role-based control. This solution addresses technical issues such as mismatched behavior and roles, significant waste of resources and power consumption, and network topology chaos and management difficulties caused by blind scanning. It achieves dual optimization of peripheral device hardware resources and power consumption, significantly extending the battery life of peripheral devices with limited battery capacity in cycling and outdoor scenarios. It also eliminates invalid connection attempts between peripheral devices, ensuring the structural stability of the star topology network. At the same time, it allows the central device to accurately and in real-time perceive the status of peripheral devices through standardized broadcast signals, achieving efficient and accurate management of the entire network. This improves the stability and manageability of the entire multi-terminal interconnected network. Furthermore, the control strategy is hard-bound to the device role status, requiring no manual intervention, further enhancing the user experience in scenarios such as sports and home use.

[0067] Based on the above embodiments, as a preferred implementation, a high-priority device is also included: When a first wireless communication device in the central device state discovers a third wireless communication device through the device discovery process, and the third wireless communication device has a higher priority than the first wireless communication device, the first wireless communication device waits for the third wireless communication device to initiate a connection.

[0068] After the first wireless communication device successfully connects with the third wireless communication device, the first wireless communication device synchronizes the currently maintained network information to the third wireless communication device and switches from the central device state to the peripheral device state.

[0069] The third wireless communication device switches from the peripheral device state or the independent state to the central device state, and based on the network information, actively initiates connections to other wireless communication devices in the peripheral device state recorded in the network information, so as to take over the star topology network.

[0070] Network information synchronization refers to the process by which the central device transmits complete topology data, including the maintained network connection list, device types, priorities, and MAC addresses, to the new central device before role switching. This is crucial for ensuring network takeover consistency. Star topology network takeover refers to the operation where a higher-priority device replaces the original central device, becoming the new network hub and re-establishing connections with all peripheral devices, achieving a seamless transfer of network control.

[0071] Specifically, in the dynamic star topology networking mechanism, a set of priority-based adaptive network reconstruction rules is established. When the first wireless communication device in the central device state identifies a third wireless communication device with a higher priority through the device discovery process, the first wireless communication device actively relinquishes its dominance, stops actively probing, and waits for the higher-priority device to initiate a connection. After the connection is established, the first wireless communication device immediately synchronizes the currently maintained complete network topology information to the third wireless communication device, and then automatically switches from the central device state to the peripheral device state. At the same time, regardless of whether the third wireless communication device is currently in an independent state or a peripheral device state, it immediately switches to the central device state and, based on the received network information, actively initiates connections to all the peripheral devices recorded in the list one by one, thereby completely taking over all the peripheral nodes of the original star topology network and forming a stable new network with the higher-priority device as the core. In existing technologies, multi-terminal interconnected systems lack a dynamic priority adaptive reconfiguration mechanism. Once a higher-performance or higher-priority device enters the network, the existing central device cannot automatically identify and give way, resulting in the inability of high-priority devices to join and the inability to improve the overall network performance. Alternatively, forced connections may cause network structure conflicts and connection interruptions, leading to the paralysis of the entire system. At the same time, there is a lack of standardized information synchronization mechanisms when the network center is replaced, and the new center cannot quickly grasp the overall network topology, resulting in chaotic status of peripheral devices and interruption of data communication, which seriously affects the user experience. This embodiment fundamentally solves the technical problems of network center solidification, ineffective integration of high-priority devices, and system instability caused by asynchronous topology information during network reconstruction in existing technologies by introducing a topology reconstruction process that incorporates high-priority devices. It achieves dynamic optimization and adaptive upgrading of the network center, ensuring that the network is always centered on the optimal device in the current environment, significantly improving the performance ceiling and compatibility of multi-terminal interconnected systems. At the same time, the standardized network information synchronization and takeover process ensures seamless connection of network connections during center switching, avoiding data communication interruptions and peripheral device status confusion, significantly improving the stability, reliability, and intelligence level of the network. In cycling scenarios, when a user enters a network built by a cycling computer with a mobile app, the network automatically upgrades to be led by the mobile app, achieving more accurate data parsing and richer interactive functions. The entire process requires no manual intervention from the user, greatly improving the user experience.

[0072] In practice, when high-priority devices dynamically join and switch networks, the initial network is centered on the smartwatch (priority 8), connecting the smart headlight (priority 5) and the remote control (priority 1).

[0073] New device added: Smart code meter (priority 10) starts up upon power-on.

[0074] Implementation Process: 1. Discovery and Connection: The watch (current central device) scans the code reader's broadcast. Due to the code reader's higher priority, the watch waits to be connected by the code reader. 2. Information Synchronization: The watch synchronizes the current network topology (headlight, remote control information) to the code reader. 3. Central Device Migration: Based on its highest priority, the code reader automatically triggers the takeover process: actively connecting to the original peripheral devices (headlight, remote control). Upon successful connection to each device, the watch is instructed to disconnect from its old connection with the corresponding device. 4. Role Conversion: After all peripheral devices have migrated, the code reader becomes the new central device, and the watch becomes a peripheral device.

[0075] Implementation Results: Switching Time: Average time for a complete switchover is less than 3 seconds. Service Interruption: Connection interruption time for a single peripheral device is less than 1.5 seconds, with automatic recovery. Success Rate: 99.5% success rate in 200 tests. Topology Preservation: Star topology is maintained throughout the entire process, with no connection chaos.

[0076] In practice, when low-priority devices dynamically join the existing network, the initial network is centered on the smart code meter (priority 10) and connected to the smart headlight (priority 5).

[0077] New device added: Another independently operating smartwatch (priority 8) is powered on and connected to the remote control (priority 1), forming a small independent network (the watch is the temporary center).

[0078] Implementation Process: 1. Discovery and Evaluation: Both the code meter (existing network center) and the watch (other network center) are performing periodic scans. The code meter scans the watch's broadcast and identifies its priority (8) as lower than its own (10); the watch also scans the code meter and identifies the code meter as having a higher priority. 2. Connection Establishment: According to the rules, the low-priority independent center device (watch) waits to be connected. The code meter (high-priority center) actively initiates a connection to the watch and successfully establishes it. The watch's role in the network changes to that of the code meter's peripheral device. 3. Information Synchronization and Network Merging: After the connection is established, the watch synchronizes the network information it maintains (its peripheral device: remote control) to the code meter. 4. Subnet Consumption and Reconstruction: After learning of the existence of the remote control, the code meter actively initiates a connection to it. After the connection is successful, the code meter instructs the watch to disconnect from the original connection with the heart rate sensor. After the remote control (without scanning capability) disconnects, it immediately starts broadcasting and is subsequently successfully connected by the code meter, eventually merging into the main network and becoming the code meter's peripheral device.

[0079] Implementation Results: Access Time: From the time the watch is discovered by the code reader to the remote control finally integrating into the main network, the average time is less than 2 seconds. Success Rate: In 150 tests, the success rate of low-priority devices and their subnet devices being integrated into the main network was 99.7%. Topology Management: The entire process is led by the existing central device (code reader), automatically and orderly merging multiple small networks into a unified star network without topology conflicts or role confusion.

[0080] Based on the above embodiments, as a preferred implementation, it also includes offline processing by the central device: When a wireless communication device in peripheral device state detects a disconnection from a currently connected wireless communication device in central device state, the peripheral device reverts to an independent state and re-executes the device discovery process. Connection disconnection detection is an operation where the peripheral device monitors the connection validity with the central device in real time through methods such as Bluetooth communication link signal strength and heartbeat packet feedback; it is a core means of sensing network anomalies. Re-executing the device discovery process involves the device resuming periodic wireless broadcasting and scanning operations after reverting from peripheral device state, thus re-participating in network networking.

[0081] Specifically, in the dynamic star topology networking mechanism of multi-terminal interconnection, a network fault self-healing rule is established after the central device goes offline. Each wireless communication device in the peripheral device state continuously monitors its Bluetooth connection with the central device in real time. When a disconnection with the current central device is detected through heartbeat timeout, link signal interruption, or other means, a role state switch is immediately triggered, reverting from the peripheral device state to the independent state. At the same time, the previously suspended wireless scanning function is restored, and the device discovery process is re-executed in conjunction with wireless broadcast. All devices that have reverted to the independent state will re-discover each other, compare priorities, and make connection decisions according to preset priority rules, automatically electing the device with the highest priority in the current network as the new central device, and quickly reconstructing the star topology network. Existing technologies lack an effective fault handling mechanism after the central device goes offline. When the central device fails, all peripheral devices will fall into a disconnected state due to the loss of the communication hub and will be unable to reconstruct the network autonomously, causing the entire multi-terminal interconnection system to paralyze. Furthermore, there are no unified rules for reverting and reconstructing the network. Even if some devices attempt to reconnect, a chaotic mesh topology is easily formed. At the same time, users need to manually re-pair all devices, which is cumbersome and provides a poor user experience. This embodiment fundamentally solves the technical problems of network paralysis caused by single-point failure of the central device, lack of self-healing ability, and chaotic topology caused by irregular reconfiguration of the network by setting up a dedicated processing procedure after the central device goes offline. It realizes fault self-sensing, self-rollback, and self-reconstruction of the star topology network, which greatly improves the robustness and reliability of multi-terminal interconnection systems. In practical application scenarios such as cycling and smart homes, when the smart bike meter, which is the center, suddenly loses power, peripheral devices such as headlights and taillights can quickly detect the disconnection and automatically roll back and reconstruct the network. The network is rebuilt with the headlight as the new center, ensuring that basic communication between devices is not affected. No manual intervention from the user is required, which not only avoids functional failure caused by system paralysis, but also simplifies user operation and improves the user experience. At the same time, all devices roll back and re-network according to unified rules, ensuring that an orderly star topology can still be formed after the network is reconstructed, preventing the regeneration of mesh connections, and maintaining the clarity and manageability of the network structure.

[0082] In the network of Example 1, the codebook (central device) suddenly shuts down due to depletion of power.

[0083] Implementation Process: 1. The headlights, taillights, and remote control simultaneously detect a disconnection from the speedometer's Bluetooth connection. 2. These three devices immediately revert from "peripheral device" status to "independent device" status according to the rules, and restart scanning (except for the remote control) and broadcasting. 3. The headlights (priority 5) detect the taillights (priority 3) and remote control (priority 1) during scanning. According to the priority rules, the headlights, as the highest priority device, actively connect to the taillights and remote control. 4. After successful connection, the headlights become the new "central device," and the taillights and remote control revert to being its "peripheral devices."

[0084] Final Network Topology and Results: Topology: Within 3 seconds of the central device failure, the network completed self-healing centered on the leading light, rebuilding a star topology. Results: This demonstrates the system's high robustness and self-healing capability. It avoids the overall paralysis caused by single-point failures in traditional centralized networks, significantly improving system reliability.

[0085] Based on the above embodiments, as a preferred implementation, topology state synchronization is also included: The wireless communication device in the central device state maintains a list of connections across the entire network, and generates a topology update message carrying an incrementing version number when a wireless communication device connection or disconnection event occurs in the star topology network.

[0086] The wireless communication device in the central device state will forcibly push the topology update message to all currently online wireless communication devices in the peripheral device state.

[0087] The network-wide connection list is a core data list maintained by the wireless communication device in the central device state for network management. In scenarios such as cycling and smart homes, the list records key information such as the type of all peripheral devices accessing the network, preset priority, MAC address, and current connection status. It is the foundation for the central device to understand the entire network topology. Star topology network connection / disconnection events refer to various network status changes in a star topology, such as the successful access of a new low-priority device to the network, or the disconnection of existing peripheral devices from the central device due to reasons such as active offlineing, signal interruption, or central device switching. Examples include disconnection events caused by the user turning off the taillight in a cycling scenario, and new connections from heart rate monitors. The topology update message is a standardized data message generated by the central device when the network status changes. It encapsulates the updated network connection list and core topology-related information, serving as the carrier for synchronizing the status of peripheral devices. The incrementing version number is a unique identifier configured for the topology update message. Each time a new message is generated due to a network status change, the version number increments according to a preset rule, allowing peripheral devices to quickly identify the latest topology information, avoid receiving outdated data, and ensure the accuracy of status synchronization. Forced push is a transmission method in which the central device actively sends the topology update message to all online peripheral devices using broadcast or unicast. This method does not require peripheral devices to actively request it, ensuring the timeliness of topology information synchronization.

[0088] In this embodiment, in the dynamic star topology networking mechanism with multi-terminal interconnection, a strong consistency topology state synchronization rule is established with the central device as the information source. The wireless communication devices in the central device state continuously maintain and update the entire network connection list in real time, accurately recording the access and disconnection status of each peripheral device. When any wireless communication device in the star topology network experiences a connection or disconnection event, the central device immediately generates a topology update message based on the updated entire network connection list and configures a unique incremental version number for the message. Then, the message is sent to all currently online peripheral devices through forced push, so that all peripheral devices can obtain the latest topology information of the entire network in a timely manner, ensuring that all devices in the entire network maintain a high degree of consistency in their understanding of the network structure. The lack of a unified topology status synchronization mechanism in existing technologies makes it easy for each device to have a different understanding of the network topology when network devices are connected, disconnected, or when the central device is switched, forming "information islands" and even causing connection deadlocks and data communication conflicts. Furthermore, the lack of a standardized carrier for transmitting topology information and version identifiers means that peripheral devices can easily receive and perform operations based on outdated topology information, further exacerbating the chaos in the network status. At the same time, the traditional passive request-based information synchronization method also results in untimely updates of topology information, which seriously affects the stability and manageability of the network. This embodiment fundamentally solves the technical problems of unreliable topology state synchronization, inconsistent network perception among devices, and untimely updates of topology information leading to outdated data in existing technologies by establishing a topology state synchronization mechanism led by a central device. It achieves strong consistency synchronization of the star topology network state, ensuring that all devices maintain a unified understanding of the network structure, effectively avoiding connection conflicts and data communication anomalies caused by information discrepancies. In applications such as cycling and smart homes, when a new sensor connects to the network led by the bike meter, or when the headlight unexpectedly disconnects, the bike meter can immediately generate a topology update message with an incrementing version number and forcefully push it to all peripheral devices. This allows devices such as taillights and remote controls to be aware of network changes in a timely manner, ensuring that subsequent data forwarding and command transmission are based on the latest topology, significantly improving the reliability of network communication. Simultaneously, the standardized topology update message and incrementing version number allow peripheral devices to quickly identify and update topology information, and the forced push method ensures timely synchronization without manual user intervention. This enhances the intelligence and robustness of the multi-device interconnection system and optimizes the user experience in actual use.

[0089] Based on the above embodiments, as a preferred implementation, it further includes at least one of power consumption management, special device processing, and same-priority conflict processing; The power consumption management includes: a wireless communication device in the central device state enters a low-frequency device discovery mode after confirming that it has connected to all discoverable wireless communication devices; a wireless communication device in the independent state extends the execution interval of the device discovery process if it does not discover a higher-priority wireless communication device and is not connected to any wireless communication device within a preset time.

[0090] Specifically, this embodiment configures differentiated Bluetooth duty cycles for wireless communication devices with different roles and states to achieve "on-demand discovery and energy saving priority." Specifically, after the central device completes access to all discoverable low-priority devices in the surrounding area and establishes a stable star topology, to reduce the high power consumption caused by long-term continuous scanning, the central device automatically switches to a low-frequency device discovery mode, maintaining online status monitoring of existing peripheral devices only through low-frequency scanning. For devices that have not found higher-priority devices or been connected for a long time (such as a preset 5 minutes) and are in an independent state, the interval between their broadcast and scanning execution is extended, entering a deep power-saving standby mode to avoid unnecessary power consumption due to frequent network probing. In existing technologies, multi-terminal interconnected devices typically use a fixed high-frequency discovery cycle, regardless of whether the network is complete or in an idle state. This causes the central device to run out of power too quickly due to continuous high-load scanning, and low-power devices in an independent state also have significantly shortened battery life due to meaningless high-frequency network probing, severely limiting the application of devices in battery-powered scenarios such as cycling and smart homes. This embodiment fundamentally solves the technical problems of indistinguishable power consumption between peripheral and central devices and insufficient battery life caused by high-power standby in existing technologies by introducing a dynamic power consumption adjustment mechanism based on roles and states. It achieves fine-grained control over the overall power consumption of the multi-terminal interconnected system. In cycling scenarios, it allows the smart bike meter, which acts as the center, to enter low-frequency scanning after networking, significantly extending its battery life. At the same time, it allows peripheral devices with independent states, such as heart rate monitors and lights, to reduce their detection frequency when in standby, greatly increasing their usage time per charge and effectively ensuring the continuous availability of the system in various mobile and outdoor scenarios.

[0091] The special device processing includes: the system also includes a special wireless communication device defined as a purely passive peripheral device. The special wireless communication device has a preset minimum priority and never has the ability to actively perform the device discovery process. It can only passively accept connections.

[0092] Specifically, this embodiment provides standardized access channels and role definitions for special peripherals lacking active networking capabilities in a dynamic star topology system. A predefined class of purely passive peripheral devices (such as a simple remote control in a cycling scenario) is assigned the lowest system priority, and their active scanning and connection capabilities are restricted at the hardware and protocol levels, allowing them to exist only in broadcast form. When such devices enter the networking area, any higher-priority conventional central device can actively connect and incorporate them into its own star topology network as a peripheral device by scanning their broadcast signals. Existing technologies, when constructing multi-terminal interconnected systems, typically assume that all devices possess complete active discovery and connection capabilities. This results in special peripherals lacking active scanning capabilities being unable to automatically access the network, forcing users to go through complex manual pairing processes, severely reducing the system's automation level and user experience. Furthermore, if such devices forcibly participate in priority competition, their insufficient capabilities can lead to network instability. This embodiment, by clearly defining the roles, permissions, and lowest priority of purely passive peripheral devices, fundamentally solves the technical problems of special peripherals being unable to automatically integrate into dynamic star topology networks and poor system compatibility, achieving standardized compatibility and automated access for special peripherals without requiring manual user intervention. In smart home or sports scenarios, this enables simple remote controls that can only passively send control commands to be automatically recognized and connected by central devices such as speedometers and mobile phones, becoming a member of the network. This greatly expands the system's device ecosystem compatibility and improves the overall practicality and user-friendliness of the solution.

[0093] The same priority conflict handling includes: when two wireless communication devices with the same priority need to exist in the same star network at the same time, the removal and addition of wireless communication devices are performed through the human-machine interface of the wireless communication device currently in the central device state, and the wireless communication device in the central device state coordinates the update and synchronization of the entire network topology.

[0094] Specifically, this embodiment provides a set of manual intervention fallback rules for the dynamic star topology networking mechanism to address special scenarios where priority cannot be automatically determined. When two wireless communication devices with the same priority (such as two smart code meters of the same model) need to join the same network simultaneously, the system's automatic election mechanism fails. In this case, the current network center device presents options through its human-machine interface, allowing the user to manually perform a "remove" or "add" operation, specifying that one device should be retained as the network center or periphery, while the other device is handled according to the rules. Based on the user's final selection, the center device updates the entire network connection list and generates a new topology update message, which is then forcibly pushed to all peripheral devices, completing the re-coordination of the network topology. In existing technologies, multi-terminal interconnection systems lack effective manual intervention methods when encountering competition between devices with the same priority. This often leads to network election failures, repeated connection attempts between devices resulting in a deadlock, or the random selection of a center, making it impossible to satisfy the user's intentions, severely damaging the stability and controllability of the network. This solution fundamentally addresses the technical problems of network election failure, connection conflicts, and system instability caused by competition between devices of the same priority in existing technologies by introducing a manual conflict resolution mechanism based on human-computer interaction with a central device. It provides a reliable conflict resolution solution for scenarios with a limited number of high-priority devices, ensuring that the network can still be constructed in an orderly and controllable manner under special circumstances. In scenarios with clear requirements for device roles, such as professional cycling or industrial control, users can precisely control the network composition through the central device's interface, avoiding network instability caused by similar device performance, and significantly improving the fault tolerance, controllability, and application flexibility of multi-terminal interconnected systems.

[0095] Secondly, embodiments of the present invention provide a multi-terminal interconnection system, including multiple wireless communication devices, such as... Figure 2 As shown, each of the wireless communication devices is equipped with a priority configuration module 110, a role status module 120, a device discovery module 130, a connection decision module 140, and a data communication module 150.

[0096] The priority configuration module 110 is used to configure the priority of the wireless communication device.

[0097] The role state module 120 is used to initialize and maintain the role state machine of the wireless communication device, and can switch between different role state machines according to the trigger command; the role state machine includes at least an independent state, a central device state, and a peripheral device state.

[0098] The device discovery module 130 is used to perform the device discovery process and realize mutual discovery with other wireless communication devices.

[0099] The connection decision module 140 is used for: When the first wireless communication device to which the connection decision module 140 belongs is in an independent state, and the device discovery module 130 of the first wireless communication device discovers the second wireless communication device, the priorities of the first wireless communication device and the second wireless communication device are compared.

[0100] If the first wireless communication device has a higher priority than the second wireless communication device, then the first wireless communication device is controlled to actively initiate a connection to the second wireless communication device.

[0101] After the connection is established, an instruction to switch to the central device state is sent to the role status module 120 of the first wireless communication device, and an assignment instruction to enter the peripheral device state is sent to the role status module 120 of the second wireless communication device.

[0102] When the first wireless communication device is in the central device state, the first wireless communication device is controlled to continuously perform the device discovery process through the device discovery module 130, discover and connect all other wireless communication devices with lower priority than the first wireless communication device that are in an independent state or a peripheral device state, and construct a star topology network centered on the first wireless communication device.

[0103] The data communication module 150 is used for: The wireless communication device in the peripheral device state communicates only with the connected wireless communication device in the central device state.

[0104] Data interaction between any two wireless communication devices in peripheral device state is forwarded by the data communication module 150 of the wireless communication device in central device state, which is connected to the two wireless communication devices in peripheral device state.

[0105] The assignment instruction to enter the peripheral device state is used to trigger the role state module 120 of the assigned wireless communication device to switch to the peripheral device state, and to trigger the device discovery module 130 of the assigned wireless communication device to stop executing the active device discovery process.

[0106] Based on the same concept, this invention also provides a schematic diagram of a physical structure, such as... Figure 3 As shown, the server may include a processor 310, a communications interface 320, a memory 330, and a communication bus 340, wherein the processor 310, the communications interface 320, and the memory 330 communicate with each other via the communication bus 340. The processor 310 can call logical instructions in the memory 330 to execute the steps of the multi-terminal interconnection method as described in the above embodiments.

[0107] Furthermore, the logical instructions in the aforementioned memory 330 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a 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 computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0108] Based on the same concept, embodiments of the present invention also provide a non-transitory computer-readable storage medium storing a computer program containing at least one piece of code that can be executed by a master control device to control the master control device to implement the steps of the multi-terminal interconnection method as described in the above embodiments.

[0109] Based on the same technical concept, this application also provides a computer program, which, when executed by a main control device, is used to implement the above-described method embodiments.

[0110] The program may be stored, in whole or in part, on a storage medium packaged with the processor, or in part or in whole on a memory not packaged with the processor.

[0111] Based on the same technical concept, this application also provides a processor for implementing the above-described method embodiments. The processor can be a chip.

[0112] The various embodiments of the present invention can be combined arbitrarily to achieve different technical effects.

[0113] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A multi-terminal interconnection method, applied to a system including multiple wireless communication devices, characterized in that, The method includes: Configure the priority of each wireless communication device and initialize a role state machine for each wireless communication device; the role state machine includes at least an independent state, a central device state, and a peripheral device state; When the first wireless communication device is in an independent state and discovers the second wireless communication device through the device discovery process, the first wireless communication device compares the priorities of the first wireless communication device and the second wireless communication device. If the first wireless communication device has a higher priority than the second wireless communication device, then the first wireless communication device will actively initiate a connection to the second wireless communication device. After the connection is established, the first wireless communication device switches from the independent state to the central device state and assigns the second wireless communication device to the peripheral device state; the wireless communication device in the peripheral device state stops the active device discovery process. The first wireless communication device in the central device state continuously performs the device discovery process, discovers and connects all other wireless communication devices with lower priority than the first wireless communication device that are in an independent state or a peripheral device state, and constructs a star topology network centered on the first wireless communication device. A wireless communication device in peripheral device state communicates only with a connected wireless communication device in central device state. Data interaction between any two wireless communication devices in peripheral device state is forwarded by the wireless communication device in central device state connected to the two wireless communication devices in peripheral device state.

2. The multi-terminal interconnection method according to claim 1, characterized in that, The priority is uniquely determined by the type of the wireless communication device, and different types of wireless communication devices have different preset priority values.

3. The multi-terminal interconnection method according to claim 2, characterized in that, The device discovery process includes wireless broadcasting and wireless scanning; wherein, wireless communication devices in peripheral device state stop performing wireless scanning and continue performing wireless broadcasting for discovery by wireless communication devices in central device state.

4. The multi-terminal interconnection method according to claim 1, characterized in that, This also includes the addition of high-priority devices: When the first wireless communication device in the central device state discovers the third wireless communication device through the device discovery process, and the priority of the third wireless communication device is higher than that of the first wireless communication device, the first wireless communication device waits for the third wireless communication device to initiate a connection. After the first wireless communication device successfully connects with the third wireless communication device, the first wireless communication device synchronizes the currently maintained network information to the third wireless communication device and switches from the central device state to the peripheral device state. The third wireless communication device switches from the peripheral device state or the independent state to the central device state, and based on the network information, actively initiates connections to other wireless communication devices in the peripheral device state recorded in the network information, so as to take over the star topology network.

5. The multi-terminal interconnection method according to claim 1, characterized in that, This also includes offline processing by central equipment: When a wireless communication device in peripheral device state detects that the connection with the currently connected wireless communication device in central device state has been lost, the wireless communication device in peripheral device state reverts from peripheral device state to independent state and re-executes the device discovery process.

6. The multi-terminal interconnection method according to claim 4 or 5, characterized in that, It also includes topology state synchronization: The wireless communication device in the central device state maintains a list of connections across the entire network, and generates a topology update message carrying an incrementing version number when a wireless communication device connection or disconnection event occurs in the star topology network. The wireless communication device in the central device state will forcibly push the topology update message to all currently online wireless communication devices in the peripheral device state.

7. The multi-terminal interconnection method according to claim 1, characterized in that, It also includes at least one of power management, special device handling, and same-priority conflict handling; The power management includes: a wireless communication device in the central device state enters a low-frequency device discovery mode after confirming that it has connected to all discoverable wireless communication devices; a wireless communication device in the independent state extends the execution interval of the device discovery process if it fails to discover a higher-priority wireless communication device and is not connected to any wireless communication device within a preset time. The special device processing includes: the system also includes a type of special wireless communication device defined as a purely passive peripheral device. The special wireless communication device has a preset minimum priority and never has the ability to actively perform the device discovery process. It can only passively accept connections. The same priority conflict handling includes: when two wireless communication devices with the same priority need to exist in the same star network at the same time, the removal and addition of wireless communication devices are performed through the human-machine interface of the wireless communication device currently in the central device state, and the wireless communication device in the central device state coordinates the update and synchronization of the entire network topology.

8. A multi-terminal interconnection system, characterized in that, It includes multiple wireless communication devices, each of which is equipped with a priority configuration module, a role status module, a device discovery module, a connection decision module, and a data communication module; The priority configuration module is used to configure the priority of the wireless communication device; The role state module is used to initialize and maintain the role state machine of the wireless communication device, and can switch between different role state machines according to the trigger command; the role state machine includes at least an independent state, a central device state, and a peripheral device state; The device discovery module is used to perform the device discovery process and realize mutual discovery with other wireless communication devices; The connection decision module is used for: When the first wireless communication device to which the connection decision module belongs is in an independent state, and the device discovery module of the first wireless communication device discovers the second wireless communication device, the priorities of the first wireless communication device and the second wireless communication device are compared. If the first wireless communication device has a higher priority than the second wireless communication device, then the first wireless communication device is controlled to actively initiate a connection to the second wireless communication device; After the connection is established, a command to switch to the central device state is sent to the role status module of the first wireless communication device, and an assignment command to enter the peripheral device state is sent to the role status module of the second wireless communication device. When the first wireless communication device is in the central device state, the first wireless communication device is controlled to continuously perform the device discovery process through the device discovery module to discover and connect all other wireless communication devices with lower priority than the first wireless communication device that are in an independent state or a peripheral device state, and to build a star topology network centered on the first wireless communication device. The data communication module is used for: The wireless communication device in the peripheral device state communicates only with the connected wireless communication device in the central device state. Data interaction between any two wireless communication devices in peripheral device state is forwarded by the data communication module of the wireless communication device in central device state, which is connected to the two wireless communication devices in peripheral device state. The assignment instruction to enter the peripheral device state is used to trigger the role state module of the assigned wireless communication device to switch to the peripheral device state, and to trigger the device discovery module of the assigned wireless communication device to stop executing the active device discovery process.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the multi-terminal interconnection method as described in any one of claims 1 to 7.

10. A non-transitory computer-readable storage 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 multi-terminal interconnection method as described in any one of claims 1 to 7.