A dual-master wireless synchronous control system and method for an electric bed based on Bluetooth communication

CN122923682APending Publication Date: 2026-10-16KEESON TECH CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610997534.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-06
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0006]针对现有技术中的缺陷,本发明的目的在于提供一种基于蓝牙通信的电动床双主控无线同步控制方法及系统,以解决现有电动床控制方案中存在的有线布线繁琐、2.4G私有协议兼容性差、蓝牙同步配对机制不灵活、多设备协同稳定性不足,以及多业务并行时相互干扰的技术问题

Benefits of technology

1. 采用单BLE SoC芯片通过时分调度机制动态切换主/从角色,支持三路独立蓝牙逻辑链路并发工作,相较于传统双芯片方案大幅降低了成本、功耗和PCB面积。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122923682A_ABST
    Figure CN122923682A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of electric bed control, in particular to a kind of electric bed double master wireless synchronous control method and system based on bluetooth communication.The application includes first electric bed master controller and second electric bed master controller;Wherein, each master controller uses single BLE SoC chip, the single BLE SoC chip is dynamically switched bluetooth master / slave role through connection event timing staggered scheduling mechanism at bluetooth protocol stack level, to maintain the following three independent bluetooth logical links on the same radio frequency hardware simultaneously: remote control GATT control link between pairing remote control;APP GATT control link between mobile phone application APP;Master-master synchronization link between peer master controller.Using single BLE SoC chip, dynamically switch master / slave role through time-division scheduling mechanism, support three independent bluetooth logical links concurrent work, compared with traditional double-chip scheme, cost, power consumption and PCB area are greatly reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electric bed control technology, specifically to a method and system for dual-master wireless synchronous control of an electric bed based on Bluetooth communication. More particularly, it relates to a method and system for dual-bed wireless synchronous control based on the Bluetooth Low Energy (BLE) communication protocol, using a single BLE SoC chip to achieve dynamic multiplexing of master and slave roles, and in conjunction with a manufacturer-defined broadcast protocol. Background Technology

[0002] With the rapid development of IoT and smart home technologies, electric beds, as core equipment in the fields of home-based health and wellness and smart sleep, are increasingly valued by the market for their advantages such as adjustable posture and intelligent adaptation. Users have continuously increased their requirements for the ease of operation, communication stability, multi-device collaboration, and intelligent functions of electric bed control systems, and traditional mechanical and wired bed control solutions can no longer meet the needs of modern intelligent use.

[0003] Currently, most mainstream electric bed control systems on the market adopt wired connections, 2.4G proprietary protocols, or a single Bluetooth point-to-point control mode. Among them, wired control solutions are cumbersome in terms of wiring, have high installation costs, poor equipment mobility, and the lines are prone to aging and damage, posing safety hazards. The 2.4G proprietary protocol and Bluetooth control solutions only support one-to-one pairing control between the remote control and a single main controller, with limited functionality, only enabling independent posture adjustment of a single bed.

[0004] For dual-bed linkage scenarios, several wireless synchronization solutions have emerged in the existing technology. Among them, prior art 1 (CN114120609B) discloses a wireless synchronization control system for an electric bed, which uses a remote controller as a data routing relay node to achieve linkage control of two beds. However, this solution has the following significant drawbacks: 1) It relies on a single node, resulting in communication delays. The remote controller, as the sole data relay station, is responsible for receiving instructions from one master controller and forwarding them to the other. This chain structure of "master controller-remote controller-master controller" introduces additional data processing and forwarding time, especially when switching control, with a fixed delay of approximately 0.5 seconds, leading to delayed operation response and a poor user experience. 2) Single-controller access is limited. At any given time, only one remote controller is allowed to initiate synchronization operations, while other remote controllers are in a waiting state, failing to meet the need for independent, parallel control by two people. 3) It lacks autonomous networking capabilities. The master controller itself does not have the ability to autonomously discover and establish synchronization links. The entire synchronization process is highly dependent on the remote controller; once the remote controller loses connection or malfunctions, dual-bed synchronization fails.

[0005] To overcome some of the aforementioned shortcomings, existing technologies have proposed an improved approach of using Bluetooth technology for direct communication between devices. For example, prior art 2 (CN112399394A) discloses a smart energy meter system based on Bluetooth communication, which mentions using a Bluetooth module or SOC (System-on-a-Chip) to achieve communication between the energy meter and a smart miniature circuit breaker and a terminal module. Although prior art 2 mentions the SOC method, namely "the energy meter integrates its own Bluetooth protocol stack," and that the energy meter can connect to multiple slave devices when acting as a master and accept connection requests from terminal modules when acting as a slave, this technical solution is fundamentally different from this application. Although prior art 2 discloses that a single Bluetooth SOC can play both master and slave roles, its role allocation is static, serving different levels of communication objects. It does not disclose or reveal the core technical problem that this application aims to solve: "how to achieve low-latency, high-stability real-time synchronization between two equivalent electric bed master controllers without a relay node, while simultaneously being compatible with parallel control by a remote control and a mobile APP." The existing technical solution 2 differs significantly from the dual-bed synchronous scenario of electric beds in terms of system topology, communication mode, and business logic. Summary of the Invention

[0006] To address the shortcomings of existing technologies, the present invention aims to provide a dual-master wireless synchronous control method and system for electric beds based on Bluetooth communication, in order to solve the technical problems existing in the current electric bed control schemes, such as cumbersome wired wiring, poor compatibility with 2.4G proprietary protocols, inflexible Bluetooth synchronization pairing mechanism, insufficient stability of multi-device collaboration, and mutual interference when multiple services are running in parallel.

[0007] To achieve the above objectives, this invention provides a Bluetooth-based dual-master wireless synchronous control system for electric beds, comprising a first electric bed master controller and a second electric bed master controller. Each master controller employs a single BLE SoC chip. The link layer of the BLE SoC chip is configured to allocate different connection intervals and start time offsets to multiple Bluetooth logical links, thereby staggering the data transmission and reception timing of each link. This allows for dynamic switching of Bluetooth master / slave roles on the same RF hardware, while maintaining three independent Bluetooth logical links: a remote control GATT control link with the paired remote controller; an APP GATT control link with the mobile application; and a master-master synchronization link with the peer master controller. The first and second electric bed master controllers establish a direct bidirectional BLE connection via the master-master synchronization link, enabling direct and periodic exchange of bed posture and operating status data in dual-bed synchronous operation mode without the need for data relay via a remote controller or relay device.

[0008] Furthermore, the link layer implements the concurrency of the three logical links through a non-blocking event scheduling mechanism. The link layer creates an independent connection event for each logical link and activates each connection event sequentially according to the allocated start time offset to send and receive data. After the event ends, it immediately enters a sleep or ready state to wait for the next connection event.

[0009] Furthermore, each of the master controllers defines multiple layers of private fields in the vendor-defined data segment of the Bluetooth broadcast message. These private fields include at least: a fixed protocol check header, which is used by the master controller to check and filter illegal broadcast messages; a Mark service code, which is used to identify the current operating mode of the device; and an optional Target MAC address, which is used to specify the target peer master controller during the synchronization establishment phase to achieve targeted synchronization addressing.

[0010] Preferably, the Mark service code includes at least the following four values, each corresponding to one of four mutually exclusive service modes: 0x00: remote control pairing mode; 0x02: stand-alone operation mode; 0x03: synchronized operation mode; 0x05: network synchronization establishment mode.

[0011] Furthermore, the present invention also includes a multimodal sleep sensor system, comprising: a sleep sensor configured as a USB host for collecting physiological data and connecting to extended devices; a main controller configured as a USB device, connected to the sleep sensor via a USB data cable to form a USB hybrid communication channel; and a backrest display terminal connected to the main controller via BLE for UI display and voice interaction; wherein the sleep sensor sends AI decision commands to the main controller via the USB hybrid communication channel, receives bed posture data from the main controller, and communicates with a cloud server via a built-in Wi-Fi module.

[0012] Preferably, a custom HID or CDC composite device protocol is established between the main controller and the sleep sensor for bidirectional low-latency communication, including: a downlink channel, in which the sleep sensor sends AI decision commands to the main controller via USB batch transmission; and an uplink channel, in which the main controller reports device information, status information, and fault information of all local and physically connected devices and pairing remote controllers to the sleep sensor via USB interrupt transmission messages.

[0013] Furthermore, the master controller is also configured to perform multi-device time synchronization based on Bluetooth connection events, specifically including: using the master controller as a clock synchronization reference source, recording the system reference time STB at the start time of each Bluetooth broadcast event or GATT connection interval, and embedding the STB as a timestamp in the broadcast packet or notification message; after receiving a message with STB from the device, calculating the difference Δt between the local clock and the STB, and carrying the compensation value in subsequent data reporting to uniformly convert the local time to the master controller's STB time axis.

[0014] Furthermore, the master controller is configured to achieve multi-service parallel compatibility through the following mechanisms: automatic broadcast state switching, during a preset time-limited pairing window after power-on, broadcasting a pairing broadcast frame carrying a Mark service code of 0x00; after the time-limited pairing window ends, automatically switching the broadcast to a Mark service code of 0x02 or 0x03 according to the current synchronization state; mutual exclusion of APP connections, when the mobile APP establishes a GATT connection with the master controller, the master controller immediately shuts down all external Bluetooth broadcasts, maintaining the link with the remote controller and the peer master controller to continue working; synchronization isolation, during the network synchronization establishment phase, the broadcast frame does not contain the Bluetooth device name.

[0015] Furthermore, the remote controller and the main controller employ the following security control mechanisms: whitelist-based directional connection. After pairing, the remote controller and the main controller write each other's MAC addresses into their local whitelists. During routine remote controller button operations, BLE directional broadcasts are sent only based on the bound MAC addresses stored in the whitelist. One-to-one exclusive binding. When a new remote controller is successfully paired, the original remote controller binding information is automatically cleared from the main controller's local storage.

[0016] A Bluetooth-based dual-master wireless synchronous control method for an electric bed, applied to the aforementioned system, includes the following steps: S1: In response to the user-triggered synchronization network command, the first electric bed main controller and the second electric bed main controller clear their local historical synchronization binding information and switch to the network synchronization mode. S2: Both master controllers continuously scan and broadcast synchronous broadcast frames for networking with Mark service code 0x05 via Bluetooth. After capturing the broadcast frame of the other end, the MAC address of the other party is extracted to complete the identity recognition. S3: The two master controllers compare the values ​​of each other's MAC addresses and automatically negotiate to allocate the master and slave roles of the synchronization link. The one with the larger MAC address value becomes the master and the other becomes the slave. S4: The master controller, which is assigned the role of the host, actively initiates a BLE connection to establish a master-master synchronous link, so that the two beds can directly and periodically exchange bed posture data and operating status data without the need for data transfer through remote control or relay equipment in synchronous working mode.

[0017] Furthermore, the triggering method includes at least one of the following two: simultaneous triggering by dual remote controllers: after receiving the user's operation of simultaneously pressing and holding the synchronization button, the two remote controllers paired with their respective master controllers send synchronization request frames to their respective bound master controllers, thereby triggering the master controllers to perform clearing and switching steps; remote triggering by APP: after the mobile APP establishes a connection with any master controller, it sends a synchronization request frame carrying the MAC address or broadcast name of the peer master controller to that master controller, thereby triggering that master controller to perform clearing and switching steps.

[0018] Furthermore, the method also includes a multi-device time synchronization step based on Bluetooth connection events: using the master controller as the clock synchronization reference source, the system reference time STB is recorded at the start time of each Bluetooth broadcast event or GATT connection interval; the STB is embedded as a timestamp in the broadcast packet or notification message and sent to the slave device; after receiving the message with STB, the slave device calculates the difference Δt between the local clock and the STB, and carries the compensation value in subsequent data reporting to uniformly convert the local time to the master controller's STB time axis.

[0019] Furthermore, the time synchronization step also includes snoring event determination: in a snoring monitoring scenario, when the microphone of the display terminal detects a peak snoring sound, it records a local timestamp T_mic; when the millimeter-wave radar of the sleep sensor detects an abnormal breathing rhythm, it records a local timestamp T_radar. T_mic and T_radar are uniformly converted into the STB time axis of the main controller using the formula T_global = T_local + Δt. If the main controller determines that an audio abnormality and a radar abnormality occur simultaneously within a time window of ±100ms, it is determined to be a valid snoring event, and the anti-snoring mode is triggered to automatically adjust the headboard height.

[0020] Furthermore, the method also includes a multi-service parallel compatibility step: SS1 After the master controller is powered on, it enters a preset time-limited pairing window period, during which it broadcasts a pairing broadcast frame carrying a Mark service code of 0x00; SS2 After the time-limited pairing window period ends, the master controller automatically switches the broadcast mode according to the current synchronization status: if it is in a single-machine non-networked state, it broadcasts a broadcast frame with a Mark service code of 0x02; if it is in a dual-bed networked state, it broadcasts a broadcast frame with a Mark service code of 0x03; SS3 After the mobile APP establishes a GATT connection with the master controller, the master controller immediately shuts down all external Bluetooth broadcasts, maintaining only the existing link with the remote control and / or the peer master controller; SS4 During the network-to-network synchronization establishment phase, the master controller broadcasts a network-to-network synchronization broadcast frame carrying a Mark service code of 0x05, and this broadcast frame does not carry the Bluetooth device name.

[0021] Furthermore, the method also includes an automatic power-on reconnection step: when two master controllers have pre-stored synchronization binding records but fail to establish a synchronization link after power-on, each master controller automatically starts Bluetooth scanning and cyclically broadcasts synchronized master controller broadcast frames carrying Mark service code 0x03; after capturing the broadcast frame of the other end, it verifies whether the MAC address in the broadcast frame matches the locally stored synchronization binding record; if it matches, it actively initiates Bluetooth reconnection to restore the master-master synchronization link and restore the periodic bidirectional synchronization data interaction between the two beds.

[0022] Furthermore, the method also includes a one-click deletion step for the synchronization link: when the two beds are in a synchronized linkage state, the user presses and holds the synchronization button on any of the paired remote controls, and the remote control sends a directional broadcast to the corresponding master controller to establish a Bluetooth connection and sends a synchronization deletion request command frame; after receiving the synchronization deletion request, the master controller immediately and actively disconnects the master-master synchronization link with the other master controller, erases the locally stored MAC address of the peer master controller and the synchronization binding configuration information, and switches to a standalone independent operation mode.

[0023] Compared with the prior art, the present invention has the following beneficial effects: 1. A single BLE SoC chip is used to dynamically switch between master and slave roles through a time-division scheduling mechanism, supporting the concurrent operation of three independent Bluetooth logic links. Compared with the traditional dual-chip solution, this significantly reduces cost, power consumption and PCB area.

[0024] 2. A dedicated BLE direct synchronous link is established between the main controllers, completely eliminating the 0.5-second communication delay caused by remote controller role switching in the traditional 2.4G remote controller routing scheme.

[0025] 3. By using the three-layer fields of KSN checksum header, Mark service code and Target MAC address in the manufacturer's custom broadcast protocol, device identity verification, differentiation of four service modes and fixed-point synchronous addressing are achieved, and multiple services share the same set of BLE hardware resources without interfering with each other.

[0026] 4. A multimodal sensor extension system based on USB hybrid communication was introduced, providing a high-bandwidth, low-latency physical foundation for loading edge computing or cloud intelligent services, which greatly improves the system's scalability and AI compatibility.

[0027] 5. A multi-device time synchronization algorithm based on Bluetooth connection events is proposed, which ensures strict alignment of multimodal sensor data in the time dimension and provides a high-quality input dataset for AI algorithms. Attached Figure Description

[0028] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings. Figure 1 This is a block diagram illustrating the overall principle of a Bluetooth-based wireless synchronous bed control system according to an embodiment of the present invention. Figure 2 This is a block diagram of the main controller's Bluetooth broadcast message parsing and device identification logic in an embodiment of the present invention; Figure 3 This is a timing flowchart of the pairing function between the remote controller and the main controller according to an embodiment of the present invention; Figure 4 This is a flowchart illustrating the timing sequence of bed control actions according to an embodiment of the present invention. Figure 5 This is a timing diagram of the normal wireless synchronization interaction of the master controller in an embodiment of the present invention; Figure 6 This is a logic diagram illustrating the establishment and reconstruction of wireless synchronization for remote control operation in an embodiment of the present invention. Figure 7 This is a logic diagram illustrating the establishment and reconstruction of wireless synchronization for APP operation in an embodiment of the present invention. Figure 8 This is an extended architecture diagram of a multimodal sleep sensor system according to an embodiment of the present invention. Detailed Implementation

[0029] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. It should be noted that those skilled in the art can make several changes and improvements without departing from the concept of the present invention. These all fall within the protection scope of the present invention.

[0030] First, let's explain the various technical terms that appear in this application. These terms describe the physical carrier and basic architecture of the system and form the basis of the entire solution.

[0031] 1) SoC (System on Chip) integrates all the functions of an entire computer system (CPU, memory, Bluetooth RF, various interface controllers, etc.) onto a single chip. This solution emphasizes the use of a single BLE SoC, meaning that all complex control and communication functions are implemented using only one such chip, rather than using a combination of multiple chips. This is a significant cost and power consumption advantage.

[0032] 2) ID (Identifier): A "name" or "number" used to uniquely identify an object, device, or user. For example, company_id (manufacturer ID) is used to identify the manufacturer; network identity is used to uniquely distinguish a functional module in a Bluetooth network.

[0033] 3) BLE (Bluetooth Low Energy) is a smart, power-saving short-range wireless communication technology. Compared to traditional Bluetooth, it consumes extremely little power, making it ideal for devices that require battery power or long standby times, such as electric bed remote controls and sleep sensors.

[0034] 4) GATT (Generic Attribute Profile) is the set of rules for how BLE devices "talk" and "exchange data." It defines the server (the party providing data, such as the host controller) and the client (the party receiving data, such as an app). A GATT link refers to a data exchange channel established according to these rules. For example, a remote control GATT link is the channel through which the remote control and the host controller exchange commands.

[0035] 5) Logical Link: A logically independent channel created over the same physical connection for different services. Like a physical network cable, it simultaneously carries two data streams: browsing web pages and downloading movies. This solution's main controller maintains "three independent BLE logical links," meaning that within the same Bluetooth chip connection, communication between the remote control, the app, and the peer main controller can be processed in parallel without interference.

[0036] 6) Central / Peripheral (BLE Master / Slave Device): Central (Master): The controller that actively initiates connections and scans for other devices. In this solution, when the master controller is synchronizing, it will actively connect to the master controller of another bed; at this time, it is the Central controller. Peripheral (Slave): The device that passively broadcasts and waits for other devices to connect. In this example, when the master controller is waiting for the remote control or app to connect, it is the Peripheral controller.

[0037] 7) `manuf.data` (Manufacturer Specific Data) is a customizable "additional information area" in the BLE broadcast packet. The Bluetooth standard only specifies the format, not the content. The innovation of this solution is that it places a custom-designed data structure (KSN header, Mark code, Target MAC address) in this area for device identification, service isolation, and precise addressing.

[0038] 8) Mark code (service mode code), an instruction code embedded in manufacture.data. It tells other master controllers listening to the broadcast what working state this device is currently in (e.g., paired, standalone, synchronized, waiting to be synchronized), so that other devices can decide how to respond next. This is the key to multi-service parallel operation without interference.

[0039] like Figure 1 As shown, the present invention provides a dual-master wireless synchronous control system for electric beds based on Bluetooth communication, comprising a first electric bed master controller (master controller A) and a second electric bed master controller (master controller B). Each master controller is connected to the motor drive module and storage module of its respective electric bed, and is used to drive the drive actuator of the electric bed.

[0040] In this embodiment, each master controller is implemented using a single BLE SoC chip, such as the Telink TL3218B chip. This single BLE SoC chip dynamically switches between Bluetooth master / slave roles at the Bluetooth protocol stack level through a staggered connection event scheduling mechanism, rather than using a separate master + co-controller dual BLE chip solution. Specifically, time-sharing scheduling is implemented at the protocol stack level using sd_ble_gap_role_switch() or HCI instructions. Scanning, broadcasting, and connection events are scheduled by the BLE LinkLayer and executed non-blockingly.

[0041] The core steps of the "connection event timing-staggered scheduling mechanism" are as follows: 1) Initialization: When the BLE protocol stack is initialized, the system creates independent connection events for the remote control link, APP link, and master-master synchronization link.

[0042] 2) Assign connection intervals and offsets: Assign different connection intervals and start time offsets to the connection events of these three links. For example, remote control link: interval i1, offset o1; APP link: interval i2, offset o2 (usually longer, lower priority); synchronization link: interval i3, offset o3 (usually at the same level as or higher than the remote control link).

[0043] 3) Non-blocking scheduling: The BLE Link Layer is a hardware state machine. It strictly schedules events according to a pre-allocated timing sequence. When a link connection event occurs, it is activated and performs data transmission and reception. After the event ends, the device immediately enters a sleep or ready state, waiting for the next event.

[0044] 4) Conflict Avoidance: If the time windows of two links overlap, the hardware scheduler will arbitrate based on preset priorities. For example, events on the synchronization link have higher priority and may preempt events on the APP link. However, such conflicts can usually be effectively avoided by setting appropriate offsets.

[0045] 5) Parallel Operations: All scanning, broadcasting, and connection events are executed non-blockingly by the underlying Link Layer state machine. This means that while the MCU is processing data from one link (e.g., executing bed control commands from a remote control), the Link Layer can simultaneously receive data packets from another link (e.g., a peer synchronization link). This achieves true parallelism.

[0046] Through the above mechanism, each master controller maintains at least the following three independent Bluetooth logical links on the same radio frequency hardware: 1) the remote control GATT control link with the paired remote controller, used to receive bed control commands issued by the remote controller; 2) the APP GATT control link with the mobile application APP, used to receive control commands and synchronization requests issued by the APP; 3) the master controller-master controller synchronization link with the peer master controller, used for dual-bed synchronous data interaction.

[0047] like Figure 2 As shown, this embodiment details the Bluetooth broadcast message parsing and device identification mechanism of the master controller. Each master controller defines multiple layers of private fields in the manufacturer-defined data segment (manuf.data) of the Bluetooth broadcast message for device identity verification and business scenario differentiation. Specifically, the byte layout of the manufacturer data area is as follows:

[0048] The mark service code is defined as shown in the table below, with four possible values ​​corresponding to four mutually exclusive service modes:

[0049] like Figure 3 As shown, this embodiment describes the pairing process and daily security control mechanism between the remote controller and the master controller. After the master controller is powered on, it automatically opens a 10-second timed pairing window, continuously scanning for Bluetooth broadcast messages and waiting for the remote controller to connect to the pairing broadcast. When the user presses and holds the pairing button on the remote controller, the remote controller continuously sends pairing broadcast frames with Mark=0x00. After the master controller scans and identifies a valid KSN protocol header + Mark=0x00 pairing broadcast, it actively initiates a BLE link connection.

[0050] After successful pairing verification, a one-to-one exclusive binding logic is executed: when a new remote control is successfully paired, the original remote control binding information on the main controller is automatically cleared, and the old paired remote control becomes permanently invalid. The remote control and the main controller mutually add each other's MAC address to their local device whitelists, completing two-way trust binding. Both devices synchronously switch to the successfully paired state, and the main controller automatically disables pairing broadcasts and enables all bed motor control functions.

[0051] After pairing, daily button control uses a whitelist-based targeted connection mechanism. When the user presses any normal function button on the remote control, the remote control reads the MAC address of the master controller bound to it from the local whitelist and sends a BLE targeted broadcast only to that specified MAC address. The master controller, which is always running Bluetooth scanning, receives the remote control's targeted broadcast message, extracts the sender's MAC address, and compares it with the legitimate remote control MAC addresses stored in the local whitelist. Once the MAC verification matches, the master controller and remote control quickly establish a Bluetooth connection and execute the corresponding bed control action.

[0052] like Figure 6 and Figure 7 As shown, this embodiment describes a method for establishing a wireless synchronization link between two master controllers, supporting two triggering methods. The first method is simultaneous triggering by both remote controllers (…). Figure 6 The user simultaneously presses and holds the synchronization button on each of the two remote controls paired with Master A and Master B respectively. Both remote controls activate their Bluetooth radio, read the MAC addresses of the bound master controls from their local whitelists, and send targeted broadcasts only to their respective master controls to establish a Bluetooth connection with their dedicated master control. Once the link is established, the remote control sends a synchronization request frame to the master control. Upon receiving the command, the master control clears the stored binding information of the peer master control, actively disconnects the existing cross-master synchronization Bluetooth link, and switches the entire device to a dedicated synchronization establishment working mode.

[0053] The second method is remote triggering via a mobile app. Figure 7After the mobile app establishes a GATT connection with the main controller A, the user initiates a synchronization network operation through the app interface. The app sends an app synchronization request frame to the main controller A, carrying the MAC address or broadcast name of the main controller B. The main controller A parses the request frame, extracts the unique MAC address of the target main controller B, clears the original local synchronization binding information, and switches to synchronization establishment mode.

[0054] In both triggering modes, both master controllers A and B simultaneously enable Bluetooth continuous scanning, continuously sending out Mark=0x05 synchronization broadcast frames for network formation. This broadcast does not contain the KSBT Bluetooth device name, making it undetectable by the app. The broadcast includes the device's built-in hardware MAC address and an optional target MAC address. Both master controllers continuously scan and capture the synchronization broadcast messages from the other end, extracting the other's MAC address for identification. The two controllers compare their MAC address values; the device with the larger MAC address automatically becomes the synchronization link master, and the other acts as the slave, negotiating to establish a dedicated bidirectional synchronization GATT connection between the master controllers.

[0055] like Figure 5 As shown, when the two main controllers have completed synchronization binding in advance and a Bluetooth synchronization link exists, they periodically push synchronization data packets of their own bed posture and running status in both directions, including push rod position, motor running status, bed control action commands, etc., to maintain the synchronization of the two beds.

[0056] When two controllers have a synchronization binding record but no Bluetooth synchronization link is currently established (e.g., no link is established after power-on), both will automatically start Bluetooth scanning upon power-on and continuously broadcast broadcast frames carrying the Mark=0x03 "synchronized" flag. Once either controller scans and captures the other's broadcast frame and verifies MAC matching, it will immediately initiate a Bluetooth connection to establish a synchronization channel. After the link is established, periodic bidirectional synchronization data exchange will automatically resume, requiring no further user intervention.

[0057] When the system is in dual-master synchronous operation mode, the user can trigger the synchronization unbinding process by pressing and holding the wireless synchronization button on any paired remote control. The remote control reads the MAC address of the master controller bound to the local whitelist, sends a directional broadcast to establish a Bluetooth connection with its own master controller, and sends a synchronization deletion request command frame. After receiving the synchronization deletion request, the master controller immediately and actively disconnects the cross-bed synchronization Bluetooth link with the other master controller, erases all synchronization information stored locally, including the MAC address of the peer master controller and the synchronization binding configuration, and switches the entire machine to Mark=0x02 single-machine independent operation mode. The two master controllers terminate the periodic bidirectional synchronization data packet exchange and no longer synchronize bed posture and motor operation data. The master controller sends a synchronization release response frame to its own paired remote control. After receiving the response, the remote control changes the indicator light status to indicate to the user that the dual-master synchronization unbinding is complete.

[0058] This embodiment describes how the system achieves parallel compatibility and non-interference among three types of services: remote control, mobile APP control, and dual-master synchronous operation. The master controller's Bluetooth scanning function is permanently enabled, constantly monitoring over-the-air Bluetooth broadcast events. During the 0-10 second pairing window after power-on, the device actively sends a pairing broadcast (Mark=0x00), carrying a valid Bluetooth name. The mobile APP can scan, discover, and establish a connection normally. Ten seconds after power-on, the master controller adaptively switches to a normal broadcast mode based on the local network status: Mark=0x02 broadcast for single-device (no network) mode, and Mark=0x03 broadcast for dual-device (networked) mode. Both broadcasts carry the Bluetooth name, allowing the APP to scan and connect at any time.

[0059] Regardless of whether the device is in pairing mode, standalone mode, or synchronized mode, once the APP establishes a connection, the main controller immediately shuts down all external broadcasts to avoid interference from multiple devices and ensure that the APP has exclusive control. In synchronized networking mode (Mark=0x05), the broadcast frame does not carry the Bluetooth name, so the APP cannot scan and discover it, thus isolating the upper-layer APP operation from interference with the lower-layer synchronization connection establishment.

[0060] like Figure 8 As shown, this embodiment describes an extended architecture of a multimodal sleep sensor system. The system includes a bed frame main control unit, multimodal sleep sensors, and a smart central control display terminal on the backrest.

[0061] The main control unit for the bed frame is installed at the bottom of the bed frame, integrating a BLE SoC and a motor drive module. As a USB device, it connects to the sleep sensor via a USB cable. The main controller, acting as a BLE client, currently supports up to four BLE peripheral device connections. In addition to communicating with the remote control, the main controller also communicates with other interactive devices, such as display terminals and offline voice modules. As a BLE peripheral, the main controller communicates with a mobile app. The sleep sensor is installed at the bottom or headboard of the bed frame, integrating a sleep monitoring pad and microphone. As a USB host, it not only collects its own sensor data but also expands the USB interface via a USB hub to connect and expand other USB devices (such as ambient temperature sensors and air quality sensors). The intelligent central control display terminal is embedded in the headboard backrest, integrating a display screen, microphone array, and processing chip. It establishes a dedicated connection with the main controller via BLE, responsible for UI display, voice interaction, and data visualization.

[0062] A custom HID or CDC composite device protocol is established between the main controller and the sleep sensor to achieve bidirectional low-latency communication: In the downlink channel, the sleep sensor sends pre-processed AI decision instructions (such as "raise your head 15° to relieve snoring") to the main controller via USB batch transmission; In the uplink channel, the main controller packages real-time status information (supported functional module operating status, usage statistics, operation logs, and fault information) into USB interrupt transmission messages and reports them to the sleep sensor.

[0063] The sleep sensor acts as a local edge computing gateway, aggregating bed status data from the main controller and its own physiological monitoring data. Through its built-in Wi-Fi module, the data is encapsulated in MQTT or HTTPS protocols and uploaded to a cloud server, enabling remote viewing, firmware OTA upgrades, and big data analysis.

[0064] This embodiment describes a multi-device time synchronization method based on Bluetooth connection events. A master controller acts as the clock synchronization reference source, generating a system base time (STB) using its high-precision timer (RTC). At the start of each Bluetooth broadcast event or GATT connection interval, the master controller records the current STB value and embeds it as a timestamp into the upcoming broadcast packet or notification message. After establishing a BLE connection with the master controller, the sleep sensor and display terminal listen for specific synchronization characteristic characters. Upon receiving a message containing the STB, the device calculates the difference (Δt) between its local clock and the STB and includes this compensation value in subsequent data reporting.

[0065] In a snoring monitoring scenario, when the microphone on the display terminal detects a peak snoring sound, it records a local timestamp T_mic; the millimeter-wave radar of the sleep sensor detects an abnormal breathing rhythm and records a local timestamp T_radar. Both timestamps are converted to the STB time axis of the main controller using the formula T_global = T_local + Δt. The main controller then makes a comprehensive judgment: if both audio and radar abnormalities occur simultaneously within a time window of ±100ms, it is considered a valid snoring event, and the anti-snoring mode is triggered (automatic adjustment of the headboard).

[0066] Specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. Unless otherwise specified, the embodiments and features described in this application can be arbitrarily combined with each other.

Claims

1. A dual-master wireless synchronous control system for an electric bed based on Bluetooth communication, characterized in that, Including the first electric bed main controller and the second electric bed main controller; Each of the master controllers employs a single BLE SoC chip. The link layer of the BLE SoC chip is configured to dynamically switch Bluetooth master / slave roles on the same RF hardware by allocating different connection intervals and start time offsets to multiple Bluetooth logical links, thereby staggering the data transmission and reception timing of each link and maintaining the following three independent Bluetooth logical links: The remote control GATT control link between the remote controller and the paired remote controller; APP GATT control link between the app and the mobile application; Master-to-master synchronization link between the master controller and the peer master controller; The first electric bed main controller and the second electric bed main controller establish a direct bidirectional BLE connection through the main controller-main controller synchronization link. This allows for direct and periodic exchange of bed posture data and operating status data in dual-bed synchronous working mode without the need for data transfer via remote control or relay equipment.

2. The system according to claim 1, characterized in that, The link layer enables the concurrency of the three logical links through a non-blocking event scheduling mechanism. The link layer creates an independent connection event for each logical link and activates each connection event sequentially according to the allocated start time offset to send and receive data. After the event ends, it immediately enters a sleep or ready state to wait for the next connection event.

3. The system according to claim 1, characterized in that, Each of the aforementioned master controllers defines multiple layers of private fields in the vendor-defined data segment of the Bluetooth broadcast message, and the private fields include at least the following: A fixed protocol checksum header is used by the master controller to filter illegal broadcast messages; The Mark service code is used to identify the current operating mode of the device; An optional Target MAC address is used to specify the target peer master during the synchronization establishment phase, enabling targeted synchronization addressing.

4. The system according to claim 3, characterized in that, The Mark service code includes at least the following four values, each corresponding to one of four mutually exclusive service modes: 0x00: remote control pairing mode; 0x02: stand-alone operation mode; 0x03: synchronized operation mode; 0x05: network synchronization establishment mode.

5. The system according to claim 1, characterized in that, The system also includes a multimodal sleep sensor system, which comprises: The sleep sensor, configured as a USB host, is used to collect physiological data and connect to extended devices; The main controller is configured as a USB device and is connected to the sleep sensor via a USB data cable to form a USB hybrid communication channel; The back-mounted display terminal is connected to the main controller via BLE and is used for UI display and voice interaction; The sleep sensor sends AI decision commands to the main controller via the USB hybrid communication channel, receives bed posture data from the main controller, and communicates with the cloud server via the built-in Wi-Fi module.

6. The system according to claim 5, characterized in that, The main controller and the sleep sensor establish a custom HID or CDC composite device protocol for bidirectional low-latency communication, including: In the downlink channel, the sleep sensor sends AI decision commands to the main controller in batches via USB; In the uplink channel, the main controller reports the device information, status information, and fault information of all local and physically connected devices and pairing remote controllers to the sleep sensor via USB interrupt transmission messages.

7. The system according to claim 1, characterized in that, The master controller is also configured to perform multi-device time synchronization based on Bluetooth connection events, specifically including: using the master controller as a clock synchronization reference source, recording the system reference time STB at the start time of each Bluetooth broadcast event or GATT connection interval, and embedding the STB as a timestamp in the broadcast packet or notification message; after receiving a message with STB from the device, calculating the difference Δt between the local clock and the STB, and carrying the compensation value in subsequent data reporting to uniformly convert the local time to the master controller's STB time axis.

8. The system according to claim 1, characterized in that, The master controller is configured to achieve multi-service parallel compatibility through the following mechanism: The broadcast state automatically switches. During the preset time-limited pairing window after power-on, the broadcast carries a pairing broadcast frame with Mark service code 0x00. After the time-limited pairing window ends, the broadcast automatically switches to Mark service code 0x02 or 0x03 according to the current synchronization state. APP connections are mutually exclusive. Once the mobile APP establishes a GATT connection with the main controller, the main controller immediately shuts down all external Bluetooth broadcasts to maintain the link with the remote controller and the other main controller. Synchronous isolation means that during the network establishment phase, the broadcast frame does not contain the Bluetooth device name.

9. The system according to claim 1, characterized in that, The following security control mechanism is used between the remote controller and the main controller: Whitelist-based targeted connection: After pairing, the remote control and the main controller write each other's MAC address into their local whitelists. During daily remote control button operations, BLE targeted broadcasts are sent only based on the bound MAC address stored in the whitelist. One-to-one exclusive binding; when a new remote control is successfully paired, the original remote control binding information on the main controller is automatically cleared.

10. A method for dual-master wireless synchronous control of an electric bed based on Bluetooth communication, characterized in that, The system applied to any one of claims 1 to 9 includes the following steps: S1: In response to the user-triggered synchronization network command, the first electric bed main controller and the second electric bed main controller clear their local historical synchronization binding information and switch to the network synchronization mode. S2: Both master controllers continuously scan and broadcast synchronous broadcast frames for networking with Mark service code 0x05 via Bluetooth. After capturing the broadcast frame of the other end, the MAC address of the other party is extracted to complete the identity recognition. S3: The two master controllers compare the values ​​of each other's MAC addresses and automatically negotiate to allocate the master and slave roles of the synchronization link. The one with the larger MAC address value becomes the master and the other becomes the slave. S4: The master controller, which is assigned the role of the host, actively initiates a BLE connection to establish a master-master synchronous link, so that the two beds can directly and periodically exchange bed posture data and operating status data without the need for data transfer through remote control or relay equipment in synchronous working mode.

11. The method according to claim 10, characterized in that, The triggering method includes at least one of the following two: When both remote controllers are triggered simultaneously, after receiving the user's operation of pressing and holding the synchronization button at the same time, the two remote controllers paired with their respective master controllers send synchronization request frames to their respective bound master controllers, thereby triggering the master controllers to perform clearing and switching steps. Remote triggering via APP: After the mobile APP establishes a connection with any master controller, it sends a synchronization request frame carrying the MAC address or broadcast name of the peer master controller to that master controller, thereby triggering the master controller to perform clearing and switching steps.

12. The method according to claim 10, characterized in that, The method also includes a multi-device time synchronization step based on Bluetooth connection events: The master controller is used as the clock synchronization reference source to record the system reference time (STB) at the start of each Bluetooth broadcast event or GATT connection interval. The STB is embedded as a timestamp in a broadcast packet or notification message and sent to the slave device. After receiving a message with STB from the device, the difference Δt between the local clock and STB is calculated, and this compensation value is carried in subsequent data reports to uniformly convert the local time to the STB time axis of the master controller.

13. The method according to claim 12, characterized in that, The time synchronization step also includes snoring event determination: In a snoring monitoring scenario, when the microphone of the display terminal detects a peak snoring sound, it records a local timestamp T_mic; when the millimeter-wave radar of the sleep sensor detects an abnormal breathing rhythm, it records a local timestamp T_radar. T_mic and T_radar are uniformly converted into the STB time axis of the main controller using the formula T_global = T_local + Δt. If the main controller determines that an audio abnormality and a radar abnormality occur simultaneously within a time window of ±100ms, it is determined to be a valid snoring event, and the anti-snoring mode is triggered to automatically adjust the headboard height.

14. The method according to claim 10, characterized in that, The method also includes a multi-service parallel compatibility step: After the SS1 master controller is powered on, it enters a preset time-limited pairing window period, during which it broadcasts a pairing broadcast frame carrying the Mark service code 0x00. After the timed pairing window ends, the master controller automatically switches the broadcast mode according to the current synchronization status: if it is in a single-machine non-networked state, it broadcasts a broadcast frame with Mark service code 0x02; if it is in a dual-bed networked state, it broadcasts a broadcast frame with Mark service code 0x03. Once the mobile app establishes a GATT connection with the main controller, the main controller immediately shuts down all external Bluetooth broadcasts, maintaining only the existing link with the remote control and / or the peer main controller. During the network synchronization establishment phase, the SS4 master controller broadcasts a network synchronization broadcast frame carrying the Mark service code 0x05, and this broadcast frame does not carry the Bluetooth device name.

15. The method according to claim 10, characterized in that, The method also includes a power-on automatic reconnection step: When two master controllers have a pre-stored synchronization binding record but fail to establish a synchronization link after power-on, each master controller automatically starts Bluetooth scanning and continuously broadcasts a synchronized master controller broadcast frame carrying the Mark service code 0x03. After capturing a broadcast frame from the other end, verify whether the MAC address in the broadcast frame matches the synchronization binding record stored locally; If a match is found, a Bluetooth reconnection will be initiated to restore the master-master synchronization link and resume the periodic bidirectional synchronization data exchange between the two beds.

16. The method according to claim 10, characterized in that, The method also includes a one-click deletion step for the synchronization link: When both beds are in synchronized linkage mode, the user can press and hold the synchronization button on any of the paired remote controls. The remote control will send a directional broadcast to the corresponding master controller to establish a Bluetooth connection and send a synchronization deletion request command frame. After receiving the synchronization deletion request, the master controller immediately and proactively disconnects the master-master synchronization link with the other master controller, erases the MAC address and synchronization binding configuration information of the peer master controller stored locally, and switches to stand-alone independent operation mode.

Citation Information

Patent Citations

  • Intelligent electric energy meter system based on Bluetooth communication and communication method thereof

    CN112399394A

  • A Bluetooth broadcast-based remote control pairing, binding, and grouping system and method

    CN114120609B