Equipment communication method and device for voice teaching

By using the microcontroller of the relay device to parse Bluetooth data packets and trigger channel preemption interrupts, combined with a time-domain catch-up mechanism, the problem of teaching instruction delay in Bluetooth audio transmission is solved, realizing real-time teaching instruction transmission and link self-healing in underwater environments, meeting the requirements of real-time performance and synchronization in teaching scenarios.

CN121665210APending Publication Date: 2026-03-13SHENZHEN HONGSHENGDA ELECTRONIC TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-16
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

In high-dynamic concurrent business scenarios, existing technologies cause delays in teaching instructions due to the Bluetooth audio transmission protocol, which cannot meet the teaching scenario's requirement for agile perception of the online status of receiving nodes. Furthermore, underwater waveguide channels suffer from instantaneous fading issues in the complex electromagnetic environment, making it impossible to achieve deterministic low-latency scheduling of background data streams and burst command streams, as well as rapid self-healing of abnormal links.

Method used

The relay device's microcontroller parses the logical link control and adaptation protocol header of the Bluetooth data packet to determine the service type. When it is determined to be a high-priority instruction service, it triggers the channel preemption interrupt logic, suspends the read pointer of the first circular buffer, and prioritizes sending the data in the second buffer register. Combined with the time-domain catch-up mechanism, it ensures the real-time transmission of the instruction stream. At the same time, it uses the master control terminal to preset the response timeout threshold to achieve rapid self-healing of the link status.

Benefits of technology

It enables real-time transmission of teaching instructions, avoids the risks of delay and packet loss during Bluetooth broadband audio transmission, ensures the real-time and deterministic coverage of background music for teaching instructions in underwater or high-noise environments, and supports precise scheduling of multimodal service flows and rapid recovery of abnormal links.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121665210A_ABST
    Figure CN121665210A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of wireless communication networks, and discloses an equipment communication method and device for voice teaching, and the method comprises the steps that relay equipment receives a Bluetooth data packet of source end equipment, and analyzes a logic link control and adaptation protocol header to extract a channel identifier field; if the service is the streaming media service, writing the payload into a first annular buffer area and modulating and sending in sequence; if the service is determined to be the instruction service, writing the payload into a second buffer register and triggering channel preemption interruption; in response to interruption, suspending a read pointer of the first annular buffer area, and preferentially and suddenly sending data of a second buffer register; and after the sending is finished, calculating the sampling point offset corresponding to the occupied duration of the instruction, driving the read pointer to jump forwards by the offset and discarding the overstocked data, and recovering the sending from the updating position. Zero-latency preemption of high-priority instructions and rigid time synchronization of media streams are achieved in a simplex channel.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a communication method and apparatus for voice teaching equipment, belonging to the field of wireless communication network technology. Background Technology

[0002] Current underwater or special sports training communication systems typically employ heterogeneous networking architectures to meet diverse data transmission needs. Common methods include using the general Bluetooth protocol stack to establish high-bandwidth links between smart terminals and relay devices to transmit streaming background music data, and using proprietary radio frequency protocols to establish broadcast links between relay devices and multiple receiving terminals to transmit real-time voice control commands. Layered architectures handle single service flows to maintain basic communication link stability. For example, Chinese invention patent application CN115209387A discloses a communication method, device, host device, and storage medium for voice teaching. This method triggers background music volume attenuation by monitoring voice input, relies on application-layer mixing or linear forwarding, and does not break through the first-in-first-out (FIFO) buffering mechanism of the underlying protocol stack. The Bluetooth audio transmission protocol maintains a long data buffer queue to ensure smooth playback, and the relay forwarding lacks service-attribute channel arbitration. Sudden high-priority control signaling is backed up after audio data has not been sent, resulting in non-deterministic delays in the transmission of critical teaching commands.

[0003] However, when this technical architecture is applied to high-dynamic-concurrency business scenarios, there is a contradiction between the general protocol stack buffer mechanism and the real-time control requirements. The standard Bluetooth audio transmission protocol ensures smooth playback, the link layer maintains a long data buffer queue, and the relay device forwarding process lacks channel arbitration logic specific to business attributes. Sudden high-priority control signals are forced to accumulate after the audio data has not been sent. The linear processing mechanism based on the first-in-first-out principle causes non-deterministic delays in the transmission path of critical teaching correction instructions or safety warning signals. In teaching and training that emphasizes instantaneous response, delays cause trainees' actions to become out of sync with the command rhythm. In addition, the complex electromagnetic environment of the underwater waveguide channel further complicates matters. Transmission often experiences momentary fading due to medium absorption or multipath effects. Existing technologies mostly rely on standard reconnection mechanisms of general protocol stacks, and the heartbeat detection cycle and timeout threshold are usually quite long. This cannot meet the needs of teaching scenarios for agile perception of the online status of receiving nodes. When the communication topology is physically interrupted, the system often requires a long recovery window, during which command transmission is in a blind spot. The industry has tried to address the challenges by stacking hardware modules or increasing transmission power, but linear expansion increases the size and power consumption of the device, limiting portability. Moreover, it does not address the core logic of data competition and state synchronization between heterogeneous protocols, and cannot achieve accurate scheduling of multimodal service flows under limited computing resources.

[0004] Therefore, the technical problem to be solved by this invention is how to design a microcontroller-based multimodal communication control logic that reuses limited hardware resources and achieves deterministic low-latency scheduling of background data streams and burst command streams and rapid self-healing of abnormal links through underlying signaling priority arbitration and proactive link state management. Summary of the Invention

[0005] To address the problems mentioned in the background art, the technical solution of the present invention is as follows: A communication method for a voice teaching device, applied to a wireless communication network including a source device, a relay device, and a terminal device, wherein the method is executed by the relay device and includes:

[0006] Receive Bluetooth data packets from the source device, parse the logical link control and adaptation protocol header of the Bluetooth data packets to extract the channel identifier field;

[0007] The service type to which the Bluetooth data packet belongs is determined based on the channel identifier field;

[0008] When the service type is determined to be a Class I streaming media service, the payload of the Bluetooth data packet is written into the first circular buffer, and the data pointed to by the read pointer of the first circular buffer is read according to the radio frequency transmission timing, and modulated into a radio frequency signal and sent to the terminal device.

[0009] When the service type is determined to be a second type of instruction service, the payload of the Bluetooth data packet is written into a second buffer register that is independent of the first circular buffer, and the channel preemption interrupt logic is triggered.

[0010] In response to the channel preemption interrupt logic, the read pointer of the first ring buffer is suspended. In the next consecutive time slot after the current radio time slot ends, the data in the second buffer register is read first and transmitted in burst mode modulation until the second buffer register is cleared.

[0011] The transmission duration of the data in the second buffer register on the radio frequency channel is calculated. Based on the transmission duration and the audio sampling rate of the first type of streaming media service, the sampling point offset is calculated. The reading pointer of the suspended first circular buffer is jumped forward by the sampling point offset. The cached data in the first circular buffer corresponding to the transmission duration is discarded. Data reading and transmission are resumed from the updated reading pointer position.

[0012] Preferably, the step of parsing the logical link control and adaptation protocol header of a Bluetooth data packet to extract the channel identifier field includes: reading the start byte of the Bluetooth data packet link layer payload to obtain header data; identifying the channel identifier value in the header data that indicates the protocol type; comparing the channel identifier value with a protocol mapping table pre-stored in the relay device; wherein, when the channel identifier value corresponds to a media stream defined by an advanced audio distribution protocol, it is determined to be a first-type streaming media service; when the channel identifier value corresponds to signaling defined by a hands-free protocol or a general attribute configuration file, it is determined to be a second-type command service.

[0013] Preferably, the step of reading the data pointed to by the read pointer of the first circular buffer according to the radio frequency transmission timing includes: dividing the communication cycle of the radio frequency channel into a continuous sequence of micro-time slots; in the normal maintenance phase where no channel preemption interrupt logic is detected to be triggered, reading the data block pointed to by the read pointer of the first circular buffer at the beginning of each micro-time slot; modulating the data block into a private protocol radio frequency broadcast signal; and the step of preferentially reading and modulating the data in the second buffer register in burst mode includes: in the preemption interrupt phase where the channel preemption interrupt logic is detected to be triggered, terminating access to the first circular buffer and continuously occupying multiple micro-time slots, the number N being configured to range from 1 to 9999, and the total occupation time being controlled within a preset time threshold to prevent background streaming media data from accumulating and overflowing, so as to send all instruction data in the second buffer register.

[0014] Preferably, in the step of calculating the sampling point offset based on the transmission duration and the audio sampling rate of the first type of streaming media service, the sampling point offset is determined by the following formula: , where N offset T represents the sampling point offset, with units of data frames. burst The total instruction interaction time is the total time occupied by the radio frequency channel for data transmission in the second buffer register, the subsequent acknowledgment listening window, and potential retransmission processes, measured in milliseconds; F sample The audio sampling rate for Category I streaming services is measured in Hertz; ⌈⋅⌉ represents the floor function; the relay device uses the calculated N... offset Numerical control enables the read pointer of the first circular buffer to perform non-contiguous address transitions within the storage space.

[0015] Preferably, the method further includes performing the following encoding steps when sending data in the second buffer register: adding forward error correction redundancy code to the data in the second buffer register; constructing a burst control frame containing a type identifier bit, and setting the type identifier bit as a high-priority instruction identifier; the high-priority instruction identifier is used to trigger the terminal device receiving the burst control frame to execute audio gain attenuation logic, and while decoding and playing the burst control frame data, reducing the gain value of the background audio channel to below a preset decibel threshold.

[0016] Preferably, the method further includes a link state maintenance step based on a polling mechanism for a specific identifier: a preset response timeout threshold is set in the relay device, and after sending a polling command containing a specific identifier, a timer is started; if no acknowledgment signal corresponding to the specific identifier is received when the timer value exceeds the response timeout threshold, the communication link corresponding to the specific identifier is determined to be in an interrupted state; a continuous redial sequence for the specific identifier is generated, and the continuous redial sequence is sent in the radio frequency time slot to perform link self-healing.

[0017] Preferably, the method further includes a channel configuration step based on frequency band mapping: receiving a frequency band configuration command from a host computer; parsing the frequency value and corresponding channel index number contained in the frequency band configuration command; writing the frequency value into the radio frequency synthesizer register of the relay device to establish a mapping relationship between the Bluetooth logical channel and the private radio frequency physical channel; and controlling the radio frequency module to perform signal transmission on the physical channel determined by the mapping relationship when determining that the service type is either the first type of streaming media service or the second type of instruction service.

[0018] Preferably, the step of generating a channel preemption interrupt signal further includes: parsing the payload content of the second type of instruction service data packet and determining the instruction priority based on the payload content; wherein, when it is identified that the payload content contains a preset emergency stop broadcast instruction or mute instruction, it is determined to be a level one instruction and a channel preemption interrupt signal with the highest priority is generated; the highest priority channel preemption interrupt signal triggers the relay device to immediately terminate the remaining transmission process of the current micro-time slot after the current transmission byte is sent, and immediately start the transmission of the second buffer register data. The method also includes a state machine-based working mode switching step: defining the working state machine of the relay device including a receive mode and a transmit mode; when a mode switching instruction sent by the source device is detected, the relay device sends a control frame containing a state synchronization bit to the terminal device; the state synchronization bit is used to lock the working state of the terminal device and keep it synchronized with the working state machine of the relay device; when the relay device switches to the transmit mode, it forces the terminal device to enter a receive-only state and blocks its local transmission requests through the state synchronization bit.

[0019] Preferably, the method is applied to an underwater multi-node synchronous teaching environment, wherein the step of driving the read pointer of the suspended first circular buffer to jump forward by the sampling point offset is used to eliminate the cumulative time delay caused by the insertion of the second type of instruction service when the relay device broadcasts to multiple terminal devices, and to ensure that the content of the first type of streaming media service resumed by all terminal devices after the second type of instruction service is sent is consistent with the real-time system timeline of the source device.

[0020] A communication device for voice teaching includes a controller configured to execute the aforementioned communication method for voice teaching.

[0021] Compared with the prior art, the beneficial effects of the present invention are:

[0022] 1. In the communication method of voice teaching equipment, the microcontroller monitors the working mode switching command in real time. When a voice transmission request is detected, it generates and sends a control frame containing a mute signaling command, locking the receiver in a single state of receiving only voice. By taking advantage of the control signaling timing, the background data stream is cut off from occupying the channel of sudden voice commands, avoiding the risk of teaching command delay or packet loss due to data buffer queue congestion during Bluetooth broadband audio transmission. This ensures that teaching correction commands do not delay and cover the background music in underwater or high-noise complex communication environments, maintaining the real-time and deterministic transmission of teaching commands.

[0023] 2. By utilizing the master control terminal's preset response timeout threshold (set to 200 to 1000 milliseconds) and ID-oriented polling redial logic, an automatic recovery mechanism for unsteady channel links is constructed. When the master control terminal fails to resolve the acknowledgment signal from the receiver for a specific ID within the coverage multi-heartbeat cycle time window, it automatically triggers a continuous call sequence for that ID. After reconnection failure, the invalid channel resource occupation is terminated. Based on the time-domain detection connection maintenance strategy, it addresses the problem of intermittent signal interruption caused by underwater waveguide environments or human obstruction, achieving dynamic monitoring of communication links and rapid topology reconfiguration under abnormal conditions without manual intervention.

[0024] 3. By demodulating Bluetooth general protocol data packets and remodulating the private radio frequency broadcast protocol through a single microcontroller, a low-latency data mapping channel is established from the point-to-point Bluetooth communication source to the point-to-multipoint radio frequency broadcast network. By utilizing the simultaneity of spatial propagation of radio frequency broadcast signals, the time reference of all receivers is unified, eliminating the audio phase drift caused by the differences in handshake timing and buffering strategies of each protocol stack in traditional independent networking of multiple Bluetooth devices. This ensures that the time axis of music beats and action instructions received by all students in group teaching scenarios remains strictly consistent, meeting the stringent requirements of audio-visual synchronization accuracy for collective action training. Attached Figure Description

[0025] Figure 1 This is a schematic diagram of the heterogeneous wireless communication network scenario for voice teaching in this invention.

[0026] Figure 2 This is a flowchart of the signaling interaction of the voice teaching communication system of the present invention;

[0027] Figure 3 This is a comparison chart of the latency and decoding rate performance of the method of the present invention and the traditional FIFO mechanism;

[0028] Figure 4 This is a timing diagram of cross-module interaction of multimodal service flows within the relay device of the present invention. Detailed Implementation

[0029] The following detailed embodiments are intended to provide a more detailed description of the present invention so that those skilled in the art can more clearly understand the technical solution of the present invention. However, the following detailed embodiments should not be construed as limiting the scope of protection of the present invention.

[0030] This invention proposes a communication method and apparatus for voice teaching devices, including a source device, a relay device, and terminal devices, which together construct a heterogeneous wireless communication network suitable for underwater or high-noise environments. The source device is a mobile terminal with Bluetooth communication capabilities, such as a smartphone or tablet, used to send mixed service streams. These service streams include a first type of streaming media service data, such as background music data transmitted based on Advanced Audio Distribution Mode (A2DP), and a second type of command service data, such as voice commands transmitted based on the Hands-Free Protocol (HFP) or control signaling transmitted based on the Generic Attribute Profile (GATT). The relay device acts as the network core gateway, performing protocol conversion and channel resource scheduling tasks, and establishing unidirectional broadcast connections with multiple terminal devices using a proprietary radio frequency protocol. The terminal devices are bone conduction headphones that receive radio frequency signals and perform audio decoding and playback. The system data flow follows a Bluetooth unicast link from the source to the relay and a radio frequency broadcast link from the relay to the terminal, solving the channel congestion and time-domain asynchrony problems in multi-service stream concurrent scenarios. This addresses the shortcomings of existing technologies in Bluetooth unicast technology. To address the technical problem of high-priority instruction transmission delays caused by Bluetooth data buffering mechanisms, this invention deploys a service attribute-aware preemptive scheduling logic in the microcontroller (MCU) of the relay device. When the relay device receives Bluetooth baseband data packets from the source device, it does not directly store them in a general forwarding queue. Instead, it initiates a link-layer service characteristic parsing procedure. The MCU reads the Channel Identifier (CID) field or Protocol Service Multiplexer (PSM) value from the Logical Link Control and Adaptation Protocol (L2CAP) header in the Bluetooth data packet. The MCU internally stores a protocol mapping table, defining the correspondence between different CID values ​​and service priorities. When the parsed CID value corresponds to streaming audio service, the MCU marks the data packet payload as non-real-time background data and writes it sequentially into the first circular buffer. When the parsed CID value corresponds to voice or control signaling, the MCU marks the data packet payload as immediate interrupt data and writes it into a second buffer register with an independent physical address. This physical splitting mechanism decouples heterogeneous service flows at the protocol stack level, establishing the foundation for zero-wait scheduling.

[0031] To ensure the priority of teaching instructions transmission on the restricted radio frequency channel, the relay equipment adopts a time-division multiplexing transmission strategy based on micro-timeslots. The communication cycle of the proprietary radio frequency protocol is divided into continuous micro-timeslots, and the duration of each micro-timeslot is set to T. slotFor example, in 10 milliseconds, under normal mode, the MCU periodically checks the status bit of the second buffer register. When the status bit indicates that it is empty, the MCU reads the audio data block pointed to by the first circular buffer read pointer, modulates it with GFSK, and broadcasts it through the 400MHz band RF module within the current micro-time slot. When the MCU detects data being written to the second buffer register, it immediately triggers the channel preemption interrupt logic. The transmission of the current micro-time slot ends, the MCU suspends the first circular buffer read pointer, stops loading background music data, and directly accesses the second buffer register. It encodes the instruction data into a highly redundant control frame containing forward error correction code and sends it in burst mode in N consecutive micro-time slots until the second buffer register is cleared. This ensures that regardless of the background music data flow rate, the teaching instruction can be sent immediately at the beginning of the next micro-time slot, eliminating queuing delay. However, considering the complexity of the underwater audio channel, this invention designs a burst listening dual-phase confirmation mechanism. After the relay device clears the second buffer register in burst mode... Instead of immediately resuming streaming media transmission, the relay device enters a pre-defined response listening window. During this window, the relay device switches its RF front-end to receive mode and listens for short acknowledgment frames from the terminal device. These frames are sent by the terminal device within a pre-allocated time slot after successfully verifying the instruction CRC code. If the relay device does not receive a pre-defined number or specific ID of acknowledgment signals within the listening window, it immediately triggers enhanced retransmission logic, re-occupying a micro-time slot to send instructions until an acknowledgment is received or the maximum number of retransmissions is reached. Given the strict requirements for music beat synchronization in underwater synchronized swimming or group dance training, and to ensure that the music beats received by all trainees are consistent with the actual timeline on land, this invention introduces a time-domain catch-up and frame loss compensation mechanism in the relay device. After the second buffer register instruction data is sent, the system does not resume transmission from the suspended read pointer. Because the buffer backlog data lags behind the real-time timeline, the MCU executes a deterministic pointer jump calculation procedure. The MCU records the total duration T of the instruction data occupying the RF channel. burst The unit is milliseconds, and the MCU is based on the audio sampling rate F of the first type of streaming media service. sample For example, 44100 Hz or 48000 Hz, calculate the number of audio samples that the source device has played but not transmitted within that duration, and the sample offset N. offset Determined by the following formula: Where ⌈⋅⌉ represents the floor function, after which the MCU drives the read pointer of the first circular buffer to jump forward. Each address unit points to the audio data frame corresponding to the current real-time moment. The MCU discards all outdated data within the jump interval and resumes the background music RF modulation transmission from the updated read pointer position. Although this causes a microsecond-level loss of music content, the playback progress at the receiving end is aligned with the time base at the source end, preventing cumulative beat drift from multiple instruction insertions.

[0032] In terms of terminal device response processing, the bone conduction headphone MCU continuously monitors the radio frequency channel. When the demodulated data frame header contains a high-priority instruction identifier, the headphone's digital signal processing unit (DSP) immediately initiates the audio pipeline mixing procedure. The DSP controls the digital gain of the background audio channel to linearly decay to a preset threshold, such as -20 dB, within 5 to 10 milliseconds. Simultaneously, the received instruction voice data is loaded into the foreground playback channel. After the instruction data frame transmission ends and a recovery signal is received, the DSP controls the gain of the background audio channel to perform a linear fade-in operation, restoring the original volume. The dual-modal response mechanism ensures that the instruction content is clearly distinguishable and maintains the continuity of the background music during non-conflict periods. To verify the effectiveness of the communication method of this invention, an underwater communication test environment was constructed, including one host (relay device) and 10 bone conduction headphones (terminal devices). The host uses an STM32 series microcontroller and an SX1278 RF module, operating at a frequency of 433MHz. The source device plays standard test audio with a tempo of 120 BPM. During the test, the source device plays standard test audio every 10 seconds. The terminal device triggers a voice command that lasts for 2 seconds. The oscilloscope monitor shows that at the moment the command is triggered, the signal mode of the host RF output terminal switches from a continuous audio data stream to a high-power-density command data packet within 12 milliseconds, verifying the real-time performance of the preemption scheduling. The audio analyzer compares the phase difference between the source audio signal and the bone conduction output signal of the headphone. The results show that after 50 command insertion operations, the time deviation between the music beat output of the headphone and the source reference signal is always maintained within 20 milliseconds, and no cumulative delay occurs, confirming the engineering practicality of the time-domain catch-up mechanism. This invention also discloses a channel configuration procedure based on frequency band mapping to solve the channel interference problem of multiple teaching teams training in the same water area. The user issues a frequency band configuration command through the host computer software. The command includes the target frequency value and the corresponding logical channel index number (1 to 22). The relay device receives the command, writes the frequency value into the phase-locked loop (PLL) register of the RF synthesizer, establishes the mapping relationship between the Bluetooth logical service and the specific physical frequency, and controls the RF front end to work on the specified physical channel when the MCU executes the classification, buffering and scheduling logic.

[0033] Example 1: In an industrial-grade communication scenario used for underwater rehearsals for high-level synchronized swimming teams, there is a severe challenge of interference between multi-node concurrent control and high-fidelity background music playback. In this scenario, the coach needs to send high-bitrate background music streams in real time to 10 athletes at different depths underwater via a shore-based host to ensure the rhythmic benchmark of the dance choreography. At the same time, the coach can insert real-time corrective voice commands for specific movement details or trigger a stop command for all athletes in an emergency. In traditional communication architectures, due to the large capacity of Bluetooth A2DP streaming media data packets, the transmission in the channel often forms a continuous long queue. When the coach presses the intercom button to try to insert voice commands, the high-priority control data is forced to queue at the end of the music data queue that has already entered the transmission buffer. The nondeterministic delay caused by this mechanism is usually as high as hundreds of milliseconds or even seconds, causing the corrective commands heard by the underwater athletes to lag significantly behind the current movement, seriously affecting the efficiency and safety of refined training.

[0034] To address this situation, the relay device in this embodiment employs a preemptive scheduling mechanism based on service feature parsing. When the instructor's terminal device on shore simultaneously transmits background music and voice commands via Bluetooth, the relay device's microcontroller (MCU) intercepts and parses the Logical Link Control and Adaptation Protocol (L2CAP) header of the data packets at the link layer. When the MCU recognizes that the Channel Identifier (CID) points to the streaming media service, it imports the payload into the first circular buffer to maintain normal broadcasting. Once the MCU captures voice data pointing to the Hands-Free Protocol (HFP) or detects specific control signaling, it locks the payload to the second buffer register. At this time, the MCU does not wait for the current music data packet sequence to finish sending, but instead starts transmitting within the current micro-timeslot T. slot At the moment of termination, the read pointer pointing to the first circular buffer is suspended. The MCU then switches the input source of the RF front-end. In the following continuous micro-time slots, the voice commands in the second buffer register are encoded into highly redundant 0-degree RF frames in burst mode and broadcast across the entire network. This ensures that no matter how heavy the background music stream load is, the coach's commands can always gain absolute control of the physical channel within a 10-millisecond micro-time slot period. After this preemption process ends, the system faces the problem of background music timeline lag caused by command insertion. If playback is resumed directly, the music beats heard by all athletes will lag behind the actual beats on the shore by the command duration, causing the movements to be out of sync with the standard rhythm. At this time, the MCU executes the time-domain catch-up procedure, and the total time T consumed by the MCU in reading the command transmission is calculated. burst Combined with the sampling rate F of the background music sample Calculate the number N of audio sampling points that should be played during this time period. offset MCU according to formula Calculate the offset and control the read pointer of the first circular buffer to jump forward N. offsetIn each unit, the MCU discards expired data within the jump interval and directly resumes the transmission of background music from the latest timestamp position. When the terminal device (bone conduction headphones) receives the resumed music frame, the playback content is already aligned with the timeline of the source device on shore. This physical channel preemption and time-domain compensation mechanism based on protocol layer parsing achieves zero-wait switching of heterogeneous service flows on a single radio frequency point, avoids the blocking risk brought by traditional queuing mechanisms, and ensures that the problem of audio-visual synchronization in underwater real-time teaching is solved in complex concurrent communication environments.

[0035] Example 2: To objectively verify the practical effectiveness of the voice teaching device communication method of the present invention in complex electromagnetic environments and high-concurrency business scenarios, as well as its engineering advantages over traditional transparent transmission mechanisms, an underwater communication verification platform consisting of one main control relay device and 20 receiving terminals was constructed and deployed in a standard Olympic swimming pool environment to simulate a real synchronized swimming group training scenario. The core processing unit of the main control relay device uses an STM32F405 microcontroller, and the RF front-end integrates an SX1278 spread spectrum modulation module, with the operating frequency set at 433.92MHz. The transmission power is 20dBm. The source signal is emitted by a tablet computer running custom test software via Bluetooth 5.0. The software can transmit high bit rate A2DP audio data streams (simulating background music) and short voice command packets defined by the HFP protocol (simulating coach commands) in a programmable timing sequence. To simulate channel interference in a real industrial environment, three interference signal generators in the same frequency band are deployed around the test water area to continuously transmit Gaussian white noise with a signal-to-noise ratio of 15dB and insert pulse interference with a duration of 50ms to 200ms at random time intervals.

[0036] The core of the experimental design lies in quantitatively evaluating the effect of the preemptive scheduling mechanism on improving the transmission delay of high-priority commands, and the ability of the time-domain catch-up mechanism to maintain the synchronization of music beats. To this end, a comparative experiment was designed, including a control sample group and the sample group of the present invention. The control sample group adopts the traditional first-in-first-out (FIFO) queue forwarding strategy, that is, the relay device does not perform service attribute parsing on Bluetooth data packets, and strictly writes all data into a single circular buffer for modulation and transmission in the order of reception. The sample group of the present invention fully enables service diversion based on CID parsing, micro-timeslot preemptive scheduling, and sampling point offset compensation logic. During the test, the source device continuously plays standard test audio with a beat of 120 BPM and triggers a voice command lasting 1.5 seconds every 10 seconds. Through a digital oscilloscope and logic analyzer connected to the audio output port of the receiving terminal, the delay time of the command arrival time relative to the trigger time of the source end, as well as the phase deviation of the music signal that resumes playback after the command ends relative to the source end reference signal are captured and recorded in real time.

[0037] Table 1: Comparison of test results on command delay and synchronization deviation under different load conditions

[0038]

[0039] Table 1 details the measured data of key performance indicators for the two sample groups under different background traffic load conditions. The background traffic load was simulated by adjusting the encoding bit rate of the A2DP audio stream, set to low load (128kbps), medium load (256kbps), and high load (320kbps). The data in the table are the average measurements after 50 consecutive instruction insertion operations. Data analysis shows that in the comparison sample group, the instruction transmission delay exhibits a non-linear growth trend with the increase of background traffic load. Especially under the high load condition of 320kbps, the average delay is as high as 895.2 milliseconds, and the standard deviation reaches 230.5 milliseconds. This indicates that the instruction transmission is not only severely lagging but also has great uncertainty. This is attributed to the fact that under the single FIFO queue mechanism, sudden voice instructions are forced to queue after music data packets that last for hundreds of milliseconds. Channel congestion directly leads to instruction blocking. At the same time, in the comparison sample group, the cumulative deviation of the music beat stabilizes at more than 1500 milliseconds after the instruction ends, which is highly consistent with the duration of the instruction itself (1.5 seconds).

[0040] In contrast, the sample from this invention exhibits superior deterministic performance under all load conditions. Regardless of changes in background traffic, the average instruction transmission delay remains consistently between 12.5 and 12.8 milliseconds, only slightly longer than the duration of the RF microslot (10 ms). This result strongly confirms the effectiveness of the microslot preemption mechanism, meaning that no matter how dense the current music data stream is, high-priority instructions can immediately gain channel control at the start of the next microslot, achieving zero-wait access at the physical layer. The cumulative music beat deviation of the sample from this invention is consistently controlled within 20 milliseconds, far below the synchronization error threshold perceptible to the human ear. This data directly proves the validity of the sampling point offset calculation formula. With its accompanying read pointer jump logic, the system can accurately calculate and discard expired data accumulated during the instruction's occupation period. The receiver's timeline is synchronized with the source in real time. Even in a harsh channel environment with 15dB white noise and impulse interference, thanks to the burst transmission of instruction data and highly redundant error correction coding, the sample of this invention still maintains a 100% instruction decoding success rate and does not experience voice distortion caused by packet loss or bit errors. In contrast, the comparison sample experienced approximately 15% frame loss under the same interference.

[0041] Example 3: This example combines Figures 1 to 4 A description of a communication method and device for a voice teaching equipment, such as... Figure 1As shown, the application scenario of this invention constructs a wireless communication network including a source device, a relay device, and a terminal device. The source device is represented by a mobile phone, which connects to a relay device (represented as a walkie-talkie) via a Bluetooth communication link. The relay device further establishes communication with a terminal device (represented as a bone conduction headset) via a point-of-sale (POS) communication link, thereby forming a data transmission channel from the source to the terminal. Figure 2 As shown, the system comprises three main parts: source devices (smartphones / teaching tablets), relay devices (hosts / gateways), and terminal devices (bone conduction headphones / monitoring wristbands). The source devices (smartphones / teaching tablets) generate multimodal data (background music + voice commands) via a teaching management app (human-computer interaction interface), and send this data to the relay devices via Bluetooth. They also provide physiological monitoring and display (heart rate values / alarm pop-ups). The relay devices (hosts / gateways) receive data via Bluetooth communication modules (which parse L2CAP headers), determine service attributes, and perform traffic splitting (streaming media vs. command services): data belonging to the streaming media service is stored in the first circular buffer (background streaming media data). According to the instructions, data belonging to the instruction service is stored in the second buffer register (high-priority instructions); then the system triggers an interrupt, executes channel preemption and time-domain scheduling logic (pointer suspension / burst mode), and after modulation and transmission, the proprietary protocol RF transceiver module sends out RF broadcasts. The terminal device (bone conduction headphones / monitoring bracelet) receives the signal through the RF transceiver front end (two-way communication) and sends the audio data stream to the audio decoding and playback (bone conduction oscillator drive) module; at the same time, the real-time data collected by the physiological feature acquisition unit (photoelectric heart rate sensor) is processed by physiological data encapsulation and real-time value / status feedback reporting to form a physiological monitoring data stream (uplink), which is fed back to the relay device through the data transmission module. The relay device receives the status feedback and physiological data and transmits them back to the source device through the data pass-through mechanism.

[0042] like Figure 3 As shown, the horizontal axis represents different communication methods, and the vertical axis represents performance index values. The legend distinguishes between instruction decoding success rate (%) and average latency increase (ms). Compared to the traditional FIFO method, which has a higher latency increase and a lower decoding success rate, the method of this invention achieves a near-maximum instruction decoding success rate (%) while maintaining an extremely low average latency increase (ms). Figure 4As shown, the system includes a Bluetooth receiving module, a microcontroller, a first circular buffer, a second buffer register, and an RF transmitting module. When the microcontroller receives a data packet from the Bluetooth receiving module and extracts the CID field value from the L2CAP header start byte, if the CID corresponds to an A2DP streaming media stream, it is determined to be a streaming media service. The payload is written to the end of the first circular buffer and the write pointer position is returned. The read pointer data is read and transmitted to the RF transmitting module to perform data block transmission and GFSK modulation broadcast. If the CID corresponds to an HFP / GATT signaling, it is determined to be an instruction service. The payload is written to the second buffer register, the data ready flag is set, and the preemptive interrupt logic is triggered. The RF transmitting module directly handles the transmission of high-priority data.

[0043] Example 4: To ensure the determinism and reproducibility of the communication method for voice teaching devices in the present invention in engineering implementation, this example provides a system-level solution based on deterministic hardware behavior and static data structures for the specific implementation paths of the Channel Identifier (CID) resolution procedure, micro-slot preemption timing logic, and time-domain catch-up compensation algorithm. By anchoring logical decisions to a static lookup table and hardware timer interrupts, the uncertainty delays that may be introduced by software scheduling are eliminated, thereby constructing a relay control system with predictable behavior. For the Channel Identifier (CID) resolution and service offloading mechanism, the system constructs and maintains a static protocol service mapping table in the read-only memory (ROM) of the microcontroller (MCU). This mapping table consists of a set of predefined key-value pairs, where the key is a 16-bit unsigned integer CID value and the value is an 8-bit unsigned integer service type enumeration. The service type enumeration is defined as follows: 0x01 represents high-priority instruction service (corresponding to HFP and GATT signaling), 0x02 represents low-priority streaming media service (corresponding to A2DP data), and 0x00 represents unknown or ignored type. In the data packet reception interrupt service routine, the MCU reads a specific offset address of the receive buffer to extract the CID field and performs a fast search based on the binary search algorithm. If the matching result is 0x01, the MCU sets the flag bit and transfers the data packet payload to the second buffer register with physical address 0x20004000 through the direct memory access (DMA) channel. If the matching result is 0x02, the MCU clears the flag bit and appends the payload to the tail of the first circular buffer with physical address 0x20008000, ensuring that each frame of data packet is physically isolated to different storage areas according to the determined logic.

[0044] For micro-slot preemption timing control, this embodiment discloses a deterministic state machine logic based on hardware timer driving. The RF transmission state machine is defined as having three core states: S IDLE (Idle), S MEDIA (Media broadcast) and S CMD(Instruction burst), the MCU configures a high-precision hardware timer, in T... slot An overflow interrupt is generated with a period of 10 milliseconds, serving as the clock driver for the state machine. At the entry point of each timer interrupt service routine, the MCU detects the arrival of the instruction flag. If the flag is set to 1 and the current state is S... MEDIA or S IDLE The state machine transitions unconditionally to S. CMD The RF transmission module's state machine is controlled by a hardware timer interrupt service routine driven by a high-precision external crystal oscillator, operating only in each micro-time slot T. slot The system polls the status flag bit of the second buffer register at the start clock edge. Once the flag bit is active, the state machine inverts the RF front-end power amplifier input source selection switch within the IFS (Inter-Frame Frame) window of the current RF physical frame transmission end, cutting off the bit stream of the first ring buffer and enabling the instruction data stream of the second buffer register. The channel switching process is independent of the upper-layer software protocol stack scheduling loop, limiting the maximum time jitter of high-priority instructions accessing the physical channel to within the order of a single RF symbol period. At the moment of state transition, the MCU suspends the DMA transfer request pointing to the first ring buffer and saves the current read pointer P. read_saved The data source pointer of the RF module is redirected to the base address of the second buffer register, and then continuous burst transmission of instruction data is initiated. When the second buffer register is empty, the state machine detects the instruction transmission completion signal and automatically transitions back to the S state. MEDIA It also triggers time-domain catch-up logic, and this state machine model ensures that the preemption action occurs deterministically within a microsecond-level time window.

[0045] For the implementation of the time-domain catch-up algorithm, this embodiment provides specific pointer calculation and correction procedures. When the time-domain catch-up logic is triggered, the MCU reads the count value of the hardware timer and calculates the total number of clock cycles C elapsed during the instruction preemption period. total Prior to this, the system performs a dynamic sampling rate adaptation step based on the teaching content attributes: the MCU back-analyzes the audio or video distribution transmission protocol configuration instructions when the source device establishes a connection, or reads the audio stream header information in real time. If the teaching content is identified as high-fidelity background music, the frequency field value is extracted to determine F. sample The frequency is 44100Hz or 48000Hz; if the identified teaching content is a standard beat prompt or a low-bandwidth speech stream, then F is determined. sample Set the current sampling rate F to 16000Hz or 8000Hz to match the actual sampling rate F corresponding to the current service. sample Then, combine the data bit width W of each sample sample For example, 16-bit stereo, which is 4 bytes, requires a byte offset B to be discarded. offset Calculated by the following formula , of which F sysThe MCU system clock frequency is used for calculations. After completion, the MCU reads the pending read pointer P. read_saved Perform addition operation , where L buffer The total length of the first circular buffer is given by the modulo operation to handle buffer rollback. When receiving the recovered transmission signal, the DMA controller source address register is rewritten. The central processing unit calculates the sampling point offset N. offset When performing an addition operation on the latched read pointer address, if the result exceeds the preset physical memory tail address of the first circular buffer, the memory management unit performs a modulo operation based on the total length of the buffer, remapping the target address to the corresponding offset of the physical memory starting address. Before and after the address transition, the audio digital signal processing front end performs fixed-slope linear gain attenuation and recovery on 128 PCM sampling points before and after the transition point, pulling the signal amplitude at the waveform truncation point back to zero level, eliminating broadband popping interference caused by waveform discontinuity due to data loss. The MCU updates the P... new Write to the source address register of the DMA controller and re-enable DMA transfer to ensure that the output data stream precisely skips the time occupied by the instruction on the timeline at the moment media playback resumes.

[0046] Example 5: To ensure the system stability and compliance of the communication method for voice teaching devices of the present invention when facing non-standard service type access and complex and variable electromagnetic environments, this example constructs a standardized engineering procedure for the offline construction and filling of the protocol service mapping table, as well as the pre-calibration of relay equipment deployment. For the offline construction and filling procedure of the protocol service mapping table, the system adopts an offline calibration method based on standardized test vectors. In the production stage, the test platform generates a sequence of test data packets covering all standard services universally unique identifiers (UUIDs) defined by the Bluetooth Special Interest Group (SIG) and reserved private service UUIDs. The test platform sequentially sends the data packets to the relay equipment to be calibrated and monitors... To test the response, engineers manually specify the service priority corresponding to each type of UUID based on actual teaching needs. For example, a specific UUID is mapped to 0x01 instruction service or 0x02 streaming media service, and the mapping relationship is recorded in an intermediate database. After traversal, the test platform executes a compilation script to convert the intermediate database into a binary image file that conforms to the address layout of the microcontroller's (MCU) read-only memory (ROM). Finally, the image file is burned to a specific Flash sector of the MCU through the JTAG or SWD debugging interface to complete the solidification of the protocol service mapping table. This ensures that the factory-delivered equipment has complete and deterministic service recognition capabilities and avoids the error risks that may be introduced by dynamic construction at runtime.

[0047] For the pre-deployment calibration procedure of relay equipment, the system automatically executes the RF environment adaptive calibration process every time it powers on or detects a new deployment environment. After startup, the MCU controls the RF front-end to enter receive-only mode and performs a 1-second energy scan (RSSIScan) within the target operating frequency band, such as 433.92MHz, and adjacent frequency bands ±200kHz. The MCU collects and calculates the average background noise floor N within this time window. floor Based on the calculated N floor The MCU dynamically adjusts the carrier detection threshold (CADThreshold) of the RF receiver, setting it to N. floor +6dB is added to suppress environmental false triggering while ensuring sensitivity. If the scan finds a continuous interference signal in the current frequency band and the duty cycle exceeds 50%, the MCU will automatically switch to the backup frequency band according to the preset frequency hopping table and broadcast the frequency band switching instruction to all connected terminal devices to ensure that the system can establish a communication link with the optimal physical layer parameters in different water or electromagnetic environments and maintain consistent communication quality.

[0048] Example 6: To ensure the reproducibility and long-term stability of the communication method for voice teaching devices in real and complex engineering scenarios, this example constructs and discloses a standardized pre-deployment calibration and model building procedure. The aim is to eliminate the influence of environmental differences on system parameter settings through a series of controlled engineering experiments and quantitative calculations, ensuring that the system reaches its optimal working state during both the initial deployment and operation and maintenance phases. For the calibration of radio frequency micro-slot parameters, the system adopts an adaptive optimization algorithm based on channel characteristics. In the initial deployment phase, the relay device enters test mode and sends a series of probe data packets of increasing length to terminal nodes distributed at different locations in the target water area. The packet length range is set from 64 bytes to 256 bytes. The relay device records the round-trip time (RTT) and bit error rate (BER) of each data packet. By analyzing the RTT distribution, the system calculates the maximum delay spread τ of the channel. max Based on the Nyquist criterion and system processing capacity, the duration T of the micro-timeslot is... slot The optimal value is determined by the following formula. , where K margin For the engineering safety factor, a value of 1.5 is recommended. min To determine the minimum time granularity for system hardware processing, the system further performs a bidirectional balanced verification step to verify the audio continuity of the instruction response, in order to determine the final micro-slot duration T. slotThe system starts with the calculated theoretical value and sets the test micro-slot duration in 2-millisecond increments. At each test step, the system simulates high-concurrency instruction insertion while simultaneously monitoring two key performance indicators: instruction response latency (recording the average waiting time from instruction triggering to RF transmission) and audio buffer underflow rate (statistically counting the number of times audio data supply is insufficient due to frequent channel switching per unit time). The system compares the test results to generate a performance curve. The algorithm logic is configured to find the performance inflection point: that is, to achieve the minimum instruction response latency while keeping the audio buffer underflow rate zero. Experimental verification shows that when T... slot When set to the range of 8 to 12 milliseconds (typical value is 10 ms), the system can eliminate audio jitter while keeping the average instruction delay within the range of human hearing's instantaneous perception, thereby completing the final locking of parameters and ensuring that the micro-slot duration can accommodate signal transmission under the worst channel conditions.

[0049] To address the calculation of sampling point offset in the time-domain catching-up algorithm, the system establishes a dynamic calibration model based on measured clock drift. Considering the potential clock frequency deviation between the source device and the relay device during long-term operation, relying solely on the theoretical sampling rate for calculation may lead to cumulative errors. Therefore, during operation, the system periodically performs clock synchronization detection, such as every minute, and the relay device records the timestamp t sent by the source device. source With local received timestamp t local And calculate the relative drift rate δ between the two, and the corrected sampling point offset. The calculation formula has been updated to: , among which, T burst To mitigate the duration of instruction occupancy, the system introduces a drift rate δ, enabling dynamic compensation for hardware clock differences. This ensures that the synchronization accuracy of audio content remains within milliseconds during long-duration, high-load teaching activities, eliminating engineering black boxes caused by individual hardware variations. Regarding the trigger threshold for channel preemption interruption logic, the system employs an adaptive adjustment mechanism based on service traffic statistics. The system monitors the arrival frequency λ of the second type of instruction service in real time. When λ is below a preset low threshold, the system maintains the default interrupt response strategy. When λ exceeds a preset high threshold, indicating a high-frequency instruction interaction period such as intensive correction training, the system automatically lowers the threshold for entering preemption mode, allowing shorter instruction segments to trigger preemption to prioritize instruction real-time performance. Conversely, during low-frequency interaction periods, the system appropriately raises the threshold to reduce the impact of frequent interruptions on the continuity of background music. This adaptive procedure quantifies service characteristics to achieve a dynamic balance between real-time performance and continuity of system resources, ensuring the solution's broad adaptability under different teaching intensities.

[0050] Example 7: To further address the real-time requirements of voice interaction in actual teaching scenarios, this example discloses a full-link voice teaching device communication method based on the aforementioned data scheduling mechanism. This method provides a complete voice communication process from source acoustic acquisition to terminal acoustic playback, specifically including the following steps:

[0051] Step S1: The multimodal audio signal is acquired and classified by the input device. The ambient sound is acquired in real time. When the source device detects a continuous streaming audio stream, it encodes it into first-class streaming media data. This data stream is defined as the background layer in the communication link. It has high bandwidth but is allowed to be interrupted in terms of timing. When the source device detects that the key trigger (PTT) or voice activation detection (VAD) signal is valid, it immediately starts voice command acquisition. The analog voice signal is converted into digital signal by analog-to-digital converter (ADC) and compressed and encoded (corresponding to HFP or proprietary voice encoding) to generate second-class command service data. This data stream is defined as the command layer in the communication link. It has low latency and high priority.

[0052] Step S2: Based on the differentiated channel access relay device according to the service attributes, the following voice communication control logic is executed: In the default state without instruction layer data input, the relay device continuously demodulates the background layer data sent by the source end and broadcasts it to all terminal devices through the radio frequency module to maintain the continuous playback of the teaching background music; once the relay device recognizes the second type of data packet containing voice commands, it immediately triggers the voice priority transmission mechanism. At this time, the system does not need to wait for the background music data to be sent, but uses the aforementioned pointer suspension and time slot preemption technology to forcibly cut off the radio frequency transmission of the current background music and completely transfer the physical channel resources to the voice command data.

[0053] Step S3: Terminal Acoustic Rendering and Auditory Synchronization. The terminal device receives radio frequency signals and performs acoustic restoration: The terminal device continuously monitors the radio frequency channel. When a voice command frame with a high priority identifier is demodulated, its internal DSP unit immediately performs audio ducking processing, instantly reducing the gain of the background music channel (e.g., attenuating by 20dB) or muting it, and decodes and plays the received voice command at full volume. This ensures that even in a noisy underwater environment, students can clearly distinguish the instructor's voice command, achieving the goal of clear communication. After the voice command is played, the terminal device smoothly restores the background music playback according to the time-domain compensation logic of the relay device. Since the relay device has removed the music segments squeezed out by the voice command, the music beat heard by the students is synchronized with the time axis of the source on shore.

[0054] Example 8: This example details the signal reception and voice processing logic applied to terminal devices (such as bone conduction headphones). This logic, together with the transmission logic of the relay device, forms a complete closed loop for voice teaching communication. Radio frequency signal acquisition and analysis: The terminal device's radio frequency receiving module continuously monitors the operating frequency band. When it receives a radio frequency data frame from the relay device, the microcontroller first parses the type identifier bit in the frame header. Normal reception phase: If the identifier bit indicates a first-class streaming media service (background music), the terminal device will store it in the playback buffer. The DSP unit maintains the current background audio channel gain at 0dB (i.e., the original volume) to ensure the continuity of the music rhythm. Voice command recognition and response: When the terminal device demodulates a burst control frame containing a high-priority command identifier, it immediately executes the following voice communication response steps:

[0055] Step A, Audio Dodge: The DSP unit does not wait for the current music frame to finish playing, but immediately linearly attenuates the gain of the background music channel to a preset threshold (e.g., -20dB) or performs a mute operation within 5-10 milliseconds; Step B, Command Priority Playback: The received second type of command service (voice command) data is directly routed to the foreground playback channel, driving the bone conduction oscillator to produce sound. At this time, the student hears the coach's command with a very weak background and clear voice; Step C, State Lock: During command reception, the terminal device blocks non-urgent reconnection requests or status polling and locks itself in the command-only reception state; Time Domain Recovery and Auditory Synchronization: When the command data packet transmission is detected to be finished (i.e., the relay device resumes normal transmission), the terminal device performs the recovery step: controlling the gain of the background audio channel to perform a linear fade-in within 20-50 milliseconds, restoring to the original volume. At this time, since the relay device has already performed the sampling point offset Noffset jump operation at the transmitting end, the new music received by the terminal device skips the duration occupied by the command on the time axis.

[0056] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0057] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A communication method for voice teaching devices, applied in a wireless communication network including a source device, a relay device, and a terminal device, wherein the method is executed by the relay device, characterized in that, include: Receive Bluetooth data packets from the source device, parse the logical link control and adaptation protocol header of the Bluetooth data packets to extract the channel identifier field; The service type to which the Bluetooth data packet belongs is determined based on the channel identifier field; When the service type is determined to be a Class I streaming media service, the payload of the Bluetooth data packet is written into the first circular buffer, and the data pointed to by the read pointer of the first circular buffer is read according to the radio frequency transmission timing, and modulated into a radio frequency signal and sent to the terminal device. When the service type is determined to be a second type of instruction service, the payload of the Bluetooth data packet is written into a second buffer register that is independent of the first circular buffer, and the channel preemption interrupt logic is triggered. In response to the channel preemption interrupt logic, the read pointer of the first ring buffer is suspended. In the next consecutive time slot after the current radio time slot ends, the data in the second buffer register is read first and transmitted in burst mode modulation until the second buffer register is cleared. The transmission duration of the data in the second buffer register on the radio frequency channel is calculated. Based on the transmission duration and the audio sampling rate of the first type of streaming media service, the sampling point offset is calculated. The reading pointer of the suspended first circular buffer is jumped forward by the sampling point offset. The cached data in the first circular buffer corresponding to the transmission duration is discarded. Data reading and transmission are resumed from the updated reading pointer position.

2. The communication method for a voice teaching device according to claim 1, characterized in that, The steps of parsing the logical link control and adaptation protocol header of a Bluetooth data packet to extract the channel identifier field include: reading the start byte of the Bluetooth data packet link layer payload to obtain header data; identifying the channel identifier value in the header data that indicates the protocol type; comparing the channel identifier value with a protocol mapping table pre-stored in the relay device; wherein, when the channel identifier value corresponds to a media stream defined by an advanced audio distribution protocol, it is determined to be a first-type streaming media service; when the channel identifier value corresponds to signaling defined by a hands-free protocol or a general attribute configuration file, it is determined to be a second-type command service.

3. The communication method for a voice teaching device according to claim 1, characterized in that, The steps of reading the data pointed to by the read pointer of the first circular buffer according to the radio frequency transmission timing include: dividing the communication cycle of the radio frequency channel into a continuous sequence of micro-time slots; in the normal maintenance phase where no channel preemption interrupt logic is detected to be triggered, reading the data block pointed to by the read pointer of the first circular buffer at the beginning of each micro-time slot; modulating the data block into a private protocol radio frequency broadcast signal; and prioritizing the reading and transmitting of the data in the second buffer register in burst mode, which includes: in the preemption interrupt phase where the channel preemption interrupt logic is detected to be triggered, terminating access to the first circular buffer and continuously occupying multiple micro-time slots, the number N being configured to range from 1 to 9999, with the total occupation time controlled within a preset time threshold, so as to transmit all instruction data in the second buffer register.

4. The communication method for a voice teaching device according to claim 3, characterized in that, In the step of calculating the sampling point offset based on the transmission duration and the audio sampling rate of the first type of streaming media service, the sampling point offset is determined by the following formula: , where N offset T represents the sampling point offset, with units of data frames. burst The total instruction interaction time is the total time occupied by the radio frequency channel for data transmission in the second buffer register, the subsequent acknowledgment listening window, and potential retransmission processes, measured in milliseconds; F sample The audio sampling rate for Category I streaming services is measured in Hertz; ⌈⋅⌉ represents the floor function; the relay device uses the calculated N... offset Numerical control enables the read pointer of the first circular buffer to perform non-contiguous address transitions within the storage space.

5. The communication method for a voice teaching device according to claim 1, characterized in that, The method also includes performing the following encoding steps when sending data in the second buffer register: adding forward error correction redundancy code to the data in the second buffer register; constructing a burst control frame containing a type identifier bit and setting the type identifier bit as a high-priority instruction identifier; the high-priority instruction identifier is used to trigger the terminal device receiving the burst control frame to execute audio gain attenuation logic, and while decoding and playing the burst control frame data, reducing the gain value of the background audio channel to below a preset decibel threshold.

6. The communication method for a voice teaching device according to claim 1, characterized in that, The method also includes a link state maintenance step based on a polling mechanism with a specific identifier: a response timeout threshold is preset in the relay device, and a polling command containing a specific identifier is sent before a timer is started; If no acknowledgment signal corresponding to the specific identifier is received when the timer value exceeds the response timeout threshold, the communication link corresponding to the specific identifier is determined to be in an interrupted state; a continuous redial sequence for the specific identifier is generated, and the continuous redial sequence is sent in the radio frequency time slot to perform link self-healing.

7. The communication method for a voice teaching device according to claim 1, characterized in that, The method also includes a channel configuration step based on frequency band mapping: receiving a frequency band configuration command from the host computer; parsing the frequency value and corresponding channel index number contained in the frequency band configuration command; writing the frequency value into the radio frequency synthesizer register of the relay device to establish a mapping relationship between the Bluetooth logical channel and the private radio frequency physical channel; and controlling the radio frequency module to perform signal transmission on the physical channel determined by the mapping relationship when determining whether the service type is a first-class streaming media service or a second-class command service.

8. The communication method for a voice teaching device according to claim 1, characterized in that, The step of generating a channel preemption interrupt signal further includes: parsing the payload content of the second type of instruction service data packet and determining the instruction priority based on the payload content; wherein, when it is identified that the payload content contains a preset emergency stop broadcast instruction or mute instruction, it is determined to be a level one instruction and a channel preemption interrupt signal with the highest priority is generated; the highest priority channel preemption interrupt signal triggers the relay device to immediately terminate the remaining transmission process of the current micro-time slot after the current transmission byte is sent, and immediately start the transmission of the second buffer register data. The method also includes a working mode switching step based on a state machine: defining the working state machine of the relay device including a receive mode and a transmit mode; when a mode switching instruction sent by the source device is detected, the relay device sends a control frame containing a state synchronization bit to the terminal device; the state synchronization bit is used to lock the working state of the terminal device and keep it synchronized with the working state machine of the relay device; when the relay device switches to the transmit mode, it forces the terminal device to enter a receive-only state and blocks its local transmission requests through the state synchronization bit.

9. The communication method for a voice teaching device according to claim 1, characterized in that, The method is applied to an underwater multi-node synchronous teaching environment. The step of driving the read pointer of the suspended first circular buffer to jump forward by the sampling point offset is used to eliminate the cumulative time delay caused by the insertion of the second type of instruction service when the relay device broadcasts to multiple terminal devices. This ensures that after the second type of instruction service is sent, the content of the first type of streaming media service resumed by all terminal devices is consistent with the real-time system timeline of the source device.

10. A communication device for voice teaching equipment, characterized in that, Includes a controller configured to perform a device communication method for voice teaching as described in claim 1.

Citation Information

Patent Citations

  • Communication method and device for voice teaching, host equipment and storage medium

    CN115209387A