Bluetooth sound box synchronous playing method and system

By building a distributed time synchronization network in Bluetooth speakers, dynamic frequency band allocation, monitoring and adjusting network performance parameters, the audio signal out-synchronization problem caused by inaccurate timestamps and frequency band conflicts in Bluetooth speakers is solved, and high-precision synchronous playback is achieved, improving user experience and application range.

CN119653475AActive Publication Date: 2025-03-18SHENZHEN AOOLIF TECH CO LTD

Patent Information

Application Number
CN202411702711.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-03-18
Estimated Expiration
2044-11-26

AI Technical Summary

Technical Problem

When playing synchronously, the audio signal is out of sync due to the delay in wireless signal transmission and inaccurate timestamps, which affects the auditory experience. The problem is more obvious in large-scale venues such as outdoor music festivals or large conference rooms.

Method used

Through the main device election and the construction of a distributed time synchronization network, time synchronization between speaker groups is achieved; dynamic frequency band allocation is used to avoid frequency band conflicts and interference; monitoring network performance parameters and dynamically adjusting the audio buffer and preloaded segments to cope with network changes; using distributed audio data pre-cache and synchronous playback control to generate an automated synchronous playback control instruction set.

Benefits of technology

It improves the synchronization accuracy of audio signals between multiple speakers, ensures consistency of audio signals, improves user experience, simplifies operational processes, is suitable for large-scale events and commercial venues, and expands the application range of Bluetooth speakers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119653475A_ABST
    Figure CN119653475A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of Bluetooth sound boxes, in particular to a Bluetooth sound box synchronous playing method and system. The method comprises the following steps: performing master device election on a Bluetooth loudspeaker box group to obtain a loudspeaker box group master device identifier; carrying out distributed time synchronization network construction on the Bluetooth sound box group based on the sound box group main equipment identifier to obtain a sound box group time synchronization network; performing environment signal scanning on the Bluetooth sound box group to obtain environment frequency band signal data; performing dynamic frequency band allocation on the Bluetooth loudspeaker box group based on the environment frequency band signal data to obtain a loudspeaker box group frequency band allocation scheme; performing network performance parameter monitoring on the Bluetooth sound box group to obtain a sound box group network performance parameter set; and according to the sound box group network performance parameter set, performing audio buffer area determination on the Bluetooth sound box group to obtain an audio buffer area distribution scheme. According to the invention, the accuracy and stability of audio synchronization are improved, the user experience is optimized, and the application scene of the Bluetooth sound box is widened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Bluetooth speakers, and in particular to a Bluetooth speaker synchronous playback method and system. Background Art

[0002] Bluetooth speaker synchronization technology faces significant challenges in achieving audio signal synchronization between multiple speakers. First, because the communication between Bluetooth speakers relies on wireless signals, the transmission of signals is affected by a variety of factors, such as distance, obstacles, and electromagnetic interference, which can cause delays in the transmission of audio signals. Without precise timestamps and synchronization mechanisms, even a small delay can cause the audio signal to be out of sync, affecting the overall listening experience. This phenomenon is particularly evident in large-scale venues, such as outdoor music festivals or large conference rooms. This is because the distance between the speakers is far, and the delay difference in signal transmission is greater. For example, some users try to synchronize multiple Bluetooth speakers to play music through software such as Airfoil, but if there is a phenomenon of asynchronous playback between the speakers, it is necessary to manually adjust the delay of each device to synchronize the playback. This not only increases the complexity of the user's operation, but also limits the ability of Bluetooth speakers to play synchronously in large-scale events. Summary of the invention

[0003] Based on this, it is necessary for the present invention to provide a Bluetooth speaker synchronous playback method and system to solve at least one of the above technical problems.

[0004] To achieve the above object, a Bluetooth speaker synchronous playback method comprises the following steps:

[0005] Step S1: electing a master device for the Bluetooth speaker group to obtain a master device identifier of the speaker group; constructing a distributed time synchronization network for the Bluetooth speaker group based on the master device identifier of the speaker group to obtain a speaker group time synchronization network;

[0006] Step S2: Scanning the Bluetooth speaker group for environmental signals to obtain environmental frequency band signal data; dynamically allocating frequency bands for the Bluetooth speaker group based on the environmental frequency band signal data to obtain a frequency band allocation scheme for the speaker group;

[0007] Step S3: monitoring the network performance parameters of the Bluetooth speaker group to obtain a network performance parameter set of the speaker group; determining the audio buffer of the Bluetooth speaker group according to the network performance parameter set of the speaker group to obtain an audio buffer allocation scheme; determining the audio preloading segment of the Bluetooth speaker group according to the audio buffer allocation scheme to obtain an audio preloading sequence of the speaker group;

[0008] Step S4: Distributed audio data pre-caching is performed on the Bluetooth speaker group according to the audio buffer allocation scheme and the speaker group audio pre-loading sequence to obtain an audio pre-caching data set; synchronous playback control is performed on the audio pre-caching data set based on the speaker group time synchronization network to obtain a speaker group synchronous playback control instruction set.

[0009] The present invention can provide a unified time reference for a Bluetooth speaker group through the election of a master device and the construction of a distributed time synchronization network, thereby reducing the audio signal delay caused by time asynchronization. This helps to improve the synchronization accuracy of audio signals between multiple speakers, especially in large-scale places, such as outdoor music festivals or large conference rooms, to ensure the consistency of audio signals. By scanning and analyzing the environmental frequency band signal data, the optimal frequency band can be dynamically allocated to each speaker to avoid frequency band conflicts and interference, thereby improving the transmission quality of wireless signals. This method is particularly suitable for scenes with complex electromagnetic environments or multiple interference sources, and can significantly improve the stability and reliability of audio transmission. By monitoring and analyzing the network performance parameters of the Bluetooth speaker group, the change trend of network parameters can be predicted, and the size of the audio buffer and the audio preloaded fragments can be adjusted accordingly. This adaptive adjustment mechanism can better cope with changes in network conditions, such as network congestion or signal fluctuations, thereby maintaining a smooth audio playback experience. By automatically generating a synchronous playback control instruction set, the need for users to manually adjust the delay of each device is reduced. Users no longer need to perform complex settings to automatically ensure the synchronous playback of audio signals between multiple speakers, greatly simplifying the operation process and improving user convenience and satisfaction. Through distributed audio data pre-caching and synchronous playback control of the time synchronization network, more stable audio playback can be achieved between speakers. Even in the case of poor network conditions or interference, delays can be compensated through pre-caching and synchronous control to ensure the continuity and stability of audio playback. The application of this solution is not limited to home environments, but can also meet the needs of large-scale events and commercial venues. By improving the ability of synchronous playback, the application scope of Bluetooth speakers is expanded, and high-quality audio experience can be provided in more occasions, such as public broadcasts, meeting notices, and music performances. In summary, the present invention improves the accuracy and stability of audio synchronization, optimizes the user experience, and broadens the application scenarios of Bluetooth speakers.

[0010] Preferably, the present invention further provides a Bluetooth speaker synchronous playback system, which is used to execute the Bluetooth speaker synchronous playback method as described above, and the Bluetooth speaker synchronous playback system comprises:

[0011] A synchronous network construction module is used to elect a master device for the Bluetooth speaker group and obtain the master device identifier of the speaker group; based on the master device identifier of the speaker group, a distributed time synchronization network is constructed for the Bluetooth speaker group to obtain a speaker group time synchronization network;

[0012] The frequency band allocation module is used to scan the environmental signals of the Bluetooth speaker group to obtain environmental frequency band signal data; dynamically allocate the frequency bands of the Bluetooth speaker group based on the environmental frequency band signal data to obtain a frequency band allocation plan for the speaker group;

[0013] The preloading module is used to monitor the network performance parameters of the Bluetooth speaker group to obtain a set of network performance parameters of the speaker group; determine the audio buffer of the Bluetooth speaker group according to the set of network performance parameters of the speaker group to obtain an audio buffer allocation scheme; determine the audio preloading segment of the Bluetooth speaker group according to the audio buffer allocation scheme to obtain an audio preloading sequence of the speaker group;

[0014] The synchronous playback module is used to pre-cache the distributed audio data of the Bluetooth speaker group according to the audio buffer allocation plan and the audio preloading sequence of the speaker group to obtain an audio pre-cache data set; based on the speaker group time synchronization network, the audio pre-cache data set is synchronously played and controlled to obtain a speaker group synchronous playback control instruction set.

[0015] The present invention realizes the speaker group master device election and the construction of the distributed time synchronization network through the synchronous network construction module, ensures the accuracy of time synchronization between the speaker groups, and thus improves the synchronization efficiency. The frequency band allocation module scans the environmental signal and dynamically allocates the frequency band, so that each speaker works in the optimal frequency band, avoids frequency band conflicts and interference, and optimizes the use of the wireless spectrum. The preloading module dynamically adjusts the audio buffer size and preloading strategy according to the network performance parameter monitoring results, reduces the impact of network fluctuations on audio playback, and enhances the stability of audio playback. Through distributed audio data pre-caching and synchronous playback control, the system can ensure the consistency and continuity of audio data in each speaker, and improves the overall audio playback quality. By automatically executing the generation and execution of the synchronous playback control instruction set, the user's need to manually adjust the settings of each speaker is reduced, the operation process is simplified, and the user experience is improved. Through the time synchronization network and frequency band allocation strategy, the system can adapt to different environments and network conditions, and improve the robustness of the system. The design of the system supports large-scale synchronous playback of speaker groups, is suitable for a wide range of places such as outdoor music festivals and large conference rooms, and broadens the application scenarios of Bluetooth speakers. Through precise synchronization and optimized frequency band allocation, the system can reduce unnecessary signal transmission and retransmission, thereby reducing overall energy consumption. By monitoring network performance parameters and making predictions, the system can make adjustments in advance to reduce network congestion and latency and improve network performance. The system is designed to take interference and network issues into consideration, and ensures the reliability of audio playback through pre-caching and synchronization control mechanisms. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Other features, objects and advantages of the present invention will become more apparent from the detailed description made with reference to the following drawings:

[0017] Figure 1 A schematic flow chart of the steps of a Bluetooth speaker synchronous playback method according to an embodiment is shown.

[0018] Figure 2 A detailed flowchart diagram of step S14 of an embodiment is shown.

[0019] Figure 3 A detailed flow chart of step S28 of an embodiment is shown. DETAILED DESCRIPTION

[0020] The technical method of the present invention is described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by technicians in this field without creative work are within the scope of protection of the present invention.

[0021] In addition, the accompanying drawings are only schematic illustrations of the present invention and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. The functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor methods and / or microcontroller methods.

[0022] It should be understood that, although the terms "first", "second", etc. may be used herein to describe various units, these units should not be limited by these terms. These terms are used only to distinguish one unit from another unit. For example, without departing from the scope of the exemplary embodiments, the first unit may be referred to as the second unit, and similarly the second unit may be referred to as the first unit. The term "and / or" used herein includes any and all combinations of one or more of the listed associated items.

[0023] To achieve this, please refer to Figures 1 to 3 The present invention provides a Bluetooth speaker synchronous playback method, comprising the following steps:

[0024] Step S1: electing a master device for the Bluetooth speaker group to obtain a master device identifier of the speaker group; constructing a distributed time synchronization network for the Bluetooth speaker group based on the master device identifier of the speaker group to obtain a speaker group time synchronization network;

[0025] Step S2: Scanning the Bluetooth speaker group for environmental signals to obtain environmental frequency band signal data; dynamically allocating frequency bands for the Bluetooth speaker group based on the environmental frequency band signal data to obtain a frequency band allocation scheme for the speaker group;

[0026] Step S3: monitoring the network performance parameters of the Bluetooth speaker group to obtain a network performance parameter set of the speaker group; determining the audio buffer of the Bluetooth speaker group according to the network performance parameter set of the speaker group to obtain an audio buffer allocation scheme; determining the audio preloading segment of the Bluetooth speaker group according to the audio buffer allocation scheme to obtain an audio preloading sequence of the speaker group;

[0027] Step S4: Distributed audio data pre-caching is performed on the Bluetooth speaker group according to the audio buffer allocation scheme and the speaker group audio pre-loading sequence to obtain an audio pre-caching data set; synchronous playback control is performed on the audio pre-caching data set based on the speaker group time synchronization network to obtain a speaker group synchronous playback control instruction set.

[0028] In this embodiment, first, professional Bluetooth device management software, such as Bluetooth Device ManagerPro, is used to elect the master device of the Bluetooth speaker group. The software automatically selects the most suitable master device and identifies its master device identification by analyzing the hardware performance and network connection quality data of each speaker. Then, using this identification, a distributed time synchronization network is constructed through the network construction tool built into the software to ensure that all devices in the speaker group can synchronize time, thereby achieving accurate audio synchronization playback. Subsequently, a spectrum analysis tool, such as the wireless spectrum analysis plug-in of Wireshark, is used to perform signal scanning on the environment where the speaker group is located and collect environmental frequency band signal data. These data include signal strength and interference conditions of different frequency bands. According to the collected environmental frequency band signal data, the best frequency band is dynamically allocated to each speaker to form a frequency band allocation scheme for the speaker group. Next, a network monitoring tool, such as PRTG Network Monitor, is used to monitor the network performance parameters of the speaker group and collect a set of network performance parameters including transmission rate, delay and packet loss rate. Based on these parameters, the audio buffer size of each speaker is determined to form an audio buffer allocation scheme. According to the audio buffer allocation scheme, the audio clips that need to be preloaded for each speaker are determined, and the audio preloading sequence of the speaker group is generated. The original audio file is cut using audio processing software, such as Adobe Audition, to generate the corresponding audio preloading clips. Then, according to the audio buffer allocation scheme and the audio preloading sequence of the speaker group, FTP or a similar file transfer protocol is used to pre-cache the audio data in a distributed manner into the cache of each speaker to form an audio pre-cache data set. Finally, based on the speaker group time synchronization network, a synchronous playback control software, such as Synclavier Pro, is used to perform synchronous playback control on the audio pre-cache data set. The software ensures that all speakers play audio according to a predetermined time reference based on the time synchronization network, generates a speaker group synchronous playback control instruction set, and thus realizes the synchronous playback of the speaker group.

[0029] Preferably, step S1 comprises the following steps:

[0030] Step S11: electing a master device for the Bluetooth speaker group to obtain a master device identifier for the speaker group;

[0031] Specifically, please refer to the sub-steps of step S11 for the detailed implementation process of this embodiment.

[0032] Step S12: constructing a hierarchical network topology for the Bluetooth speaker group according to the speaker group master device identifier to obtain a speaker group network topology structure;

[0033] Specifically, the master device can be determined according to the master device identification of the speaker group, assuming that it is the master Bluetooth speaker MB1, which has the highest fitness score. Use network configuration software to assist in building a hierarchical network topology. The software is capable of scanning the surrounding Bluetooth devices and determining their positions in the network topology based on the signal strength of the devices and preset parameters (such as the processing power of the devices, battery life, etc.). First, MB1 is configured as a central node and its instance is the root node in the network topology. Then, the "topology construction" function of the software is used to scan the surrounding slave devices. For example, MB1 finds two speakers, MB2 and MB3, which are close enough and have strong enough signal strength to serve as nodes at the first level. MB2 and MB3 are configured as direct child nodes of MB1. Next, MB2 and MB3 can also search for devices around them, such as MB4 and MB5, which can be connected to MB2 or MB3 as nodes at the second level. Once all speakers are properly placed in the network topology, a hierarchical speaker group network topology is obtained, in which each speaker knows its position in the network and how to communicate with other speakers.

[0034] Step S13: performing bidirectional timestamp exchange on the Bluetooth speaker group according to the speaker group network topology structure to obtain a speaker group timestamp data set;

[0035] Specifically, a time synchronization tool, such as TimeSync Pro, can be used to perform bidirectional timestamp exchange in a speaker cluster network topology. This tool can be run on each speaker and can exchange time information with other speakers in the network. First, starting from the master device MB1, it sends a synchronization request with a timestamp to all directly connected child nodes (such as MB2 and MB3). This request contains the current timestamp of MB1 and a sequence number to identify this synchronization operation. When MB2 and MB3 receive this request, they will record the received timestamp and immediately reply with a response message that contains their own timestamp and the received timestamp. This process is repeated on each node in the network. For example, MB2 will send a synchronization request to its child node (such as MB4) and record the timestamp in MB4's response. In this way, each speaker will collect the timestamp information of all its child nodes, as well as the upstream timestamp information passed down from the master device. In this way, a speaker cluster timestamp dataset is obtained, which contains the send and receive timestamps of each speaker.

[0036] Step S14: performing delay compensation on the Bluetooth speaker group based on the speaker group timestamp data set to obtain an optimized timestamp data set for the speaker group;

[0037] Specifically, please refer to the sub-steps of step S14 for the detailed implementation process of this embodiment.

[0038] Step S15: Perform distributed clock synchronization on the Bluetooth speaker group based on the speaker group optimized timestamp data set to obtain a speaker group time synchronization network.

[0039] Specifically, a network time synchronization protocol, such as the Network Time Protocol (NTP) or the Precision Time Protocol (PTP), can be used to adjust the internal clock of each speaker to ensure that they are consistent with the time of the master device. In this example, it is assumed that PTP is used because it provides higher time synchronization accuracy. First, select the master device MB1 as the clock source of the PTP domain, the so-called PTP Grandmaster Clock. MB1 will be responsible for providing an accurate time reference to other speakers. Use an open source PTP implementation, such as ptpd (PTP Daemon), to configure it as the master clock on MB1 and as slave clocks on all slave devices. Next, start the ptpd service on MB1 and configure it to send time synchronization messages in broadcast mode. These messages contain the precise timestamp of MB1 and related clock quality indicators. Each slave device (such as MB2, MB3, MB4, etc.) also runs ptpd, but is configured in listen mode to receive synchronization messages from MB1. When the slave devices receive synchronization messages from MB1, ptpd calculates the time deviation based on the optimized timestamp data set and adjusts their internal clocks to compensate for this deviation. This process involves calculating the difference between the send and receive timestamps, as well as the network latency, and then adjusting the slave device's clock accordingly. To further improve synchronization accuracy, clock quality algorithms can also be enabled in ptpd, such as the iterative algorithm, which can refine the estimate of time deviation based on data from multiple synchronization cycles. In this way, distributed clock synchronization is achieved throughout the speaker cluster. The clock of each speaker is adjusted to coincide with the time of the master device MB1, forming a time-synchronized network. This network ensures that the audio data is played at the same time on all speakers.

[0040] The present invention enhances the accuracy of time synchronization through the election of master devices and the construction of hierarchical network topology, ensuring the high accuracy of audio synchronous playback. This structure also optimizes the communication path, reduces communication delays, and thus improves network efficiency. The timestamp processing is further optimized through a two-way timestamp exchange mechanism, providing an accurate data basis for delay compensation and clock synchronization. Delay compensation measures reduce the playback differences between speakers, further improving the quality of synchronous playback. In addition, the optimized timestamp data set enhances the robustness of the system, enabling it to better adapt to different network conditions and environmental changes. The implementation of distributed clock synchronization ensures the time consistency of each device in the speaker group. The design of the hierarchical network topology improves the scalability of the system, allowing flexible addition or removal of speaker devices without affecting the synchronization effect.

[0041] Preferably, step S11 includes the following steps:

[0042] Step S111: Initializing the election process of the Bluetooth speaker group, and collecting device performance indicators to obtain a Bluetooth speaker status data set; wherein the Bluetooth speaker status data set includes a number of Bluetooth speaker status data, each Bluetooth speaker status data includes clock stability data, processor performance parameters and network connection quality data;

[0043] Specifically, the Bluetooth device management software can be used to initialize the election process. First, make sure that all Bluetooth speakers are turned on and set to discoverable mode. Then, run the Bluetooth device management software to scan and list all available Bluetooth speakers, which will become potential master device candidates. Next, use standard Bluetooth diagnostic tools, such as the Bluetooth Diagnostic Tool, to collect performance metrics for each speaker. For clock stability data, use a Network Time Protocol (NTP) client to measure the deviation of each speaker's clock from a standard time server. For processor performance parameters, use the system's built-in performance monitoring tools, such as Windows Performance Monitor or Linux perf, to collect processor usage and response time data. For network connection quality data, use the Bluetooth Signal Strength Meter to evaluate the speaker's Bluetooth signal strength and connection stability. All of this data is automatically collected and stored in the status data set of each speaker to form a Bluetooth speaker status data set. For example, if there are five speakers, the status data of each speaker will include its clock stability data (such as time deviation from the NTP server), processor performance parameters (such as processor usage under high load), and network connection quality data (such as signal strength and packet loss rate).

[0044] Step S112: performing a comprehensive fitness evaluation on the corresponding Bluetooth speaker according to the clock stability data, the processor performance parameters and the network connection quality data to obtain device fitness data;

[0045] Specifically, a weight can be assigned to each performance indicator (clock stability data, processor performance parameters and network connection quality data) to reflect its importance in the election of the master device. For example, clock stability is considered to be the most important, and a weight of 0.5 is assigned; processor performance is second, and a weight of 0.3 is assigned; network connection quality is third, and a weight of 0.2 is assigned. Then, these weights are used to calculate the comprehensive fitness score of each speaker. For example, for speaker A, its clock stability score is 90, its processor performance score is 80, and its network connection quality score is 75, then its comprehensive fitness score will be: 0.5×90+0.3×80+0.2×75=85.50.5×90+0.3×80+0.2×75=85.5. After calculating the comprehensive fitness scores for all speakers, they are sorted from high to low by score to determine which speakers are most suitable as the master device. For example, if the comprehensive fitness score of speaker B is 88 and that of speaker C is 82, speaker B will be selected as the primary device candidate and speaker C as the backup candidate. Through this process, a device fitness dataset is obtained, which contains the comprehensive fitness score of each speaker.

[0046] Step S113: Screening candidate devices of the Bluetooth speaker group according to the device suitability data to obtain a master device candidate list;

[0047] Specifically, a threshold, such as 80 points, can be set to determine which speakers are qualified to become master devices. This threshold is set based on the expected performance requirements of the master device. Next, all speakers with fitness scores higher than or equal to this threshold are screened out. For example, if there are ten Bluetooth speakers and six of them have scores of 80 points or above, then these six speakers will be added to the master device candidate list.

[0048] Step S114: performing a clock stability test on the Bluetooth speakers corresponding to the master device candidate list and a network delay test to obtain a clock stability test result set and a network delay test result set;

[0049] Specifically, the internal clock of each candidate speaker can be tested using Chronometer Pro. This tool measures the clock deviation by comparing the speaker's internal clock with an accurate external time source (such as a GPS clock or an Internet time server). The clock deviation data of each speaker is recorded and their average deviation value is calculated. For example, if the average deviation of a speaker over 100 consecutive time intervals is ±0.5 milliseconds, then this data will be recorded in the clock stability test result set. Next, use Network Latency Tester to test the network latency of each candidate speaker. This tool measures network latency by sending data packets to the speaker and calculating the round-trip time. The network latency data of each speaker is recorded and their average latency value is calculated. For example, if the average round-trip latency of a speaker is 10 milliseconds, then this data will be recorded in the network latency test result set.

[0050] Step S115: Perform a final master device election for the Bluetooth speaker group according to the clock stability test result set and the network delay test result set to obtain a master device identifier for the speaker group.

[0051] Specifically, decision support system software, such as Decision Support System for Device Election, can be used to assist in the final election of the master device. First, the clock stability test result set and the network delay test result set are imported into the device election decision support system. These result sets contain detailed test data for each candidate speaker, such as the average and maximum values ​​of the clock deviation and the average and maximum values ​​of the network delay. Next, specific scoring criteria are set for clock stability and network delay. For example, speakers with a clock deviation within ±0.5 milliseconds are considered excellent, speakers with a deviation within ±1 millisecond are considered good, and speakers with a deviation exceeding ±1 millisecond are considered qualified. Similarly, speakers with a network delay within 10 milliseconds can also be considered excellent, speakers with a delay exceeding 10 milliseconds but less than 20 milliseconds are considered good, and speakers with a delay exceeding 20 milliseconds are considered qualified. Then, score each candidate speaker according to these scoring criteria. For example, if the clock deviation of speaker A is ±0.3 milliseconds and the network delay is 8 milliseconds, it will receive an excellent rating for clock stability and an excellent rating for network delay. Calculate a comprehensive score for each speaker, which can be a weighted average of the ratings, with clock stability accounting for 60% and network latency accounting for 40%. Finally, determine the final master device based on the comprehensive score. For example, if speaker A has a comprehensive score of 95 points, speaker B has 88 points, and speaker C has 90 points, then speaker A will be selected as the master device of the group due to its highest comprehensive score. Record the identification information of speaker A, such as its MAC address or device serial number, as the master device identification of the speaker group.

[0052] The present invention significantly improves the election accuracy of the master device, ensures the reliability of time synchronization, and optimizes the network performance of the entire speaker group by comprehensively considering the key performance indicators of clock stability, processor performance, and network connection quality. The robustness of the system in different environments and conditions is enhanced through strict equipment performance indicator collection and comprehensive fitness evaluation, and the selected master device can effectively manage and synchronize the speaker group, reduce the phenomenon of asynchrony in audio playback, and thus provide a higher quality audio experience. In addition, by selecting a device with excellent processor performance as the master device, the processing speed is accelerated and the response speed of the system is improved. The modular election process makes the system easy to expand, and more devices can be easily added without affecting the election process and results. The automated election process reduces manual intervention, simplifies the configuration and management of the system, and reduces the complexity of the system.

[0053] Preferably, step S14 comprises the following steps:

[0054] Step S141: Calculate the time deviation of the Bluetooth speaker group based on the speaker group timestamp data set to obtain a speaker time deviation result set;

[0055] Specifically, the analysis function of Wireshark can be used to calculate the time deviation in the speaker group timestamp data set. For example, if a data packet from speaker A is captured, and its sending time is T1, and the time when speaker B receives the data packet is T2, then the time deviation can be calculated as T2-T1. Perform such calculations on the timestamp data between all speakers to obtain a speaker time deviation result set, which contains the time deviation data between each pair of speakers. This requires multiple such measurements and taking the average value as the final time deviation. For example, repeat the above process 100 times at different time points, then calculate the average time deviation of each pair of speakers, and use this average value as the final data in the speaker time deviation result set.

[0056] Step S142: Designing a PI controller for the Bluetooth speaker group according to the speaker time deviation result set to obtain a speaker group PI controller;

[0057] Specifically, control system design software, such as MATLAB's Control System Toolbox, can be used to design this PI controller. First, import the speaker time deviation result set into MATLAB and analyze the time deviation data. Determine the maximum time deviation in the speaker group and use it as a basis to design the parameters of the PI controller. For example, if the maximum time deviation between speaker A and speaker B is found to be 5 milliseconds, then the goal of designing the PI controller is to reduce this deviation to less than 1 millisecond. Next, use MATLAB's control system design tool to design the PI controller. Set the proportional gain (P) and integral gain (I) and use MATLAB's simulation function to test the performance of the controller. For example, set the proportional gain to 0.5 and the integral gain to 0.1, and test the adjustment effect of this controller on the time deviation in a simulation environment. Adjust the parameters of the PI controller based on the simulation results until a controller design that meets the time synchronization requirements is found. For example, it is found that increasing the proportional gain can respond to the time deviation faster, while increasing the integral gain can eliminate the deviation more smoothly. Finally, a speaker group PI controller is obtained, which can automatically adjust the time synchronization of the speaker group based on the time deviation result set.

[0058] Step S143: calculating the frequency adjustment amount of the speaker group PI controller according to the speaker time deviation result set to obtain frequency adjustment amount data, and performing frequency synchronization adjustment on the speaker group PI controller according to the frequency adjustment amount data to obtain a frequency synchronization signal;

[0059] Specifically, you can use automated control system analysis tools, such as the Control System Module of LabVIEW, to perform frequency adjustment calculations and frequency synchronization adjustments. First, import the speaker time deviation result set into LabVIEW and use its built-in data analysis functions to identify the trend and magnitude of the time deviation. For example, it is found that there is a persistent time deviation between speaker A and the master device, which gradually increases over time. Next, use the Control System Design Module of LabVIEW to design a PI controller that can calculate the frequency adjustment based on the time deviation. Set the proportional (P) and integral (I) parameters of the PI controller to respond to the time deviation. For example, set the proportional gain to 0.8 and the integral gain to 0.05. Then, use the simulation function of LabVIEW to test the performance of the PI controller to ensure that it can accurately calculate the frequency adjustment. In the simulation test, input the time deviation data and observe the frequency adjustment output by the PI controller. Adjust the parameters of the PI controller until it can produce the appropriate frequency adjustment to compensate for the time deviation between the speakers. Once satisfactory results are obtained, these frequency adjustment data are applied to the speaker group PI controller for actual frequency synchronization adjustment. This results in a frequency synchronization signal that can be used to adjust the speaker's clock frequency to reduce time deviation.

[0060] Step S144: calculating the phase adjustment amount of the speaker group PI controller according to the speaker time deviation result set to obtain phase adjustment amount data, and performing phase fine-tuning on the frequency synchronization signal according to the phase adjustment amount data to obtain a phase synchronization signal;

[0061] Specifically, you can use a time synchronization analysis tool, such as the Phase Alignment Tool, to perform phase adjustment calculations and phase fine-tuning. First, import the speaker time deviation result set into the Phase Alignment Tool and use its analysis function to determine the phase difference between the speakers. For example, it is found that the clock phase of speaker B is 1 microsecond ahead of the master device. Next, use the design function of the Phase Alignment Tool to calculate the required phase adjustment. Set the parameters of the PI controller based on the time deviation and phase difference to fine-tune the phase. For example, set the proportional gain to 0.5 and the integral gain to 0.02. Then, use the simulation function of the Phase Alignment Tool to test the performance of the PI controller to ensure that it can accurately calculate the phase adjustment. In the simulation test, enter the time deviation and phase difference data and observe the phase adjustment output by the PI controller. Adjust the parameters of the PI controller until it can produce the appropriate phase adjustment to compensate for the phase difference between the speakers. Once satisfactory results are obtained, apply these phase adjustment data to the frequency synchronization signal to perform actual phase fine-tuning. This results in a phase sync signal that can be used to adjust the speaker's clock phase.

[0062] Step S145: performing synchronization accuracy evaluation on the phase synchronization signal to obtain a synchronization accuracy evaluation result;

[0063] Specifically, you can use a time analysis tool, such as TimeSync Precision Analyzer, to measure and evaluate the synchronization accuracy of a speaker cluster. First, configure TimeSync Precision Analyzer to monitor the phase synchronization signal in the speaker cluster. This tool can accurately measure the time signal and provide detailed statistics, such as the mean deviation, standard deviation, and maximum deviation. Select a few representative speakers from the speaker cluster, and then use TimeSync Precision Analyzer to collect synchronization data for these speakers over a period of time. For example, record the clock state of all speakers every millisecond for 10 seconds. Next, analyze this data and calculate the synchronization accuracy of the speaker cluster. The key indicator of interest is the standard deviation of the clock state of all speakers, which reflects the synchronization consistency of the speaker cluster. For example, if the analysis result shows a standard deviation of 0.1 milliseconds, it means that the clock states of the speaker cluster differ from each other by at most 0.1 milliseconds. Finally, generate a synchronization accuracy evaluation result based on this data. If the synchronization accuracy meets the preset standard (for example, the standard deviation is less than 0.5 milliseconds), the synchronization is considered successful. If the synchronization accuracy does not meet the standard, make further adjustments.

[0064] Step S146: determining a transition mechanism for the phase synchronization signal according to the synchronization accuracy evaluation result to obtain a synchronization signal transition strategy, and setting a maximum adjustment limit for the synchronization signal transition strategy to obtain maximum adjustment limit data;

[0065] Specifically, you can use a control strategy design tool, such as Control Strategy Designer, to design and simulate different transition strategies. First, input the synchronization accuracy evaluation results into ControlStrategy Designer and define the synchronization signal transition target based on these results. For example, if the current synchronization accuracy standard deviation is 0.1 milliseconds, set a goal to further reduce this value to 0.05 milliseconds. Next, use Control Strategy Designer to simulate different synchronization signal transition strategies and evaluate their effectiveness. For example, try different adjustment algorithms, such as linear adjustment, exponential decay adjustment, or step adjustment, to see which one can achieve the synchronization target fastest while avoiding instability caused by over-adjustment. After determining the most effective transition strategy, you also need to set a maximum adjustment limit. This limit will prevent the synchronization signal from being adjusted beyond a safe threshold to avoid system instability. For example, set a rule that any single adjustment must not exceed 0.01 milliseconds. Finally, you get a synchronization signal transition strategy and maximum adjustment limit data.

[0066] Step S147: Perform timestamp correction on the speaker group timestamp data set according to the synchronization signal transition strategy and the maximum adjustment limit data to obtain an optimized timestamp data set for the speaker group.

[0067] Specifically, timestamp correction can be performed using a time correction software tool, such as the Timestamp Correction Utility. First, enter the synchronization signal transition strategy and maximum adjustment limit data into the Timestamp Correction Utility. This data includes the adjustment direction (increase or decrease the timestamp), the adjustment step size, and the maximum limit of a single adjustment for each speaker. Next, collect the current timestamp data from the speaker group. For example, it is found that the current timestamp of speaker A is 2 milliseconds faster than the master device, while speaker B is 1 millisecond slower. According to the synchronization signal transition strategy, the timestamp of speaker A needs to be reduced and the timestamp of speaker B needs to be increased to synchronize them with the clock of the master device. Then, use the Timestamp Correction Utility to calculate the timestamp adjustment required for each speaker. This tool will take into account the maximum adjustment limit to ensure that any single adjustment will not exceed the set safety threshold. For example, if speaker A needs to reduce the timestamp by 5 milliseconds, but the maximum adjustment limit is 1 millisecond, then the Timestamp Correction Utility will make adjustments in five times, reducing 1 millisecond each time. After each adjustment, the timestamp data is collected again and the Timestamp Correction Utility is used to verify the effect of the adjustment. If the synchronization accuracy after adjustment does not meet the expected target, or if over-adjustment occurs, the transition strategy and maximum adjustment limit data are adjusted according to the actual situation, and then correction is performed again. Finally, after a series of corrections and verifications, an optimized timestamp data set is obtained, in which the timestamp of each speaker has been adjusted to achieve synchronization with the master device.

[0068] The present invention significantly improves the time synchronization accuracy between speaker groups by accurately calculating the time deviation of the speaker group and performing detailed frequency and phase synchronization adjustments. By designing a PI controller and dynamically adjusting it according to real-time data, it can adapt to environmental changes and maintain a stable synchronization state, thereby optimizing the audio playback experience and reducing delays and jitters in playback. The robustness of the system is enhanced by the introduction of synchronization accuracy evaluation and transition mechanism, ensuring stable adjustment in the face of time deviation. The flexibility of the system is improved by setting the maximum adjustment limit, so that it can adapt to different speaker characteristics and network conditions, while ensuring the smooth transition of the synchronization signal, avoiding sudden jumps during the adjustment process, and ensuring the continuity and stability of audio playback. The real-time nature of timestamp correction improves the response speed of the system, and the evaluation of synchronization accuracy enhances the prediction ability of the system, so that it can adapt to future time deviations in advance. The complexity of the system is reduced by automated time deviation calculation and synchronization signal adjustment, simplifying configuration and management.

[0069] Preferably, step S2 comprises the following steps:

[0070] Step S21: Scanning the Bluetooth speaker group for environmental signals to obtain environmental frequency band signal data;

[0071] Specifically, a wireless spectrum analyzer, such as the R&S FSH3 spectrum analyzer, can be used to perform environmental signal scanning. First, configure the working parameters of the spectrum analyzer and set the scanning frequency range to cover the frequency band used by the Bluetooth speakers, usually the 2.4GHz ISM band. Next, deploy the spectrum analyzer in the environment where the Bluetooth speaker cluster is located. Scanning needs to be performed at different locations to ensure that comprehensive signal data is collected. For example, if multiple Bluetooth speakers are deployed in a large conference room, scanning needs to be performed in every corner of the room and at the midpoint between the speakers. Then, start the spectrum analyzer for signal scanning. The spectrum analyzer will record all detected signals within the set frequency range, including wireless routers, other Bluetooth devices, microwave ovens and other devices that may cause interference. Record information such as the frequency, strength and occupancy time of these signals to form an environmental frequency band signal data set.

[0072] Step S22: segmenting the environmental frequency band signal data to obtain segmented signal data;

[0073] Specifically, signal processing software, such as MATLAB's Signal Processing Toolbox, can be used to perform signal segmentation. First, the ambient frequency band signal data is imported into MATLAB, and the data is preprocessed using its built-in signal processing functions. Next, the signal data is divided into different segments based on the characteristics of the signal, such as frequency, bandwidth, and signal strength. For example, the 2.4GHz band is divided into 20 100MHz sub-bands, and the signal conditions in each sub-band are analyzed separately. Then, the signals in each segment are analyzed in detail, including the type, source, and degree of interference of the signal. Use MATLAB's clustering analysis tool to identify and classify different signals. For example, Wi-Fi signals, Bluetooth signals, and signals of other wireless devices are classified into different categories. Finally, a segmented signal data set is obtained, which contains detailed information about the signals in each segment.

[0074] Step S23: identifying potential interference sources on the segmented signal data to obtain potential interference source data;

[0075] Specifically, interference source identification can be performed using wireless signal analysis software, such as Wireshark, in conjunction with a wireless spectrum analyzer, such as R&S FSH3. First, use the R&S FSH3 spectrum analyzer to perform a detailed spectrum scan in the operating environment of the Bluetooth speaker group. The spectrum analyzer can capture the frequency band and strength information of all wireless signals in the environment. Export the scan results as input data for subsequent analysis. Next, use the Wireshark software to open these data files and use its filtering and analysis functions to identify potential interference sources. For example, set filtering rules to find devices with high signal strength in a specific frequency band, because these devices will interfere with the signal transmission of the Bluetooth speaker. Analyze the signal characteristics in each frequency band, such as the modulation mode, bandwidth, and signal strength of the signal, to determine whether they are interference sources. For example, it is found that in the 2.4GHz frequency band used by the Bluetooth speaker, there is a Wi-Fi router with a very strong signal, which is a potential interference source. Record the detailed information of these potential interference sources, including their frequency, strength, and device type, to form a potential interference source data set.

[0076] Step S24: performing low-intensity signal recognition on the segmented signal data to obtain low-intensity signal segment data;

[0077] Specifically, signal processing software, such as MATLAB's Signal Processing Toolbox, can be used to perform low-intensity signal identification. First, the segmented signal data is imported into MATLAB and analyzed using its built-in signal processing functions. The power spectral density estimation function is used to calculate the power level of each signal segment. Next, a power threshold is set to define what is a "low-intensity" signal. For example, a signal below -70dBm is defined as a low-intensity signal. Then, the logical indexing function of MATLAB is used to filter out all signal segments below this threshold. These low-intensity signal segments are further analyzed to determine whether they are suitable for Bluetooth speaker communication. For example, check whether these signal segments are frequently used by other devices or whether they have sufficient bandwidth to support data transmission of Bluetooth speakers. The detailed information of these low-intensity signal segments, including their frequency range, average power level, and occupancy, is recorded to form a low-intensity signal segment dataset.

[0078] Step S25: performing frequency band stability evaluation on the segmented signal data to obtain a frequency band stability report;

[0079] Specifically, signal analysis software, such as MATLAB, combined with its Signal Processing Toolbox, can be used to perform frequency band stability assessment. First, the segmented signal data is imported into MATLAB, and the power spectral density analysis tool is used to calculate the signal strength and changes of each frequency band. The pwelch function is used to estimate the power spectral density of each frequency band, and a spectrum is plotted to visualize the signal strength of each frequency band. Next, a stability assessment criterion is set, for example, the standard deviation of the signal strength of the frequency band within a certain period of time should be lower than a certain threshold (such as 3dB) to be considered stable. The signal strength of each frequency band is statistically analyzed to calculate its average and standard deviation. Then, these results are organized into a frequency band stability report, which includes the average signal strength, standard deviation, and stability assessment results of each frequency band. For example, if the average signal strength of frequency band 1 is -60dBm and the standard deviation is 2dB, the frequency band is evaluated as stable; while if the standard deviation of frequency band 2 is 5dB, the frequency band is evaluated as unstable. Finally, the frequency band stability report is saved as a document.

[0080] Step S26: extracting interference source characteristics from the potential interference source data based on the environmental frequency band signal data to obtain potential interference source characteristic data, and identifying the potential interference source type from the potential interference source data based on the potential interference source characteristic data to obtain potential interference source type data;

[0081] Specifically, data analysis software, such as Python's Pandas and Scikit-learn libraries, can be used to perform interference source feature extraction. First, the ambient frequency band signal data and potential interference source data are imported into Python, and the Pandas library is used to clean and organize the data. Features related to potential interference sources, such as signal frequency, strength, duration, and modulation mode, are extracted. Next, feature extraction algorithms, such as principal component analysis (PCA), are used to reduce the dimensions of the data and extract the most important features. For example, it is found that the signal strength and modulation mode in certain frequency ranges are similar to Wi-Fi signals, while other signals are generated by Bluetooth devices or microwave ovens. Then, classification algorithms in the Scikit-learn library, such as support vector machines (SVM) or decision trees, are used to identify the types of potential interference sources. The extracted feature data is trained with known interference source types to build a classification model. Through this model, the type of new potential interference sources can be predicted. Finally, the identified potential interference source type data is organized into a report, which includes the characteristics and identification results of each interference source. For example, the report showed that the interference source on one frequency band was identified as a Wi-Fi router, while the interference source on another frequency band was identified as a Bluetooth device.

[0082] Step S27: Calculate the frequency band occupancy of the segmented signal data according to the low-intensity signal segment data, the frequency band stability report and the potential interference source type data to obtain frequency band occupancy distribution data, and generate a spectrum occupancy heat map for the frequency band occupancy distribution data to obtain a spectrum occupancy heat map;

[0083] Specifically, professional data analysis and visualization tools, such as Python with its Matplotlib and Seaborn libraries, can be used to perform spectrum occupancy heat map generation. First, the low-intensity signal segment data, band stability report, and potential interference source type data are imported into the Python environment. Using the Pandas library, these data are integrated into a unified data frame. Next, the occupancy of each band is calculated. This can be achieved by counting the number of low-intensity signal segments in each band and comparing it with the total number of signal segments in the band. For example, if there are 10 signal segments in a band, 3 of which are low-intensity signal segments, then the occupancy of the band is 30%. Taking the band stability report into account, only the occupancy of those bands that are evaluated as stable is calculated. For unstable bands, their occupancy is set to zero because they are not suitable for communication with Bluetooth speakers. Then, Matplotlib and Seaborn libraries are used to generate a heat map of the band occupancy distribution data. A heat map is a way to intuitively display data distribution, where different colors represent different occupancies. For example, frequency bands with occupancy rates below 20% are represented in green, those between 20% and 50% are represented in yellow, and those above 50% are represented in red. In the heat map, the horizontal axis represents different frequency bands, the vertical axis represents time or different measurement points, and the depth of the color represents the occupancy rate. In this way, it is possible to intuitively see which frequency bands have lower occupancy rates at which time points, thus providing a basis for the dynamic frequency band allocation of Bluetooth speakers.

[0084] Step S28: dynamically allocate frequency bands to the Bluetooth speaker group according to the spectrum occupancy heat map to obtain a frequency band allocation plan for the speaker group.

[0085] Specifically, please refer to the sub-steps of step S28 for the detailed implementation process of this embodiment.

[0086] The present invention realizes the effective identification and utilization of low-intensity signal bands and high-stability frequency bands through comprehensive environmental signal scanning and analysis, and significantly improves the utilization efficiency of spectrum resources. The present invention can actively identify and avoid potential interference sources, greatly reducing the impact of external interference on audio transmission. Through the frequency band stability evaluation, the best frequency band can be selected for communication, the signal transmission quality is optimized, and the transmission reliability is enhanced. The dynamic frequency band allocation strategy gives the system the ability to quickly adapt to real-time environmental changes, ensuring the continuity and stability of audio data transmission, thereby significantly improving the user's audio playback experience. The automated signal processing and frequency band allocation process reduces manual intervention. The present invention can adapt to speaker groups of different sizes and changeable wireless environments. The optimized frequency band allocation also helps to reduce retransmissions caused by frequency band conflicts and reduces the energy consumption of the system. In summary, the anti-interference ability of the present invention in complex electromagnetic environments has been significantly improved, providing strong support for the stable operation of Bluetooth speaker groups.

[0087] Preferably, step S28 comprises the following steps:

[0088] Step S281: constructing a spectrum diagram for the spectrum occupancy heat map to obtain a frequency band spectrum diagram for the speaker group, and performing device node mapping on the frequency band spectrum diagram for the speaker group and the Bluetooth speaker group to obtain a spectrum node diagram for the speaker group;

[0089] Specifically, wireless network planning and analysis software, such as iBwave Design Suite, can be used to perform spectrum graph construction. First, use the spectrum analysis tool in iBwave Design Suite to process the spectrum occupancy heat map. This tool can identify different color areas in the heat map and convert them into frequency band spectrum maps. For example, the green area (low occupancy) in the heat map is converted into a low-occupancy frequency band in the spectrum map, and the yellow and red areas are converted into medium and high occupancy frequency bands, respectively. Next, import the device node information of the speaker group into iBwave Design Suite. This information includes the location, direction, and signal coverage of each speaker. Use the mapping function of the software to match the frequency band spectrum map with the device node of the speaker group to create a speaker group spectrum node map. In this map, each speaker node is connected to the corresponding frequency band spectrum, showing the potential frequency bands used by each speaker. For example, if speaker A is located in a corner of the conference room, its corresponding spectrum node map will show the frequency band occupancy in this area. If the frequency band occupancy in this area is low, the software will recommend that speaker A use these frequency bands for communication. In this way, a detailed speaker group spectrum node map can be obtained.

[0090] Step S282: measuring the spatial distribution of the Bluetooth speaker group to obtain a spatial distribution diagram of the speaker group, and determining the signal propagation characteristics of the Bluetooth speaker group to obtain signal propagation characteristic data of the speaker group;

[0091] Specifically, spatial distribution measurements can be performed using geographic information system (GIS) software, such as ArcGIS, and wireless signal propagation analysis tools, such as Atenna-Fi. First, use ArcGIS software to perform spatial distribution measurements of the environment where the Bluetooth speaker cluster is located. Enter or import map data of the conference room or event venue, and mark the precise location of each Bluetooth speaker on the map. This data can be entered manually or automatically acquired by communicating with the speaker's GPS module. Next, use Atenna-Fi software to simulate the signal propagation characteristics of the speaker cluster. Enter the spatial distribution data of the speakers, as well as the physical characteristics of the environment, such as walls, furniture, and other obstacles that affect signal propagation. Atenna-Fi software will use this data to simulate the propagation of the signal in the environment, including signal attenuation, reflection, and diffraction. For example, if speaker B is located near a wall, Atenna-Fi software predicts that the signal attenuation in this area is greater. Record these signal propagation characteristic data, including signal strength, coverage, and potential interference areas. Finally, a speaker cluster spatial distribution map and a set of speaker cluster signal propagation characteristic data are obtained.

[0092] Step S283: defining spectrum constraints for the Bluetooth speaker group according to the speaker group spatial distribution diagram and the speaker group signal propagation characteristic data to obtain a speaker group spectrum constraint set;

[0093] Specifically, a wireless network planning tool, such as AirMagnet Planner, can be used to perform spectrum constraint definition. First, the spatial distribution map of the speaker group and the signal propagation characteristic data are imported into AirMagnet Planner. These data include information such as the location of the speakers, the signal coverage range, and the physical obstacles in the environment. Next, the spectrum constraints are defined based on these data. For example, a constraint is set that stipulates that speakers near walls or metal objects cannot use frequency bands that are easily affected by reflection and diffraction. In addition, the thresholds of minimum and maximum signal strengths are defined based on the signal propagation characteristic data to ensure the communication quality between speakers. The spectrum usage range of each speaker can also be defined by considering the distance and direction between the speakers, as well as the signal overlap between them. For example, if two speakers are very close to each other, they are restricted to use the same frequency band to avoid mutual interference. Finally, a speaker group spectrum constraint set is obtained, which contains all the defined spectrum usage rules. These rules will be used in the subsequent frequency band allocation process to ensure that each speaker is allocated to a suitable frequency band.

[0094] Step S284: applying a graph coloring algorithm to the speaker group spectrum node graph and the speaker group spectrum constraint set to obtain an initial frequency band allocation graph of the speaker group;

[0095] Specifically, graph theory and optimization algorithm software, such as MATLAB's Optimization Toolbox, can be used to perform graph coloring algorithm applications. First, the speaker cluster spectrum node graph and spectrum constraint set are imported into MATLAB, and its graph theory functions are used to build a graph model. In this model, each speaker node represents a device that needs to be assigned a frequency band, and the spectrum constraint is converted into the edge of the graph, representing the potential interference relationship between the speakers. Next, a graph coloring algorithm is applied to assign a color to each node in the graph, where each color represents a different frequency band. The goal is to ensure that any two adjacent nodes (i.e., interfered speakers) are not assigned the same color (frequency band). MATLAB's Optimization Toolbox provides a variety of graph coloring algorithms, and you can choose an algorithm that suits the scale and complexity of the problem. For example, use a heuristic algorithm, such as a greedy coloring algorithm, to quickly find a feasible frequency band allocation solution. You can also try more advanced algorithms, such as a coloring algorithm based on linear programming, to find the optimal frequency band allocation solution. Finally, the initial frequency band allocation graph of the speaker cluster is obtained, in which each speaker node is assigned a color, representing its initial frequency band allocation.

[0096] Step S285: performing frequency band allocation conflict identification on the initial frequency band allocation diagram of the speaker group to obtain a frequency band conflict identification result, and backtracking and adjusting the initial frequency band allocation diagram of the speaker group according to the frequency band conflict identification result to obtain a frequency band allocation plan for the speaker group.

[0097] Specifically, a wireless network optimization tool, such as Wi-Fi Planner Professional, can be used to perform frequency band allocation conflict identification. First, import the initial frequency band allocation map of the speaker cluster into Wi-Fi Planner Professional and use its built-in frequency band conflict detection function to identify allocation conflicts. The tool can automatically compare the allocation map with the previously defined spectrum constraint set to check for any violation of the constraint. For example, suppose a rule is defined in the spectrum constraint set that adjacent speakers cannot use the same frequency band to avoid interference. Wi-Fi Planner Professional will check the allocation map, identify any speaker pairs that violate this rule, and report potential conflicts. Once conflicts are identified, use Wi-Fi Planner Professional's adjustment suggestion feature to backtrack and adjust the initial frequency band allocation map. The tool can provide adjustment suggestions, such as changing the frequency band assignment of the conflicting speaker, or adjusting the assignment of other speakers to resolve the conflict if necessary. For example, if the tool finds that speaker A and speaker B are incorrectly assigned to the same frequency band, it will recommend changing the frequency band of speaker B to a non-conflicting frequency band. The allocation map is adjusted manually or automatically based on these suggestions until all conflicts are resolved. During the adjustment process, multiple iterations are required, and conflict detection is rerun each time until a frequency band allocation solution is found that satisfies all spectral constraints. Finally, an optimized frequency band allocation solution for the speaker group is obtained.

[0098] The present invention realizes accurate spectrum management by constructing a frequency band spectrum diagram and a spectrum node diagram of a speaker group, optimizes the signal propagation path of the speaker group, and defines an enhanced spectrum constraint set according to the spatial distribution and signal propagation characteristics, thereby improving the scientificity and rationality of spectrum allocation. Through the efficient frequency band allocation by applying the graph coloring algorithm, and through the identification and adjustment of frequency band allocation conflicts, frequency band conflicts are reduced and the feasibility of allocation is ensured. This improves the quality and stability of signal transmission, enhances the adaptability and flexibility of the system, enables it to intelligently allocate frequency bands according to the actual environment, and reduces retransmission and energy consumption caused by frequency band conflicts.

[0099] Preferably, step S3 comprises the following steps:

[0100] Step S31: monitoring the network performance parameters of the Bluetooth speaker group to obtain a speaker group network performance parameter set;

[0101] Specifically, you can use a comprehensive network analysis tool, such as SolarWinds Network Performance Monitor (NPM), which provides real-time network monitoring and performance data collection capabilities. First, install a lightweight monitoring agent on each Bluetooth speaker, which can collect key network performance indicators including signal strength, transmission rate, packet loss rate, latency, etc. These agents are configured to periodically send the collected data to a central server on which SolarWinds NPM is installed. Next, configure SolarWinds NPM to receive and store this data. Set alarm thresholds to notify immediately when network performance parameters exceed the normal range. For example, if the delay exceeds 100 milliseconds or the packet loss rate is higher than 5%, the system will automatically issue an alarm. Then, use the reporting function of NPM to generate a set of network performance parameters for the speaker group. This parameter set contains the network performance data of all speakers over a period of time. Finally, export this parameter set as a structured data file, such as CSV format.

[0102] Step S32: using the speaker group network performance parameter set to perform model training on a preset long short-term memory neural network architecture to obtain a speaker group network performance time series model;

[0103] Specifically, a deep learning framework, such as TensorFlow, can be used to build and train the model. First, the LSTM model is built using the Python programming language and the TensorFlow library. The architecture of the model is defined, including an input layer, one or more LSTM layers, and an output layer. For example, a model with two LSTM layers is set up, each with 128 units. Next, the data is prepared, and the data in the network performance parameter set is divided into a feature set and a label. The feature set contains the current and historical network performance parameters used to predict future network performance, while the label is the target parameter that the model is expected to predict, such as future latency or packet loss rate. Then, the LSTM model is trained using the feature set and the label. During the training process, the performance of the model is monitored, and the prediction accuracy of the model is evaluated using indicators such as mean squared error (MSE) or mean absolute error (MAE). The parameters of the model, such as the learning rate, batch size, or the number of LSTM layers, need to be adjusted several times to optimize the performance of the model. Finally, after the training is completed, the model is evaluated using the validation dataset. If the model meets the predetermined performance criteria, it is saved as a speaker cluster network performance timing model. This model is able to predict future network performance based on historical and current network performance parameters.

[0104] Step S33: using the speaker group network performance time series model to predict network parameter changes in a preset future time window to obtain a short-term network performance prediction result set;

[0105] Specifically, the Python programming language can be used with deep learning libraries such as TensorFlow or Keras to perform network parameter change prediction. First, load the speaker group network performance time series model and set the time window you want to predict. For example, you want to predict the network performance parameters every 5 minutes in the next 24 hours. Next, prepare the input data, which includes historical network performance parameters, such as signal strength, transmission rate, packet loss rate, and latency over the past period of time. Format this data into an input form that the model can accept, for example, create a time series dataset in which the data at each time point is an input sample. Then, use the model to predict this time series dataset. The model will output the predicted network performance parameters at each time point, such as predicted signal strength, transmission rate, etc. Collect these prediction results to form a short-term network performance prediction result set. This result set contains the predicted values ​​of network performance parameters at each time point in the future time window.

[0106] Step S34: performing a network quality score on the Bluetooth speaker group according to the short-term network performance prediction result set to obtain a network quality score for the speaker group;

[0107] Specifically, a custom scoring algorithm can be used, which can be a simple script or a machine learning model. First, define the criteria for network quality scoring. For example, network quality is evaluated based on parameters such as signal strength, transmission rate, packet loss rate, and delay. Set a scoring range for each parameter, such as 1 to 5 points, where 5 points indicates the best performance. Next, we calculate the network quality score at each time point based on the network performance parameters in the prediction result set. For example, if the predicted signal strength is higher than a certain threshold, a higher score is given; if the packet loss rate is higher than a certain threshold, a lower score is given. The weighted average method can be used to calculate the total network quality score, in which the weight of each parameter reflects its impact on the overall network quality. For example, a higher weight is given to the transmission rate because it has a greater impact on the synchronous playback of audio. Then, a network quality score is generated for each speaker, and these scores are organized into a speaker group network quality score set.

[0108] Step S35: adjusting the buffer factor of the Bluetooth speaker group according to the speaker group network quality score to obtain a speaker group buffer factor set; wherein the speaker group buffer factor set includes a basic buffer factor, a network quality adjustment factor and a bandwidth utilization factor;

[0109] Specifically, three main buffer factors can be defined: a basic buffer factor, a network quality adjustment factor, and a bandwidth utilization factor. The basic buffer factor is a preset value that is used to ensure basic playback smoothness. The network quality adjustment factor adjusts the buffer size based on the network quality score, while the bandwidth utilization factor optimizes the buffer size based on the current bandwidth usage. Use a script or software program to implement the buffer factor adjustment. For example, set an algorithm that reduces the network quality adjustment factor when the network quality score is above a certain threshold to reduce the buffer size and improve the response speed; when the score is below the threshold, increase the network quality adjustment factor to increase the buffer size and reduce the possibility of lag. Next, collect current bandwidth utilization data, which can be obtained through a network monitoring tool. Use this data to calculate the bandwidth utilization factor, which can adjust the buffer size based on the current network load. Then, combine these factors to calculate a total buffer factor for each speaker. For example, if the basic buffer factor is 10 seconds, the network quality adjustment factor is 5 seconds (because the network score is low), and the bandwidth utilization factor is 2 seconds (because the bandwidth utilization is high), then the total buffer factor is 17 seconds. Finally, a set of buffer factors of the speaker group is obtained, which includes the total buffer factor of each speaker.

[0110] Step S36: performing network jitter compensation calculation on the Bluetooth speaker group according to the short-term network performance prediction result set to obtain a speaker group jitter compensation factor set; wherein the speaker group jitter compensation factor set includes a jitter standard deviation factor, a jitter trend factor, and a jitter prediction compensation factor;

[0111] Specifically, a data analysis software, such as Python with NumPy and SciPy libraries, can be used to perform network jitter compensation calculations. First, extract network jitter-related data, such as delay changes and packet loss events, from the short-term network performance prediction result set. Use this data to calculate the jitter standard deviation factor, which reflects the degree of network jitter. Next, analyze the trend of network jitter. For example, it is found that the network jitter has an increasing trend in a specific time period. Use this information to calculate the jitter trend factor, which can predict future changes in network jitter. Then, combine the jitter standard deviation factor and the jitter trend factor to calculate the jitter prediction compensation factor. This factor is used to adjust the preloading and buffering strategy of audio data to compensate for the impact of network jitter. For example, if the prediction results show that network jitter will increase in the future, increase the jitter prediction compensation factor to increase the buffer size and reduce potential playback interruptions. Finally, a set of jitter compensation factors for the speaker group is obtained, which contains the jitter compensation factor for each speaker.

[0112] Step S37: Calculate the buffer size of the Bluetooth speaker group according to the speaker group buffer factor set and the speaker group jitter compensation factor set to obtain an audio buffer allocation plan, and determine the audio preloading segment of the Bluetooth speaker group to obtain an audio preloading sequence of the speaker group.

[0113] Specifically, please refer to the sub-steps of step S37 for the detailed implementation process of this embodiment.

[0114] The present invention uses a long short-term memory neural network architecture to conduct in-depth time series modeling and prediction of the network performance of the Bluetooth speaker group, significantly improving the accuracy of predicting the future network state. Based on these prediction results, the buffer size can be dynamically adjusted and the buffer management can be optimized to make it more flexible and efficient to adapt to the changing network conditions. The prediction and compensation of network jitter effectively reduce its impact on the audio stream, thereby improving the stability and fluency of audio playback and further enhancing the user's auditory experience. The present invention can automatically adjust the buffer parameters according to the real-time network status to better adapt to different network environments. By predicting network parameter changes in advance and making corresponding buffer adjustments, not only the potential delay is reduced, but also the data transmission efficiency is improved. Through the automated network performance monitoring and prediction process, manual intervention is reduced, the intelligence level of the system is improved, and network quality management is more efficient. At the same time, by reasonably allocating buffer resources, the system can make more full use of available bandwidth, improve the utilization rate of overall network resources, and provide a strong guarantee for the stable operation of the Bluetooth speaker group in a complex network environment.

[0115] Preferably, step S37 includes the following steps:

[0116] Step S371: Calculating the expected playback delay of the Bluetooth speaker group based on the speaker group buffer factor set to obtain an expected playback delay matrix;

[0117] Specifically, the structure of the play delay expectation matrix can be defined, which includes the buffer factor of each speaker, the expected network delay, and the expected total play delay. Use a table or database to store this data. Next, the expected play delay of each speaker is calculated based on the set of buffer factors of the speaker group, including the basic buffer factor, the network quality adjustment factor, and the bandwidth utilization factor. For example, the expected play delay is calculated using the following formula: Expected play delay = basic buffer factor + (network quality adjustment factor × network quality score) + (bandwidth utilization factor × bandwidth utilization); calculate the expected play delay for each speaker and fill these values ​​into the play delay expectation matrix. This matrix can provide the expected delay of each speaker under different network conditions. Finally, the play delay expectation matrix is ​​obtained, which contains the expected play delay of each speaker in the speaker group.

[0118] Step S372: measuring the audio flow rate of the Bluetooth speaker group to obtain an audio flow rate feature vector;

[0119] Specifically, audio flow rate measurement can be performed using an audio analysis tool, such as Audacity, in conjunction with a network monitoring tool, such as Wireshark. First, configure Wireshark to capture the network traffic of the Bluetooth speaker group, especially the packets related to the audio stream. Pay attention to the size and transmission time of these packets, because this information helps determine the speed of the audio stream. Next, use Audacity to play the audio and monitor the real-time speed of the audio stream. Record the transmission rate of the audio data, which involves measuring the amount of audio data transmitted in a specific time. Then, use this data to calculate the audio flow rate feature vector. This vector includes the average flow rate, the range of the flow rate, and the peak information of the flow rate. Use statistical methods, such as calculating the mean, standard deviation, and maximum value, to obtain these features. For example, if the average audio flow rate measured on a speaker over a period of time is 500kbps, the standard deviation is 50kbps, and the maximum value is 600kbps, then these values ​​will be included in the audio flow rate feature vector. Finally, the audio flow rate feature vector is obtained, which provides detailed information about the audio flow rate of each speaker in the speaker group.

[0120] Step S373: Calculate the buffering requirement of the Bluetooth speaker group according to the play delay expectation matrix and the audio flow rate feature vector to obtain a speaker group buffering requirement data set;

[0121] Specifically, a data processing and analysis software, such as Python with the Pandas library, can be used to perform buffering requirement calculations. Import the expected playback delay matrix and the audio flow rate feature vector into the Python environment. These data include the expected playback delay and audio flow rate characteristics of each speaker, such as the average flow rate, flow rate range, and peak value. Next, define a buffering requirement calculation formula that takes into account the expected playback delay and audio flow rate characteristics. For example, the buffering requirement is defined as the product of the expected playback delay and the peak audio flow rate, plus a safety margin based on the flow rate range, that is, buffering requirement = expected playback delay × audio flow rate peak + (flow rate range × safety margin coefficient). Calculate the buffering requirement for each speaker and store these values ​​in a dataset, namely the speaker group buffering requirement dataset. This dataset can provide the buffering requirements of each speaker under different network conditions.

[0122] Step S374: extracting the maximum buffer requirement value from the speaker group buffer requirement data set to obtain a speaker group buffer reference value;

[0123] Specifically, data analysis software, such as Excel or Python, can be used to perform maximum buffer requirement value extraction. Import the speaker group buffer requirement dataset into Excel or Python environment. These data include the buffer requirement value of each speaker. Next, in Excel, the MAX function can be used to quickly find the maximum buffer requirement value in the dataset. In Python, the max function of the Pandas library can be used to find the maximum buffer requirement value of the entire dataset or each speaker. Record this maximum buffer requirement value as the speaker group buffer benchmark value. This benchmark value will be used to determine the overall buffer strategy of the speaker group to ensure that all speakers have sufficient buffer to cope with the worst-case network delay and jitter.

[0124] Step S375: compensating and adjusting the speaker group buffer requirement data set according to the speaker group jitter compensation factor set and the speaker group buffer reference value to obtain an adjusted speaker group buffer requirement set, and allocating a buffer to the Bluetooth speaker group according to the adjusted speaker group buffer requirement set to obtain an audio buffer allocation scheme;

[0125] Specifically, a set of jitter compensation factors for the speaker group can be loaded, which includes a jitter standard deviation factor, a jitter trend factor, and a jitter prediction compensation factor. At the same time, a buffer baseline value for the speaker group is also loaded. Next, the compensation adjustment value for each speaker is calculated. For example, the buffer size is increased according to the jitter standard deviation factor to adapt to network jitter. If the jitter trend factor shows that the jitter is increasing, the buffer size needs to be further increased. At the same time, the demand for buffer size due to future jitter is predicted according to the jitter prediction compensation factor. An algorithm is set to adjust the buffer requirement of each speaker by combining the jitter compensation factor set and the buffer baseline value. For example, if the buffer requirement of a speaker is originally 2 seconds, but its jitter standard deviation factor is higher, its buffer requirement is increased to 2.5 seconds. Then, the buffer is allocated to the Bluetooth speaker group according to the adjusted buffer requirement set. Ensure that the buffer size of each speaker can at least meet its adjusted buffer requirement while not exceeding the buffer baseline value. Finally, an audio buffer allocation scheme is obtained, which lists the buffer size of each speaker in detail.

[0126] Step S376: collecting audio stream characteristics of the Bluetooth speaker group based on the audio buffer allocation scheme to obtain an audio stream characteristic data set;

[0127] Specifically, audio analysis software, such as Adobe Audition, can be used in conjunction with network monitoring tools, such as Wireshark, to perform audio stream feature collection. First, configure Wireshark to capture the network traffic of the Bluetooth speaker group, especially the packets related to the audio stream. Pay attention to the size, transmission time, and arrival order of these packets, because this information helps determine the characteristics of the audio stream. Next, use Adobe Audition to analyze the quality of the audio stream, including the sampling rate, bit rate, and audio encoding format. Record this information because it will affect the processing and buffering of the audio stream. Then, combine the data from Wireshark and Adobe Audition to collect the characteristics of the audio stream. For example, it is found that the bit rate of the audio stream changes significantly in different time periods, or the audio encoding format has special requirements for the buffer size. Use a script or software program to organize and analyze this data and save the results in an audio stream feature dataset. This dataset includes the audio stream characteristics of each speaker, such as the average bit rate, peak bit rate, encoding format, and any observed changes. Finally, the audio stream feature dataset is obtained, which provides detailed information about the audio stream characteristics of each speaker in the speaker group.

[0128] Step S377: Generate a preloading sequence for the Bluetooth speaker group according to the audio stream characteristic data set to obtain an audio preloading sequence for the speaker group.

[0129] Specifically, an audio stream characteristic dataset can be loaded and the audio stream characteristics of each speaker can be analyzed. Focus on characteristics that affect the preloading strategy, such as bit rate variation and encoding format. Generate a preloading sequence based on the audio stream characteristics and buffer allocation scheme. For example, for speakers with large bit rate variations, generate a preloading sequence that is updated more frequently to ensure that there is always enough data in the buffer to cope with bit rate peaks. For speakers that use a specific encoding format, the preloading sequence needs to be adjusted to adapt to the specific requirements of the format. Use a script or software program to calculate the preloading sequence for each speaker. This program takes into account the characteristics of the audio stream and the size of the buffer to determine the optimal preloading timing and data amount. Then, a preloading task list is generated for each speaker, which details the timing, data amount, and priority of preloading.

[0130] The present invention realizes accurate play delay control by predicting the play delay and forming an expected matrix, and can manage the play delay more meticulously. By combining the audio flow rate feature vector and the play delay expected matrix, the buffer demand of the speaker group can be accurately calculated, and a more reasonable buffer allocation can be performed, thereby optimizing the buffer demand analysis. By extracting the maximum buffer demand value and performing compensation adjustment, the efficiency of buffer allocation is further improved, and the stability of the audio stream is ensured. Reasonable buffer allocation and audio stream feature collection help reduce interruptions and freezes during playback, enhance the fluency of audio playback, and improve audio quality. The present invention can dynamically adjust the buffer allocation according to real-time audio stream characteristics and buffer requirements, enhance the system's adaptive ability, and enable it to adapt to different network environments and audio characteristics. Through accurate buffer demand calculation and compensation adjustment, the waste of buffer resources is avoided and resource utilization is improved. Finally, the speaker group audio preloading sequence is obtained, which contains a preloading task list for each speaker in the speaker group.

[0131] Preferably, step S4 comprises the following steps:

[0132] Step S41: Allocate memory for the Bluetooth speaker group according to the audio buffer allocation scheme to obtain a speaker group cache space allocation map;

[0133] Specifically, memory allocation can be performed using a memory management tool, such as the Memory Diagnostic Tool for Windows or Memtool for Linux. First, determine the buffer size required for each speaker. This information comes from the audio buffer allocation scheme. Allocate a data structure for each speaker to represent its buffer space, including the starting address, size, and other relevant attributes. Next, use the memory management tool to scan the available memory resources and allocate them according to the buffer requirements of the speaker. For example, if a speaker requires a 10MB buffer, a continuous 10MB space will be allocated to the speaker from the available memory. Record the memory allocation of each speaker, including the starting address and size of the allocation, and generate a speaker group buffer space allocation map. This chart can be a table or a graphical interface that shows the location and size of the buffer space for each speaker. Finally, the speaker group buffer space allocation map is obtained, which details the buffer space allocation of each speaker.

[0134] Step S42: performing task decomposition and mapping on the speaker group audio preloading sequence to obtain a speaker group preloading task list;

[0135] Specifically, a task scheduling tool, such as Windows Task Scheduler, can be used to perform task decomposition and mapping. First, define the preloading sequence based on the audio stream feature data set and the audio buffer allocation scheme. This sequence includes detailed information about the audio data that needs to be preloaded for each speaker, such as data size, preloading time point, and priority. Next, use the task scheduling tool to create preloading tasks. For each speaker, create a task that specifies the audio data to be preloaded, the preloading time point, and the priority. For example, if speaker A needs to preload 100MB of audio data at 10:00AM, create a task to perform this operation. Generate a preloading task list for each speaker, which includes detailed information about all preloading tasks. A table or database can be used to store this information and ensure that tasks are executed in the correct order and time. Finally, a list of preloading tasks for the speaker group is obtained.

[0136] Step S43: extracting audio data from a preset audio source according to the preloaded task list of the speaker group to obtain an original audio pre-cached data set;

[0137] Specifically, audio processing software, such as Audacity, and a scripting language, such as Python, can be used to perform this work in conjunction with its audio processing library, such as librosa. The detailed information of the audio data to be extracted is determined based on the information in the preloaded task list, including the storage location of the audio file, the time period of the required audio, and the amount of data required for each speaker. Next, use Audacity to open the audio source file and use its built-in cropping tool to extract the required audio segment. For automated processing, use a Python script in conjunction with the librosa library to automate the extraction process. The script traverses the preloaded task list and, for each task, uses librosa to extract the audio data for the corresponding time period. The extracted audio data is then saved as a raw audio pre-cache dataset. This involves saving the data as multiple files, each corresponding to a speaker task, or in a larger container file containing the data for all speakers. Finally, the raw audio pre-cache dataset is obtained.

[0138] Step S44: compressing and encoding the original audio pre-cached data set to obtain a compressed and encoded audio data packet;

[0139] Specifically, audio encoding software, such as FFmpeg, can be used to perform compression encoding. First, determine the compression encoding format of the audio data, which is selected based on the characteristics of the audio data and the decoding capabilities of the speakers. For example, select an efficient audio encoding format such as AAC or Opus. Next, use FFmpeg to compress and encode each audio file in the original audio pre-cached data set. Enter the corresponding parameters, such as encoding format, bit rate, sampling rate, etc. through the command line tool to control the encoding process. For example, use the following FFmpeg command to encode an audio file: ffmpeg-iinput_audio.wav-c:aaac-b:a 128k output_audio.aac; this command encodes the input file input_audio.wav into AAC format audio with a bit rate of 128kbps. Then, collect the compressed and encoded audio files and package them into a compressed and encoded audio data packet. This data packet can be a single file containing compressed audio data for all speakers, or a collection of multiple files, each corresponding to a speaker.

[0140] Step S45: writing the compressed and encoded audio data packet into the cache of each Bluetooth speaker in the Bluetooth speaker group according to the speaker group cache space allocation diagram, thereby obtaining an audio pre-cache data set;

[0141] Specifically, a cache space allocation diagram of the speaker group can be loaded, which contains detailed information about the cache space of each speaker, including the starting address and size of the cache. Next, the compressed and encoded audio data packets are transmitted to each speaker using Bluetooth technology. A Bluetooth transmission protocol, such as the Bluetooth Advanced Audio Distribution Profile (A2DP), is used to achieve wireless transmission of audio data. According to the cache space allocation diagram, the transmitted audio data is written into the cache space of the corresponding speaker. Ensure that each speaker only receives and stores the audio data assigned to it, and the data is written to the correct location. Monitor the writing process to ensure that the data is completely written into the cache of the speaker and no errors occur. If an error is found, retransmit and write the data until success. Finally, the audio pre-cache data set is obtained, which indicates that the corresponding compressed and encoded audio data has been stored in the cache space of all speakers.

[0142] Step S46: performing clock synchronization calibration on the audio pre-cached data set based on the speaker group time synchronization network to obtain a speaker group synchronization time reference, and performing time sequence association between the audio pre-cached data set and the speaker group synchronization time reference to obtain a speaker group synchronization playback timing diagram;

[0143] Specifically, a time synchronization protocol, such as the Network Time Protocol (NTP), and a custom timing analysis tool can be used to perform clock synchronization calibration. Use an NTP client to synchronize the network time on each speaker. Configure the NTP client to communicate with an accurate network time server to obtain accurate time information. Next, use the timing analysis tool to calibrate the clock of the speaker group. Compare the internal clock of each speaker with the time of the NTP server, calculate the time deviation, and adjust the speaker clock to synchronize with the network time. The speaker group synchronization time base is obtained based on the clock synchronization results. This base is a time reference followed by all speakers to ensure the synchronization of audio playback. The audio pre-cached dataset is time-associated with the speaker group synchronization time base. Add time tags to each audio clip in the audio dataset, which indicate the specific time they should be played. Finally, the speaker group synchronization playback timing diagram is obtained, which lists the audio clips of each speaker and their playback time in detail.

[0144] Step S47: Serialize the instruction of the synchronous playback timing diagram of the speaker group to obtain the synchronous playback control instruction set of the speaker group.

[0145] Specifically, you can use the SyncPlay Command Generator software tool to complete the command serialization. First, open the SyncPlay Command Generator software and load the speaker group synchronized playback timing diagram. Set the software to generate playback instructions. For each speaker, the software will generate a playback instruction based on the information in the timing diagram. This instruction includes the unique identification of the speaker, the name of the audio clip, and the specific time to play. Check the generated instructions to ensure that they accurately reflect the requirements of the timing diagram. For example, if an instruction indicates that speaker A should play the audio clip "AudioClip_01" at 10 seconds, verify that this instruction is consistent with the timing diagram. Figure 1 After confirmation, all generated instructions are collected to form a complete set of synchronous playback control instructions for the speaker group. This instruction set will contain the playback instructions for all speakers, and each instruction clearly indicates the playback time point and audio clip.

[0146] The present invention ensures the rational use of cache space through efficient memory management, and the optimized preloading strategy makes the preloading process of audio data more orderly and efficient. The extraction and compression coding of audio data not only improves the efficiency of data transmission and storage, reduces the time and space required for pre-caching, but also ensures the consistency of data in the speaker group. Through clock synchronization calibration and timing association, accurate synchronous playback of the speaker group is achieved, and the synchronization accuracy of audio playback is significantly improved. The synchronous playback timing diagram and instruction serialization ensure the smooth and continuous playback of audio content, and significantly enhance the user's auditory experience. In addition, the stability and reliability of the system in the face of network fluctuations or other abnormal situations are enhanced through precise time synchronization and playback control instruction sets. The present invention also has good flexibility and scalability, and can adapt to speaker groups of different sizes and different audio sources.

[0147] Preferably, the present invention further provides a Bluetooth speaker synchronous playback system, which is used to execute the Bluetooth speaker synchronous playback method as described above, and the Bluetooth speaker synchronous playback system comprises:

[0148] A synchronous network construction module is used to elect a master device for the Bluetooth speaker group and obtain the master device identifier of the speaker group; based on the master device identifier of the speaker group, a distributed time synchronization network is constructed for the Bluetooth speaker group to obtain a speaker group time synchronization network;

[0149] The frequency band allocation module is used to scan the environmental signals of the Bluetooth speaker group to obtain environmental frequency band signal data; dynamically allocate the frequency bands of the Bluetooth speaker group based on the environmental frequency band signal data to obtain a frequency band allocation plan for the speaker group;

[0150] The preloading module is used to monitor the network performance parameters of the Bluetooth speaker group to obtain a set of network performance parameters of the speaker group; determine the audio buffer of the Bluetooth speaker group according to the set of network performance parameters of the speaker group to obtain an audio buffer allocation scheme; determine the audio preloading segment of the Bluetooth speaker group according to the audio buffer allocation scheme to obtain an audio preloading sequence of the speaker group;

[0151] The synchronous playback module is used to pre-cache the distributed audio data of the Bluetooth speaker group according to the audio buffer allocation plan and the audio preloading sequence of the speaker group to obtain an audio pre-cache data set; based on the speaker group time synchronization network, the audio pre-cache data set is synchronously played and controlled to obtain a speaker group synchronous playback control instruction set.

[0152] Therefore, the embodiments should be regarded as illustrative and non-restrictive from all points, and the scope of the present invention is limited by the appended claims rather than the above description, and it is therefore intended that all changes falling within the meaning and range of equivalent elements of the application documents are included in the present invention.

[0153] The above description is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but should conform to the widest scope consistent with the principles and novel features invented herein.

Claims

1. A Bluetooth speaker synchronous playback method, characterized in that: The following steps are involved: Step S1: Elect a master device for the Bluetooth speaker group to obtain the master device identifier of the speaker group; Based on the speaker group master device identifier, a distributed time synchronization network is constructed for the Bluetooth speaker group to obtain a speaker group time synchronization network; Step S2: Scanning the Bluetooth speaker group for environmental signals to obtain environmental frequency band signal data; dynamically allocating frequency bands for the Bluetooth speaker group based on the environmental frequency band signal data to obtain a frequency band allocation scheme for the speaker group; Step S3: monitoring the network performance parameters of the Bluetooth speaker group to obtain a network performance parameter set of the speaker group; determining the audio buffer of the Bluetooth speaker group according to the network performance parameter set of the speaker group to obtain an audio buffer allocation scheme; Determine the audio preloading segment for the Bluetooth speaker group according to the audio buffer allocation scheme to obtain the audio preloading sequence for the speaker group; Step S4: pre-caching the distributed audio data of the Bluetooth speaker group according to the audio buffer allocation scheme and the audio pre-loading sequence of the speaker group to obtain an audio pre-caching data set; Based on the speaker group time synchronization network, the audio pre-cached data set is synchronously played and controlled to obtain a speaker group synchronous playback control instruction set.

2. The Bluetooth speaker synchronous playback method according to claim 1, characterized in that: Step S1 includes the following steps: Step S11: electing a master device for the Bluetooth speaker group to obtain a master device identifier for the speaker group; Step S12: constructing a hierarchical network topology for the Bluetooth speaker group according to the speaker group master device identifier to obtain a speaker group network topology structure; Step S13: performing bidirectional timestamp exchange on the Bluetooth speaker group according to the speaker group network topology structure to obtain a speaker group timestamp data set; Step S14: performing delay compensation on the Bluetooth speaker group based on the speaker group timestamp data set to obtain an optimized timestamp data set for the speaker group; Step S15: Perform distributed clock synchronization on the Bluetooth speaker group based on the speaker group optimized timestamp data set to obtain a speaker group time synchronization network.

3. The Bluetooth speaker synchronous playback method according to claim 2, characterized in that: Step S11 includes the following steps: Step S111: Initializing the election process of the Bluetooth speaker group, and collecting device performance indicators to obtain a Bluetooth speaker status data set; wherein the Bluetooth speaker status data set includes a number of Bluetooth speaker status data, each Bluetooth speaker status data includes clock stability data, processor performance parameters and network connection quality data; Step S112: performing a comprehensive fitness evaluation on the corresponding Bluetooth speaker according to the clock stability data, the processor performance parameters and the network connection quality data to obtain device fitness data; Step S113: Screening candidate devices of the Bluetooth speaker group according to the device suitability data to obtain a master device candidate list; Step S114: performing a clock stability test on the Bluetooth speakers corresponding to the master device candidate list and a network delay test to obtain a clock stability test result set and a network delay test result set; Step S115: Perform a final master device election for the Bluetooth speaker group according to the clock stability test result set and the network delay test result set to obtain a master device identifier for the speaker group.

4. The Bluetooth speaker synchronous playback method according to claim 2, characterized in that: Step S14 includes the following steps: Step S141: Calculate the time deviation of the Bluetooth speaker group based on the speaker group timestamp data set to obtain a speaker time deviation result set; Step S142: Designing a PI controller for the Bluetooth speaker group according to the speaker time deviation result set to obtain a speaker group PI controller; Step S143: calculating the frequency adjustment amount of the speaker group PI controller according to the speaker time deviation result set to obtain frequency adjustment amount data, and performing frequency synchronization adjustment on the speaker group PI controller according to the frequency adjustment amount data to obtain a frequency synchronization signal; Step S144: calculating the phase adjustment amount of the speaker group PI controller according to the speaker time deviation result set to obtain phase adjustment amount data, and performing phase fine-tuning on the frequency synchronization signal according to the phase adjustment amount data to obtain a phase synchronization signal; Step S145: performing synchronization accuracy evaluation on the phase synchronization signal to obtain a synchronization accuracy evaluation result; Step S146: determining a transition mechanism for the phase synchronization signal according to the synchronization accuracy evaluation result to obtain a synchronization signal transition strategy, and setting a maximum adjustment limit for the synchronization signal transition strategy to obtain maximum adjustment limit data; Step S147: performing timestamp correction on the speaker group timestamp data set according to the synchronization signal transition strategy and the maximum adjustment limit data to obtain a speaker group optimized timestamp data set.

5. The Bluetooth speaker synchronous playback method according to claim 1, characterized in that: Step S2 includes the following steps: Step S21: Scanning the Bluetooth speaker group for environmental signals to obtain environmental frequency band signal data; Step S22: segmenting the environmental frequency band signal data to obtain segmented signal data; Step S23: identifying potential interference sources on the segmented signal data to obtain potential interference source data; Step S24: performing low-intensity signal recognition on the segmented signal data to obtain low-intensity signal segment data; Step S25: performing frequency band stability evaluation on the segmented signal data to obtain a frequency band stability report; Step S26: extracting interference source characteristics from the potential interference source data based on the environmental frequency band signal data to obtain potential interference source characteristic data, and identifying the potential interference source type from the potential interference source data based on the potential interference source characteristic data to obtain potential interference source type data; Step S27: Calculate the frequency band occupancy of the segmented signal data according to the low-intensity signal segment data, the frequency band stability report and the potential interference source type data to obtain frequency band occupancy distribution data, and generate a spectrum occupancy heat map for the frequency band occupancy distribution data to obtain a spectrum occupancy heat map; Step S28: dynamically allocate frequency bands to the Bluetooth speaker group according to the spectrum occupancy heat map to obtain a frequency band allocation plan for the speaker group.

6. The Bluetooth speaker synchronous playback method according to claim 5, characterized in that: Step S28 includes the following steps: Step S281: constructing a spectrum diagram for the spectrum occupancy heat map to obtain a frequency band spectrum diagram for the speaker group, and performing device node mapping on the frequency band spectrum diagram for the speaker group and the Bluetooth speaker group to obtain a spectrum node diagram for the speaker group; Step S282: measuring the spatial distribution of the Bluetooth speaker group to obtain a spatial distribution diagram of the speaker group, and determining the signal propagation characteristics of the Bluetooth speaker group to obtain signal propagation characteristic data of the speaker group; Step S283: defining spectrum constraints for the Bluetooth speaker group according to the speaker group spatial distribution diagram and the speaker group signal propagation characteristic data to obtain a speaker group spectrum constraint set; Step S284: applying a graph coloring algorithm to the speaker group spectrum node graph and the speaker group spectrum constraint set to obtain an initial frequency band allocation graph of the speaker group; Step S285: performing frequency band allocation conflict identification on the initial frequency band allocation diagram of the speaker group to obtain a frequency band conflict identification result, and backtracking and adjusting the initial frequency band allocation diagram of the speaker group according to the frequency band conflict identification result to obtain a frequency band allocation plan for the speaker group.

7. The Bluetooth speaker synchronous playback method according to claim 1, characterized in that: Step S3 includes the following steps: Step S31: monitoring the network performance parameters of the Bluetooth speaker group to obtain a set of network performance parameters of the speaker group; Step S32: using the speaker group network performance parameter set to perform model training on the preset long short-term memory neural network architecture to obtain a speaker group network performance time series model; Step S33: using the speaker group network performance time series model to predict network parameter changes in a preset future time window to obtain a short-term network performance prediction result set; Step S34: performing a network quality score on the Bluetooth speaker group according to the short-term network performance prediction result set to obtain a network quality score for the speaker group; Step S35: adjusting the buffer factor of the Bluetooth speaker group according to the speaker group network quality score to obtain a speaker group buffer factor set; wherein the speaker group buffer factor set includes a basic buffer factor, a network quality adjustment factor and a bandwidth utilization factor; Step S36: performing network jitter compensation calculation on the Bluetooth speaker group according to the short-term network performance prediction result set to obtain a speaker group jitter compensation factor set; wherein the speaker group jitter compensation factor set includes a jitter standard deviation factor, a jitter trend factor, and a jitter prediction compensation factor; Step S37: Calculate the buffer size of the Bluetooth speaker group according to the speaker group buffer factor set and the speaker group jitter compensation factor set to obtain an audio buffer allocation plan, and determine the audio preloading segment of the Bluetooth speaker group to obtain an audio preloading sequence of the speaker group.

8. The Bluetooth speaker synchronous playback method according to claim 7, characterized in that: Step S37 The following steps are involved: Step S371: Calculating the expected playback delay of the Bluetooth speaker group based on the speaker group buffer factor set to obtain an expected playback delay matrix; Step S372: measuring the audio flow rate of the Bluetooth speaker group to obtain an audio flow rate feature vector; Step S373: Calculate the buffering requirement of the Bluetooth speaker group according to the play delay expectation matrix and the audio flow rate feature vector to obtain a speaker group buffering requirement data set; Step S374: extracting the maximum buffer requirement value from the speaker group buffer requirement data set to obtain a speaker group buffer reference value; Step S375: compensating and adjusting the speaker group buffer requirement data set according to the speaker group jitter compensation factor set and the speaker group buffer reference value to obtain an adjusted speaker group buffer requirement set, and allocating a buffer to the Bluetooth speaker group according to the adjusted speaker group buffer requirement set to obtain an audio buffer allocation scheme; Step S376: collecting audio stream characteristics of the Bluetooth speaker group based on the audio buffer allocation scheme to obtain an audio stream characteristic data set; Step S377: Generate a preloading sequence for the Bluetooth speaker group according to the audio stream characteristic data set to obtain an audio preloading sequence for the speaker group.

9. The Bluetooth speaker synchronous playback method according to claim 1, characterized in that: Step S4 includes the following steps: Step S41: Allocate memory for the Bluetooth speaker group according to the audio buffer allocation scheme to obtain a speaker group cache space allocation map; Step S42: performing task decomposition and mapping on the speaker group audio preloading sequence to obtain a speaker group preloading task list; Step S43: extracting audio data from a preset audio source according to the preloaded task list of the speaker group to obtain an original audio pre-cached data set; Step S44: compressing and encoding the original audio pre-cached data set to obtain a compressed and encoded audio data packet; Step S45: writing the compressed and encoded audio data packet into the cache of each Bluetooth speaker in the Bluetooth speaker group according to the speaker group cache space allocation diagram, thereby obtaining an audio pre-cache data set; Step S46: performing clock synchronization calibration on the audio pre-cached data set based on the speaker group time synchronization network to obtain a speaker group synchronization time reference, and performing time sequence association between the audio pre-cached data set and the speaker group synchronization time reference to obtain a speaker group synchronization playback timing diagram; Step S47: Serialize the instruction of the synchronous playback timing diagram of the speaker group to obtain the synchronous playback control instruction set of the speaker group.

10. A Bluetooth speaker synchronous playback system, characterized in that: Used to execute the Bluetooth speaker synchronous playback method according to claim 1, the Bluetooth speaker synchronous playback system comprises: A synchronous network construction module is used to elect a master device for the Bluetooth speaker group and obtain the master device identifier of the speaker group; based on the master device identifier of the speaker group, a distributed time synchronization network is constructed for the Bluetooth speaker group to obtain a speaker group time synchronization network; The frequency band allocation module is used to scan the environmental signals of the Bluetooth speaker group to obtain environmental frequency band signal data; dynamically allocate the frequency bands of the Bluetooth speaker group based on the environmental frequency band signal data to obtain a frequency band allocation plan for the speaker group; A preloaded module is used to monitor the network performance parameters of the Bluetooth speaker group and obtain a set of network performance parameters of the speaker group; Determine the audio buffer of the Bluetooth speaker group according to the speaker group network performance parameter set to obtain an audio buffer allocation plan; Determine the audio preloading segment for the Bluetooth speaker group according to the audio buffer allocation scheme to obtain the audio preloading sequence for the speaker group; The synchronous playback module is used to pre-cache the distributed audio data of the Bluetooth speaker group according to the audio buffer allocation plan and the audio preloading sequence of the speaker group to obtain an audio pre-cache data set; based on the speaker group time synchronization network, the audio pre-cache data set is synchronously played and controlled to obtain a speaker group synchronous playback control instruction set.

Citation Information

Patent Citations

  • Synchronous cooperation method for multiple intelligent electronic devices and multimedia playing system

    CN110392292A

  • Method for realizing ultra-low delay video live broadcast in highly fluctuating network

    CN117241076A

  • Real-time audio interaction method based on LE Audio multi-Bluetooth audio equipment

    CN117295043A

  • Bluetooth earphone low-delay transmission method

    CN117440440A

  • Video processing method and related equipment

    CN118540541A

Cited By

  • Distributed audio group mute and recovery method and system, storage medium and equipment

    CN120979865A