A bluetooth sound box synchronous playing method and system
Through master device election and distributed time synchronization network construction, combined with environmental signal scanning and network performance monitoring, frequency bands and buffers are dynamically allocated to achieve automatic synchronous playback of Bluetooth speakers, solving the problem of audio signal asynchrony of Bluetooth speakers in a wide range of places, improving synchronization accuracy and stability, and broadening application scenarios.
Patent Information
- Application Number
- CN202411702711.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-11-26
AI Technical Summary
When Bluetooth speakers play synchronously, the audio signals may be out of sync due to wireless signal transmission delay and interference, which is especially obvious in large areas, increasing the complexity of user operations and limiting application scenarios.
Through master device election and distributed time synchronization network construction, combined with environmental signal scanning and network performance monitoring, frequency bands and buffers are dynamically allocated to achieve distributed audio data pre-caching and synchronous playback control, and generate an automated synchronous playback control instruction set.
It improves the synchronization accuracy and stability of audio signals, simplifies user operation, and expands the application range of Bluetooth speakers. It is suitable for large-scale events and commercial venues, providing a high-quality audio experience.
Smart Images

Figure CN119653475B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of Bluetooth speakers, and particularly relates to a Bluetooth speaker synchronous playing method and system. BACKGROUND
[0002] The synchronous playing technology of Bluetooth speakers faces significant challenges in realizing the synchronization of audio signals among multiple speakers. First, since the communication between Bluetooth speakers relies on wireless signals, the transmission of signals is affected by various 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 audio signals to be out of sync, affecting the overall auditory experience. In large-scale venues such as outdoor music festivals or large conference rooms, this out-of-sync phenomenon is particularly evident. This is because the distance between speakers is greater, and the delay in signal transmission is greater. For example, some users try to synchronize multiple Bluetooth speakers to play music using software such as Airfoil, but if there is a phenomenon of different synchronization between speakers, manual adjustment of the delay of each device is required to synchronize the playback. This not only increases the complexity of user operations, but also limits the ability of Bluetooth speakers to synchronize playback in large-scale activities. SUMMARY
[0003] Therefore, it is necessary to provide a Bluetooth speaker synchronous playing method and system to solve at least one of the above technical problems.
[0004] To achieve the above-mentioned purpose, a Bluetooth speaker synchronous playing method comprises the following steps:
[0005] Step S1: performing master device election on a Bluetooth speaker group to obtain a speaker group master device identifier; performing distributed time synchronization network construction on the Bluetooth speaker group based on the speaker group master device identifier to obtain a speaker group time synchronization network;
[0006] Step S2: performing environment signal scanning on the Bluetooth speaker group to obtain environment frequency band signal data; performing dynamic frequency band allocation on the Bluetooth speaker group based on the environment frequency band signal data to obtain a speaker group frequency band allocation scheme;
[0007] Step S3: performing network performance parameter monitoring on the Bluetooth speaker group to obtain a speaker group network performance parameter set; determining an audio buffer area on the Bluetooth speaker group according to the speaker group network performance parameter set to obtain an audio buffer area allocation scheme; determining an audio preloading segment on the Bluetooth speaker group according to the audio buffer area allocation scheme to obtain a speaker group audio preloading sequence;
[0008] Step S4: Distribute audio data pre-caching to the Bluetooth speaker group according to the audio buffer allocation scheme and the speaker group audio pre-loading sequence, obtaining an audio pre-caching data set; control the synchronous playback of the audio pre-caching data set based on the speaker group time synchronization network, obtaining a speaker group synchronous playback control instruction set.
[0009] The application can provide a unified time reference for the Bluetooth speaker group through master device election and distributed time synchronization network construction, thereby reducing audio signal delay caused by different time synchronization. This helps to improve the synchronization accuracy of audio signals between multiple speakers, especially in large-scale venues such as outdoor music festivals or large conference rooms, ensuring the consistency of audio signals. Through scanning and analysis of environmental frequency band signal data, each speaker can be dynamically assigned the best frequency band to avoid frequency band conflicts and interference, thereby improving the transmission quality of wireless signals. This method is particularly suitable for complex electromagnetic environments or scenarios with 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 trend of network parameter changes can be predicted, and the size of the audio buffer and the audio pre-loading segment 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. Through the generation of automatic synchronous playback control instruction sets, the need for users to manually adjust the delay of each device is reduced. Users no longer need to make complex settings to automatically ensure the synchronized 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 time synchronization network synchronous playback control, more stable audio playback can be achieved between speakers. Even in poor network conditions or with interference, pre-caching and synchronization control can compensate for the delay to ensure the continuity and stability of audio playback. The application of this scheme 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 range of Bluetooth speakers is expanded, and high-quality audio experience can be provided in more occasions, such as public broadcasting, conference notifications, and music performances. In summary, the application improves the accuracy and stability of audio synchronization, optimizes user experience, and broadens the application scenarios of Bluetooth speakers.
[0010] Preferably, the application also provides a Bluetooth speaker synchronous playback system for executing the Bluetooth speaker synchronous playback method as described above, which comprises:
[0011] The synchronization network construction module is configured to perform master device election on the Bluetooth speaker group to obtain a speaker group master device identifier, and construct a distributed time synchronization network based on the speaker group master device identifier to obtain a speaker group time synchronization network.
[0012] The frequency band allocation module is configured to perform environment signal scanning on the Bluetooth speaker group to obtain environment frequency band signal data, and to perform dynamic frequency band allocation on the Bluetooth speaker group based on the environment frequency band signal data to obtain a speaker group frequency band allocation scheme.
[0013] The preloading module is configured to monitor network performance parameters of the Bluetooth speaker group to obtain a set of speaker group network performance parameters, to determine an audio buffer based on the set of speaker group network performance parameters to obtain an audio buffer allocation scheme, and to determine an audio preloading segment based on the audio buffer allocation scheme to obtain a speaker group audio preloading sequence.
[0014] The synchronous playback module is configured to perform distributed audio data pre-caching on the Bluetooth speaker group based on the audio buffer allocation scheme and the speaker group audio preloading sequence to obtain a set of audio pre-caching data, and to perform synchronous playback control on the set of audio pre-caching data based on a speaker group time synchronization network to obtain a set of speaker group synchronous playback control instructions.
[0015] The speaker group time synchronization network construction module ensures the accuracy of time synchronization between the speaker groups, thereby improving the synchronization efficiency. The frequency band allocation module scans the environment signal and dynamically allocates the frequency band, so that each speaker works in the best frequency band, avoiding frequency band conflicts and interference, and optimizing the use of wireless spectrum. The preloading module dynamically adjusts the audio buffer size and preloading strategy based on the network performance parameter monitoring results, reducing the influence of network fluctuations on audio playback and enhancing 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, improving the overall audio playback quality. By automatically executing the generation and execution of the set of synchronous playback control instructions, the need for users to manually adjust the settings of each speaker is reduced, the operation process is simplified, and the user experience is improved. The system can adapt to different environments and network conditions through the time synchronization network and the frequency band allocation strategy, improving the robustness of the system. The design of the system supports large-scale speaker group synchronous playback and is suitable for large-scale places such as outdoor music festivals and large conference rooms, widening the application scenarios of Bluetooth speakers. Through accurate synchronization and optimized frequency band allocation, the system can reduce unnecessary signal transmission and retransmission, thereby reducing the overall energy consumption. The system can make adjustments in advance by monitoring network performance parameters and making predictions, reducing network congestion and delay and improving network performance. The design of the system takes into account interference and network problems, and through the pre-caching and synchronous control mechanism, the reliability of audio playback is ensured. BRIEF DESCRIPTION OF DRAWINGS
[0016] Other features, objects, and advantages of the application will become more apparent from the following detailed description when read in conjunction with the accompanying drawings.
[0017] Figure 1 A flow chart of a method for synchronously playing a Bluetooth sound box is shown.
[0018] Figure 2 A flow chart of a method for synchronously playing a Bluetooth sound box is shown.
[0019] Figure 3 A flow chart of a method for synchronously playing a Bluetooth sound box is shown. DETAILED DESCRIPTION
[0020] The technical method of the present application will be described clearly and completely below in conjunction with the drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0021] In addition, the drawings are only schematic illustrations of the present application, and are not necessarily drawn to scale. The same reference numerals in the drawings represent the same or similar parts, and thus repeated descriptions thereof will be omitted. Some of the block diagrams shown in the drawings are functional entities, which do not necessarily have to correspond to physically or logically independent entities. The functional entities can be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different network and / or processor methods and / or microcontroller methods.
[0022] It should be understood that although the terms "first", "second" and the like can be used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of the exemplary embodiments, a first element can be called a second element, and similarly a second element can be called a first element. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0023] To achieve the above-mentioned purpose, please refer to Figures 1 to 3 The present application provides a Bluetooth sound box synchronous playing method, comprising the following steps:
[0024] Step S1: performing master device election on a Bluetooth sound box group to obtain a sound box group master device identifier; performing distributed time synchronization network construction on the Bluetooth sound box group based on the sound box group master device identifier to obtain a sound box group time synchronization network;
[0025] Step S2: scanning the environment signal of the Bluetooth speaker group to obtain environment frequency band signal data; performing dynamic frequency band allocation on the Bluetooth speaker group based on the environment frequency band signal data to obtain a speaker group frequency band allocation scheme;
[0026] Step S3: monitoring the network performance parameters of the Bluetooth speaker group to obtain a set of speaker group network performance parameters; determining an audio buffer based on the set of speaker group network performance parameters to obtain an audio buffer allocation scheme; determining an audio preloading segment based on the audio buffer allocation scheme to obtain a speaker group audio preloading sequence;
[0027] Step S4: pre-caching distributed audio data based on the audio buffer allocation scheme and the speaker group audio preloading sequence to obtain a set of audio pre-caching data; controlling the synchronous playback of the set of audio pre-caching data based on the speaker group time synchronization network to obtain a set of speaker group synchronous playback control instructions.
[0028] In this embodiment, first, use professional Bluetooth device management software, such as Bluetooth Device Manager Pro, to perform master device election on the Bluetooth speaker group. The software automatically selects the most suitable master device by analyzing the hardware performance and network connection quality data of each speaker, and identifies its master device identifier. Then, using this identifier, a distributed time synchronization network is built through the network building tool built into the software, ensuring that all devices in the speaker group can synchronize time, thereby achieving precise audio synchronization playback. Subsequently, using a spectrum analysis tool, such as the wireless spectrum analysis plug-in of Wireshark, the environment where the speaker group is located is scanned for signal, and environmental frequency band signal data is collected. These data include signal strength and interference conditions in different frequency bands. According to the collected environmental frequency band signal data, the best frequency band is dynamically allocated to each speaker, forming a speaker group frequency band allocation scheme. Next, using a network monitoring tool, such as PRTG Network Monitor, network performance parameters of the speaker group are monitored, and a set of network performance parameters including transmission rate, delay, and packet loss rate are collected. Based on these parameters, the audio buffer size of each speaker is determined, forming an audio buffer allocation scheme. According to the audio buffer allocation scheme, the audio segments that each speaker needs to preload are determined, and a speaker group audio preloading sequence is generated. Using audio processing software, such as Adobe Audition, the original audio file is cut to generate the corresponding audio preloading segments. Then, according to the audio buffer allocation scheme and the speaker group audio preloading sequence, the audio data is distributed and pre-cached into the cache of each speaker using FTP or similar file transfer protocol, forming an audio pre-caching data set. Finally, based on the speaker group time synchronization network, a synchronous playback control software, such as Synclavier Pro, is used to control the synchronous playback of the audio pre-caching data set. The software ensures that all speakers play audio according to the predetermined time reference based on the time synchronization network, generates a set of speaker group synchronous playback control instructions, and thus realizes the synchronous playback of the speaker group.
[0029] Preferably, step S1 comprises the following steps:
[0030] Step S11: Master device election is performed on the Bluetooth speaker group to obtain a speaker group master device identifier;
[0031] Specifically, the detailed implementation process of this embodiment can be referred to the sub-steps of step S11.
[0032] Step S12: Hierarchical network topology is constructed for the Bluetooth speaker group according to the speaker group master device identifier, and a speaker group network topology structure is obtained;
[0033] Specifically, the master device can be determined according to the sound box group master device identifier, assuming that the master Bluetooth sound box MB1 has the highest fitness score. Network configuration software is used to assist in building a hierarchical network topology. The software can scan the surrounding Bluetooth devices and determine their positions in the network topology according to the signal strength of the devices and preset parameters such as the processing capacity of the devices, battery life, etc. First, MB1 is configured as the center node and is, for example, the root node in the network topology. Then, the "topology building" function of the software is used to scan the surrounding slave devices. For example, MB1 discovers two sound boxes, MB2 and MB3, which are close enough and have strong enough signal strength to be nodes in 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 in the second level. Once all the sound boxes are properly placed in the network topology, a hierarchical sound box group network topology structure is obtained, in which each sound box knows its position in the network and how to communicate with other sound boxes.
[0034] Step S13: Perform bidirectional timestamp exchange on the Bluetooth sound box group according to the sound box group network topology structure to obtain a sound box group timestamp dataset;
[0035] Specifically, a time synchronization tool such as TimeSync Pro can be used to perform bidirectional timestamp exchange in the sound box group network topology structure. This tool can run on each sound box and be able to exchange time information with other sound boxes 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 record the received timestamp and immediately reply with a response message containing their own timestamp and the received timestamp. This process is repeated on each node in the network. For example, MB2 sends a synchronization request to its child node such as MB4 and records the timestamp in the response from MB4. In this way, each sound box collects the timestamp information of all its child nodes and the upstream timestamp information passed down from the master device. In this way, a sound box group timestamp dataset is obtained, which contains the sending and receiving timestamps of each sound box.
[0036] Step S14: Perform delay compensation on the Bluetooth sound box group based on the sound box group timestamp dataset to obtain a sound box group optimized timestamp dataset;
[0037] Specifically, the detailed implementation process of the present embodiment can be referred to the sub-steps of step S14.
[0038] Step S15: Distributed clock synchronization of the Bluetooth speaker group based on the optimized timestamp dataset, resulting in 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 clocks of each speaker to ensure they are in sync with the master device's time. In this example, PTP is assumed to be used as it provides higher time synchronization accuracy. First, the master device MB1 is selected as the clock source for the PTP domain, also known as the Grandmaster Clock. MB1 will be responsible for providing an accurate time reference to the other speakers. Using an open-source PTP implementation such as ptpd (PTP Daemon), configure MB1 as the master clock and all slave devices as slave clocks. 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 (e.g., MB2, MB3, MB4, etc.) also runs ptpd but is configured in listen mode to receive synchronization messages from MB1. When a slave device receives a synchronization message from MB1, ptpd calculates the time offset based on the optimized timestamp dataset and adjusts their internal clock to compensate for this offset. This process involves calculating the difference between the sending and receiving timestamps and the network delay, then adjusting the slave device's clock accordingly. To further improve synchronization accuracy, clock quality algorithms such as the iterative algorithm can also be enabled in ptpd, which can optimize the estimation of the time offset based on data from multiple synchronization cycles. In this way, distributed clock synchronization is achieved across the entire speaker group. The clock of each speaker is adjusted to be consistent with the time of the master device MB1, forming a time synchronization network. This network ensures that the playback time of audio data on all speakers is consistent.
[0040] The present invention enhances the accuracy of time synchronization through master device election and the construction of a hierarchical network topology, ensuring high accuracy of audio synchronized playback. This structure also optimizes communication paths, reducing communication delays and improving network efficiency. The bidirectional timestamp exchange mechanism further optimizes timestamp processing, providing accurate data for delay compensation and clock synchronization. Delay compensation measures reduce playback differences between speakers, further improving the quality of synchronized playback. In addition, the optimized timestamp dataset enhances the robustness of the system, allowing 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 synchronization effects.
[0041] Preferably, step S11 comprises the following steps:
[0042] Step S111: Initialize the election process for the Bluetooth speaker group and collect device performance indicators to obtain a Bluetooth speaker state dataset; wherein the Bluetooth speaker state dataset contains several Bluetooth speaker state data, and each Bluetooth speaker state data includes clock stability data, processor performance parameters and network connection quality data;
[0043] Specifically, Bluetooth device management software can be used to initialize the election process. First, ensure 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 be potential master device candidates. Next, use standard Bluetooth diagnostic tools, such as Bluetooth Diagnostic Tool, to collect performance indicators for each speaker. For clock stability data, use the Network Time Protocol (NTP) client to measure the deviation of each speaker's clock from the 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 Bluetooth Signal Strength Meter to evaluate the Bluetooth signal strength and connection stability of the speaker. All these data are automatically collected and stored in the state data set of each speaker, forming a Bluetooth speaker state dataset. For example, if there are five speakers, the state data of each speaker will include its clock stability data (such as the 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: According to the clock stability data, processor performance parameters and network connection quality data, the corresponding Bluetooth speaker is comprehensively evaluated for fitness, and device fitness data is obtained;
[0045] Specifically, a weight can be assigned to each performance indicator (clock stability data, processor performance parameter, and network connection quality data) to reflect its importance in master device election. For example, clock stability is considered 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 soundbar. For example, for soundbar A, its clock stability score is 90, its processor performance score is 80, and its network connection quality score is 75, so its comprehensive fitness score will be: 0.5 x 90 + 0.3 x 80 + 0.2 x 75 = 85.5. After calculating the comprehensive fitness scores of all soundbars, they are sorted in descending order of scores to determine which soundbars are best suited to be master devices. For example, if the comprehensive fitness score of soundbar B is 88 and that of soundbar C is 82, then soundbar B will be selected as the master device candidate, and soundbar C will be the alternative. Through this process, a device fitness data set is obtained, which contains the comprehensive fitness scores of each soundbar.
[0046] Step S113: Perform candidate device screening on the Bluetooth soundbar group according to the device fitness data to obtain a master device candidate list;
[0047] Specifically, a threshold value, such as 80 points, can be set to determine which soundbars qualify to be master devices. This threshold value is based on the expected setting of the performance requirements for master devices. Next, all soundbars with a fitness score higher than or equal to this threshold value are screened out. For example, if there are ten Bluetooth soundbars, and the scores of six of them reach 80 points or above, then these six soundbars will be added to the master device candidate list.
[0048] Step S114: Perform clock stability testing on the Bluetooth soundbars corresponding to the master device candidate list, and perform network delay testing to obtain a clock stability test result set and a network delay test result set;
[0049] Specifically, you can use Chronometer Pro to test the internal clock of each candidate speaker. 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). Record the clock deviation data of each speaker and calculate their average deviation value. 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. Record the network latency data of each speaker and calculate their average latency value. 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: performing 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, and obtaining a master device identifier for the speaker group.
[0051] Specifically, decision support system software, such as the Decision Support System for Device Election, can be used to assist in the final master device election. First, the clock stability test result set and the network latency 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 clock deviation and the average and maximum network latency. Next, specific scoring criteria are set for clock stability and network latency. For example, a speaker with a clock deviation within ±0.5 milliseconds is considered excellent, a deviation within ±1 millisecond is considered good, and a deviation exceeding ±1 millisecond is considered acceptable. Similarly, a speaker with a network latency within 10 milliseconds can be considered excellent, a deviation exceeding 10 milliseconds but less than 20 milliseconds is considered good, and a deviation exceeding 20 milliseconds is considered acceptable. Each candidate speaker is then scored based on these scoring criteria. For example, if speaker A has a clock deviation of ±0.3 milliseconds and a network latency of 8 milliseconds, it will receive an excellent rating for clock stability and an excellent rating for network latency. Calculate a composite score for each speaker. This score can be a weighted average of the individual ratings, with clock stability weighted 60% and network latency weighted 40%. Finally, use this composite score to determine the final master device. For example, if speaker A has a composite score of 95, speaker B has a score of 88, and speaker C has a score of 90, speaker A will be selected as the group master due to its highest composite score. Record speaker A's identification information, such as its MAC address or device serial number, to identify the speaker group master.
[0052] The application significantly improves the accuracy of master device election by comprehensively considering clock stability, processor performance, and network connection quality key performance indicators, ensures the reliability of time synchronization, and optimizes the network performance of the entire sound bar group. Through strict device performance index collection and comprehensive fitness evaluation, the robustness of the system in different environments and conditions is enhanced, and the selected master device can effectively manage and synchronize the sound bar group, reduce the out-of-sync phenomenon in audio playback, and provide 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, allowing more devices to be easily added without affecting the election process and results. The automated election process reduces human intervention, simplifies system configuration and management, and reduces system complexity.
[0053] Preferably, step S14 comprises the following steps:
[0054] Step S141: Calculate the time deviation of the Bluetooth sound bar group based on the sound bar group timestamp data set to obtain a sound bar time deviation result set;
[0055] Specifically, the analysis function of Wireshark can be used to calculate the time deviation in the sound bar group timestamp data set. For example, if a data packet from sound bar A is captured with a sending time of T1, and sound bar B receives the data packet at time T2, the time deviation can be calculated as T2-T1. Such calculations are performed on the timestamp data between all sound bars to obtain a sound bar time deviation result set containing time deviation data between each pair of sound bars. This requires multiple such measurements, and the average value is taken as the final time deviation. For example, repeat the above process 100 times at different time points, then calculate the average value of the time deviation between each pair of sound bars, and take this average value as the final data in the sound bar time deviation result set.
[0056] Step S142: Design a PI controller for the Bluetooth sound bar group according to the sound bar time deviation result set to obtain a sound bar group PI controller;
[0057] Specifically, the PI controller can be designed using control system design software, such as MATLAB's Control System Toolbox. First, the loudspeaker time deviation result set is imported into MATLAB and the time deviation data is analyzed. The maximum time deviation in the loudspeaker group is determined and used as the basis for designing the parameters of the PI controller. For example, it is found that the maximum time deviation between loudspeaker A and loudspeaker B is 5 milliseconds, so the goal of designing the PI controller is to reduce this deviation to within 1 millisecond. Next, the control system design tool of MATLAB is used to design the PI controller. The proportional gain (P) and integral gain (I) are set, and the performance of the controller is tested using the simulation function of MATLAB. For example, the proportional gain is set to 0.5 and the integral gain is set to 0.1, and the effect of the controller on the adjustment of the time deviation is tested in a simulated environment. The parameters of the PI controller are adjusted according to 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 faster to the time deviation, while increasing the integral gain can more smoothly eliminate the deviation. Finally, the loudspeaker group PI controller is obtained, which can automatically adjust the time synchronization of the loudspeaker group according to the time deviation result set.
[0058] Step S143: Calculate the frequency adjustment amount of the loudspeaker group PI controller according to the loudspeaker time deviation result set, obtain the frequency adjustment amount data, and adjust the frequency synchronization of the loudspeaker group PI controller according to the frequency adjustment amount data to obtain the frequency synchronization signal;
[0059] Specifically, the frequency adjustment amount calculation and frequency synchronization adjustment can be performed using an automation control system analysis tool, such as the Control System Module of LabVIEW. First, the loudspeaker time deviation result set is imported into LabVIEW, and its built-in data analysis function is used to identify the trend and amplitude of the time deviation. For example, it is found that there is a persistent time deviation between loudspeaker A and the master device, which gradually increases over time. Next, the Control System Design Module of LabVIEW is used to design a PI controller that can calculate the frequency adjustment amount based on the time deviation. The proportional (P) and integral (I) parameters of the PI controller are set to respond to the time deviation. For example, the proportional gain is set to 0.8 and the integral gain is set to 0.05. Then, the simulation function of LabVIEW is used to test the performance of the PI controller to ensure that it can accurately calculate the frequency adjustment amount. In the simulation test, the time deviation data is input, and the frequency adjustment amount output by the PI controller is observed. The parameters of the PI controller are adjusted until it can produce appropriate frequency adjustment amounts to compensate for the time deviation between the loudspeakers. Once satisfactory results are obtained, these frequency adjustment amount data are applied to the loudspeaker group PI controller for actual frequency synchronization adjustment. In this way, a frequency synchronization signal is obtained, which can adjust the clock frequency of the loudspeakers to reduce the time deviation.
[0060] Step S144: Perform phase adjustment amount calculation on the loudspeaker group PI controller based on the loudspeaker time deviation result set to obtain phase adjustment amount data, and perform phase fine tuning on the frequency synchronization signal based on the phase adjustment amount data to obtain a phase synchronization signal;
[0061] Specifically, the phase adjustment amount calculation and phase fine-tuning can be performed using a time synchronization analysis tool, such as the Phase Alignment Tool. First, import the loudspeaker time offset result set into the Phase Alignment Tool and use its analysis function to determine the phase differences between the loudspeakers. For example, it is found that the clock phase of loudspeaker 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 amounts. Set the parameters of the PI controller according to the time offset and phase difference in order 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, ensuring that it can accurately calculate the phase adjustment amounts. In the simulation test, input the time offset and phase difference data and observe the phase adjustment amounts output by the PI controller. Adjust the parameters of the PI controller until it can produce appropriate phase adjustment amounts to compensate for the phase differences between the loudspeakers. Once satisfactory results are obtained, apply these phase adjustment amount data to the frequency synchronization signal for actual phase fine-tuning. In this way, a phase synchronization signal is obtained, which can adjust the clock phase of the loudspeakers.
[0062] Step S145: Perform synchronization precision evaluation on the phase synchronization signal to obtain a synchronization precision evaluation result;
[0063] Specifically, the synchronization precision of the loudspeaker group can be measured and evaluated using a time analysis tool, such as the TimeSync Precision Analyzer. First, configure the TimeSync Precision Analyzer to monitor the phase synchronization signal in the loudspeaker group. This tool can accurately measure time signals and provide detailed statistical data such as average deviation, standard deviation, and maximum deviation. Select several representative loudspeakers from the loudspeaker group and then use the TimeSync Precision Analyzer to collect synchronization data of these loudspeakers over a period of time. For example, record the clock state of all loudspeakers every millisecond for 10 seconds. Next, analyze these data to calculate the synchronization precision of the loudspeaker group. The key indicator to focus on is the standard deviation of the clock state of all loudspeakers, which reflects the synchronization consistency of the loudspeaker group. For example, if the analysis result shows that the standard deviation is 0.1 milliseconds, it means that the clock states of the loudspeaker group differ from each other by at most 0.1 milliseconds. Finally, generate a synchronization precision evaluation result based on these data. If the synchronization precision meets the preset standard (e.g., the standard deviation is less than 0.5 milliseconds), the synchronization is considered successful. If the synchronization precision does not meet the standard, further adjustments are made.
[0064] Step S146: Determine the transition mechanism of the phase synchronization signal according to the synchronization accuracy evaluation result, obtain the synchronization signal transition strategy, and set the maximum adjustment limit of the synchronization signal transition strategy to obtain the maximum adjustment limit data;
[0065] Specifically, a control strategy design tool, such as Control Strategy Designer, can be used to design and simulate different transition strategies. First, input the synchronization accuracy evaluation results into the Control Strategy 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 target to further reduce this value to 0.05 milliseconds. Next, use the 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 the fastest while avoiding instability caused by excessive adjustment. After determining the most effective transition strategy, a maximum adjustment limit needs to be set. This limit will prevent the adjustment of the synchronization signal from exceeding a safe threshold to avoid system instability. For example, set a rule that any single adjustment cannot exceed 0.01 milliseconds. Finally, obtain a synchronization signal transition strategy and maximum adjustment limit data.
[0066] Step S147: Correct the loudspeaker group timestamp dataset according to the synchronization signal transition strategy and the maximum adjustment limit data to obtain the optimized loudspeaker group timestamp dataset.
[0067] Specifically, timestamp correction can be performed using a time correction software tool, such as the Timestamp Correction Utility. First, the synchronization signal transition policy and maximum adjustment limit data are input into the Timestamp Correction Utility. These data include the adjustment direction (increase or decrease timestamp) and adjustment step size for each soundbar, as well as the maximum limit for a single adjustment. Next, the current timestamp data is collected from the soundbar group. For example, it is found that soundbar A has a current timestamp that is 2 milliseconds faster than the master device, while soundbar B is 1 millisecond slower. According to the synchronization signal transition policy, the timestamp of soundbar A needs to be decreased, and the timestamp of soundbar B needs to be increased, in order to synchronize them with the master device's clock. Then, the Timestamp Correction Utility is used to calculate the required timestamp adjustment amount for each soundbar. This tool will take into account the maximum adjustment limit, ensuring that any single adjustment does not exceed the set safety threshold. For example, if soundbar A needs to decrease its timestamp by 5 milliseconds, but the maximum adjustment limit is 1 millisecond, then the Timestamp Correction Utility will make adjustments in five steps, each decreasing the timestamp by 1 millisecond. After each adjustment, the timestamp data is re-collected, and the Timestamp Correction Utility is used to verify the effectiveness of the adjustment. If the adjusted synchronization precision does not meet the expected target, or if over-adjustment occurs, the transition policy and maximum adjustment limit data are adjusted according to the actual situation, and the 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 soundbar has been adjusted to achieve synchronization with the master device.
[0068] The present application significantly improves the time synchronization accuracy between the soundbar group by accurately calculating the time deviation of the soundbar group and making detailed frequency and phase synchronization adjustments. By designing a PI controller and dynamically adjusting based on real-time data, it can adapt to environmental changes and maintain a stable synchronization state, thereby optimizing the audio playback experience and reducing the delay and jitter during playback. The introduction of synchronization accuracy evaluation and transition mechanism enhances the robustness of the system, ensuring stable adjustment when facing time deviation. The setting of the maximum adjustment limit improves the flexibility of the system, allowing it to adapt to different soundbar characteristics and network conditions, while ensuring smooth transition of the synchronization signal and avoiding sudden jumps during the adjustment process, ensuring the continuity and stability of audio playback. The real-time nature of timestamp correction improves the response speed of the system, while the evaluation of synchronization accuracy enhances the predictive ability of the system, allowing it to adapt to future time deviations in advance. The automated calculation of time deviation and synchronization signal adjustment reduces the complexity of the system, simplifying configuration and management.
[0069] Preferably, step S2 comprises the following steps:
[0070] Step S21: Perform environmental signal scanning on the Bluetooth speaker group to obtain environmental frequency band signal data;
[0071] Specifically, a wireless spectrum analyzer, such as the R&S FSH3 spectrum analyzer, can be used for environmental signal scanning. First, configure the working parameters of the spectrum analyzer, set the frequency range to cover the frequency band used by the Bluetooth speaker, usually the 2.4GHz ISM frequency band. Next, deploy the spectrum analyzer in the environment where the Bluetooth speaker group is located. Scanning needs to be done 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 done at every corner of the room and at the midpoint between the speakers. Then, start the spectrum analyzer to perform signal scanning. The spectrum analyzer will record all detected signals in the set frequency range, including wireless routers, other Bluetooth devices, microwave ovens, and other devices that may cause interference. Record the frequency, intensity, and occupation time of these signals, etc. to form an environmental frequency band signal data set.
[0072] Step S22: Segment 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 for signal segmentation. First, import the environmental frequency band signal data into MATLAB and use its built-in signal processing functions to preprocess the data. Next, according to the characteristics of the signal, such as frequency, bandwidth and signal strength, the signal data is divided into different segments. For example, the 2.4GHz frequency band is divided into 20 100MHz sub-bands, and the signal in each sub-band is analyzed respectively. Then, detailed analysis is performed on the signal in each segment, including the type, source and interference degree of the signal. MATLAB's clustering analysis tool is used to identify and classify different signals. For example, Wi-Fi signals, Bluetooth signals and signals from other wireless devices are classified into different categories. Finally, a segmented signal data set is obtained, which contains detailed information of the signal in each segment.
[0074] Step S23: Identify potential interference sources from 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 the R&S FSH3. First, use the R&S FSH3 spectrum analyzer to perform a detailed spectrum scan of the Bluetooth speaker cluster's operating environment. The spectrum analyzer captures the frequency bands and strength information of all wireless signals in the environment. Export the scan results and use them as input data for subsequent analysis. Next, use Wireshark to open these data files and utilize its filtering and analysis capabilities to identify potential interference sources. For example, set filtering rules to identify devices with high signal strength within a specific frequency band, as these devices could interfere with the Bluetooth speaker's signal transmission. Analyze signal characteristics within each frequency band, such as modulation, bandwidth, and signal strength, to determine whether they are interference sources. For example, if a Wi-Fi router with a very strong signal in the 2.4 GHz band used by the Bluetooth speakers is found, this could be a potential interference source. Detailed information about these potential interference sources, including their frequency, strength, and device type, is recorded to form a potential interference source dataset.
[0076] Step S24: performing low-intensity signal recognition on the segmented signal data to obtain low-intensity signal segment data;
[0077] Specifically, low-intensity signal identification can be performed using signal processing software, such as MATLAB's Signal Processing Toolbox. First, import the segmented signal data into MATLAB and analyze the data using its built-in signal processing functions. Use the power spectral density estimation function to calculate the power level of each signal segment. Next, set a power threshold to define what constitutes a "low-intensity" signal. For example, define signals below -70dBm as low-intensity signals. Then, use MATLAB's logical indexing function 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 from the Bluetooth speaker. Record detailed information about these low-intensity signal segments, including their frequency range, average power level, and occupancy, 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 the frequency band stability evaluation. First, the segmented signal data is imported into MATLAB, and the power spectral density analysis tool is used to calculate the signal strength and variation of each frequency band. The pwelch function is used to estimate the power spectral density of each frequency band, and a frequency spectrum graph is drawn to visualize the signal strength of each frequency band. Next, a stability evaluation criterion is set, for example, the standard deviation of the signal strength of a frequency band within a certain time should be below a certain threshold (such as 3dB) to be considered stable. Statistical analysis is performed on the signal strength of each frequency band to calculate its mean and standard deviation. Then, these results are organized into a frequency band stability report, which includes the average signal strength, standard deviation, and stability evaluation 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: performing interference source feature extraction on the potential interference source data based on the environmental frequency band signal data, obtaining potential interference source feature data, and performing potential interference source type identification on the potential interference source data according to the potential interference source feature data, obtaining 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 environmental frequency band signal data and potential interference source data are imported into Python, and the Pandas library is used for data cleaning and organization. Features related to potential interference sources are extracted, such as signal frequency, strength, duration, and modulation method, etc. Next, feature extraction algorithms such as Principal Component Analysis (PCA) are used to reduce the dimensionality of the data and extract the most important features. For example, it is found that the signal strength and modulation method in certain frequency ranges are similar to Wi-Fi signals, while other signals are generated by Bluetooth devices or microwave ovens. Then, classification algorithms such as Support Vector Machines (SVM) or Decision Trees in the Scikit-learn library are used to identify the type of potential interference source. 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 source 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 shows that the interference source of a certain frequency band is identified as a Wi-Fi router, while the interference source of another frequency band is identified as a Bluetooth device.
[0082] Step S27: Calculate the frequency band occupancy rate 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, obtain the frequency band occupancy rate distribution data, and generate a spectrum occupancy heat map based on the frequency band occupancy rate distribution data to obtain the 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, import the low-intensity signal segment data, frequency band stability report, and potential interference source type data into the Python environment. Use the Pandas library to integrate these data into a unified data framework. Next, calculate the occupancy rate of each frequency band. This can be achieved by counting the number of low-intensity signal segments in each frequency band and comparing it with the total number of signal segments in that frequency band. For example, if there are 10 signal segments in a frequency band, 3 of which are low-intensity signal segments, then the occupancy rate of that frequency band is 30%. Taking the frequency band stability report into account, only calculate the occupancy rate of those frequency bands that are evaluated as stable. For unstable frequency bands, set their occupancy rate to zero because they are not suitable for Bluetooth speaker communication. Then use the Matplotlib and Seaborn libraries to generate a heat map of the frequency band occupancy rate distribution data. The heat map is a way to visually display data distribution, where different colors represent different occupancy rates. For example, frequency bands with an occupancy rate below 20% are represented by green, 20% to 50% by yellow, and above 50% by red. In the heat map, the horizontal axis represents different frequency bands, the vertical axis represents time or different measurement points, and the color intensity represents the occupancy rate. In this way, it can be visually seen which frequency bands have low occupancy rates at which time points, providing a basis for dynamic frequency band allocation for Bluetooth speakers.
[0084] Step S28: Perform dynamic frequency band allocation for the Bluetooth speaker group based on the spectrum occupancy heat map to obtain the speaker group frequency band allocation scheme.
[0085] Specifically, the detailed implementation process of the present embodiment can be referred to the sub-steps of step S28.
[0086] The present application realizes effective identification and utilization of low-intensity signal segments and high-stability frequency bands through comprehensive environmental signal scanning and analysis, significantly improving the utilization efficiency of frequency spectrum resources. The present application can actively identify and avoid potential interference sources, greatly reducing the impact of external interference on audio transmission. Through frequency band stability evaluation, the best frequency band for communication can be selected, optimizing signal transmission quality and enhancing transmission reliability. Through dynamic frequency band allocation strategy, the system is given 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. Through automated signal processing and frequency band allocation process, manual intervention is reduced. The present application can adapt to different sizes of speaker groups and variable wireless environments. Optimized frequency band allocation also helps to reduce retransmission caused by frequency band conflicts, reducing system energy consumption. In summary, the anti-interference capability of the present application 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: Perform spectrum map construction on the spectrum occupancy heat map to obtain a speaker group frequency band spectrum map, and perform device node mapping of the speaker group frequency band spectrum map and the Bluetooth speaker group to obtain a speaker group spectrum node map;
[0089] Specifically, wireless network planning and analysis software such as iBwave Design Suite can be used to perform spectrum map construction. First, use the spectrum analysis tool in iBwave Design Suite to process the spectrum occupancy heat map. This tool can identify different color regions in the heat map and convert them into frequency band spectrum maps. For example, convert the green region (low occupancy) in the heat map into low-occupancy frequency bands in the spectrum map, and convert the yellow and red regions into medium and high-occupancy frequency bands, respectively. Next, import the device node information of the speaker group into iBwave Design Suite. These 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 nodes of the speaker group, creating a speaker group spectrum node map. In this map, each speaker node is connected with the corresponding frequency band spectrum, showing the potential use of each speaker frequency band. 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 of that area. If the frequency band occupancy of that area is low, the software will recommend speaker A to use these frequency bands for communication. In this way, a detailed speaker group spectrum node map can be obtained.
[0090] Step S282: Perform spatial distribution measurement on the Bluetooth speaker group to obtain a speaker group spatial distribution map, and determine the signal propagation characteristics of the Bluetooth speaker group to obtain speaker group signal propagation characteristic data;
[0091] Specifically, the spatial distribution measurement 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 measurement on the environment where the Bluetooth speaker group is located. Input or import the map data of the conference room or activity site, and mark the exact position of each Bluetooth speaker on the map. These data can be manually input or automatically obtained by communicating with the GPS module of the speaker. Next, use Atenna-Fi software to simulate the signal propagation characteristics of the speaker group. Input 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 these data to simulate the propagation of signals in the environment, including signal attenuation, reflection and diffraction. For example, if speaker B is located near a wall, Atenna-Fi software will predict that the signal in this area will have a large attenuation. Record these signal propagation characteristic data, including signal strength, coverage range and potential interference area. Finally, obtain a speaker group spatial distribution map and a set of speaker group signal propagation characteristic data.
[0092] Step S283: Define the frequency spectrum constraints of the Bluetooth speaker group according to the speaker group spatial distribution map and the speaker group signal propagation characteristic data to obtain a speaker group frequency spectrum constraint set;
[0093] Specifically, the frequency spectrum constraint definition can be performed using wireless network planning tools, such as AirMagnet Planner. First, import the spatial distribution map and signal propagation characteristic data of the speaker group into AirMagnet Planner. These data include the position of the speakers, signal coverage range and physical obstacles in the environment, etc. Next, define the frequency spectrum constraints according to these data. For example, set a constraint that the speakers near walls or metal objects cannot use frequency bands that are easily affected by reflection and diffraction. In addition, define the minimum and maximum signal strength thresholds according to the signal propagation characteristic data to ensure the communication quality between speakers. Also consider the distance and direction between speakers and the signal overlap between them to define the frequency spectrum usage range of each speaker. For example, if two speakers are very close to each other, limit their use of the same frequency band to avoid mutual interference. Finally, obtain a speaker group frequency spectrum constraint set, which contains all the defined frequency spectrum usage rules. These rules will be used in the subsequent frequency band allocation process to ensure that each speaker is allocated to the appropriate frequency band.
[0094] Step S284: Apply graph coloring algorithm to the loudspeaker group spectrum node graph and the spectrum constraint set to obtain a loudspeaker group initial frequency band allocation graph.
[0095] Specifically, the graph coloring algorithm application can be performed using graph theory and optimization algorithm software, such as MATLAB's Optimization Toolbox. First, import the loudspeaker group spectrum node graph and the spectrum constraint set into MATLAB, and use its graph theory functions to build a graph model. In this model, each loudspeaker node represents a device that needs to be allocated a frequency band, and the spectrum constraints are converted into edges of the graph, representing the potential interference relationship between loudspeakers. Next, apply a graph coloring algorithm to assign colors 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 loudspeakers) are not assigned to the same color (frequency band). MATLAB's Optimization Toolbox provides a variety of graph coloring algorithms, from which an algorithm suitable for the problem size and complexity can be selected. For example, a heuristic algorithm such as the greedy coloring algorithm can be used to quickly find a feasible frequency band allocation scheme. More advanced algorithms, such as linear programming-based coloring algorithms, can also be tried to find the optimal frequency band allocation scheme. Finally, a loudspeaker group initial frequency band allocation graph is obtained, in which each loudspeaker node is assigned a color representing its initial frequency band allocation.
[0096] Step S285: Identify frequency band allocation conflicts in the loudspeaker group initial frequency band allocation graph to obtain a frequency band conflict identification result, and backtrack and adjust the loudspeaker group initial frequency band allocation graph based on the frequency band conflict identification result to obtain a loudspeaker group frequency band allocation scheme.
[0097] Specifically, a wireless network optimization tool, such as Wi-Fi Planner Professional, can be used to perform frequency band allocation conflict identification. First, the initial frequency band allocation map of the speaker group is imported into Wi-Fi Planner Professional, and the built-in frequency band conflict detection function is used to identify allocation conflicts. This tool can automatically compare the allocation map with the previously defined set of spectrum constraints to check if there are any violations of the constraints. For example, suppose there is a rule 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 to identify any speaker pairs that violate this rule and report potential conflicts. Once conflicts are identified, the adjustment suggestion function of Wi-Fi Planner Professional is used to backtrack and adjust the initial frequency band allocation map. This tool can provide adjustment suggestions, such as changing the frequency band allocation of conflicting speakers or adjusting the allocation of other speakers as necessary to resolve conflicts. For example, if the tool finds that speaker A and speaker B are incorrectly allocated to the same frequency band, it will suggest changing the frequency band of speaker B to a non-conflicting frequency band. According to these suggestions, the allocation map is manually or automatically adjusted until all conflicts are resolved. During the adjustment process, multiple iterations are required, and each time the conflict detection is re-run until a frequency band allocation scheme that meets all spectrum constraints is found. Finally, an optimized speaker group frequency band allocation scheme is obtained.
[0098] The present application realizes accurate spectrum management by constructing a speaker group frequency band spectrum map and a spectrum node map, optimizes the signal propagation path of the speaker group, and defines an enhanced set of spectrum constraints based on spatial distribution and signal propagation characteristics, thereby improving the scientificity and rationality of spectrum allocation. Through efficient frequency band allocation by applying graph coloring algorithms, and through frequency band allocation conflict identification and adjustment, frequency band conflicts are reduced, ensuring the feasibility of the allocation. This improves the quality and stability of signal transmission, enhances the adaptability and flexibility of the system, enabling it to intelligently allocate frequency bands according to the actual environment, reducing retransmission and energy consumption caused by frequency band conflicts.
[0099] Preferably, step S3 comprises the following steps:
[0100] Step S31: Network performance parameter monitoring of the Bluetooth speaker group is performed to obtain a set of speaker group network performance parameters;
[0101] Specifically, a comprehensive network analysis tool such as SolarWinds Network Performance Monitor (NPM) can be used, which provides real-time network monitoring and performance data collection functions. 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, and delay. These agents are configured to periodically send the collected data to a central server where SolarWinds NPM is installed. Then, configure SolarWinds NPM to receive and store this data. Set alarm thresholds to notify immediately when network performance parameters exceed normal ranges. For example, if the delay exceeds 100 milliseconds or the packet loss rate is higher than 5%, the system will automatically send an alarm. Then, use the reporting function of NPM to generate a network performance parameter set for the speaker group. This parameter set contains network performance data for all speakers over a period of time. Finally, export this parameter set as a structured data file, such as CSV format.
[0102] Step S32: Model training on the preset long short-term memory neural network architecture using the speaker group network performance parameter set 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, use the Python programming language and TensorFlow library to build the LSTM model. Define the architecture of the model, including the input layer, one or more LSTM layers, and the output layer. For example, set a model with two LSTM layers, each with 128 units. Next, prepare the data, divide the data in the network performance parameter set into feature sets and labels. The feature set contains current and historical network performance parameters for predicting future network performance, while the label is the target parameter that the model wants to predict, such as future delay or packet loss rate. Then, use the feature set and label to train the LSTM model. During training, monitor the performance of the model, using indicators such as mean squared error (MSE) or mean absolute error (MAE) to evaluate the prediction accuracy of the model. Adjust the parameters of the model, such as learning rate, batch size, or number of LSTM layers, to optimize the performance of the model. Finally, after training is complete, use the validation data set to evaluate the model. If the model meets the predetermined performance standards, save it as a speaker group network performance time series model. This model can predict future network performance based on historical and current network performance parameters.
[0104] Step S33: Network parameter change prediction for a preset future time window using the speaker group network performance time series model to obtain a short-term network performance prediction result set;
[0105] Specifically, the network parameter change prediction can be performed using the Python programming language with a deep learning library such as TensorFlow or Keras. First, load the soundbar group network performance time series model and set the time window for which the prediction is desired, for example, the network performance parameters every 5 minutes in the next 24 hours are desired to be predicted. Next, prepare the input data, which includes historical network performance parameters such as signal strength, transmission rate, packet loss rate, and delay in the past period of time. Format these data into an input form that the model can accept, for example, create a time series data set in which the data at each time point is an input sample. Then, use the model to make predictions on this time series data set. The model will output the predicted network performance parameters at each time point, such as the 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: Score the network quality of the Bluetooth soundbar group according to the short-term network performance prediction result set, and obtain the soundbar group network quality score;
[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, evaluate network quality 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 represent the best performance. Next, calculate the network quality score at each time point according to the network performance parameters in the prediction result set. For example, give a higher score if the predicted signal strength is higher than a certain threshold; if the packet loss rate is higher than a certain threshold, give a lower score. A weighted average method can be used to calculate the overall network quality score, where the weight of each parameter reflects its impact on the overall network quality. For example, give a higher weight to the transmission rate because it has a greater impact on audio synchronization playback. Then, generate a network quality score for each soundbar and organize these scores into a soundbar group network quality score set.
[0108] Step S35: Adjust the buffer factor of the Bluetooth soundbar group according to the soundbar group network quality score, and obtain a soundbar group buffer factor set; wherein the soundbar 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 base buffer factor, a network quality adjustment factor, and a bandwidth utilization factor. The base buffer factor is a preset value that ensures 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. A script or software program is used to implement the buffer factor adjustments. For example, an algorithm is set up to decrease the network quality adjustment factor when the network quality score is above a certain threshold, reducing the buffer size and increasing the response speed; when the score is below the threshold, the network quality adjustment factor is increased, increasing the buffer size and reducing the likelihood of stuttering. Next, the current bandwidth utilization data is collected, which can be obtained through network monitoring tools. These data are used to calculate the bandwidth utilization factor, which adjusts the buffer size based on the current network load. Then, these factors are combined to calculate a total buffer factor for each soundbar. For example, if the base 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), the total buffer factor is 17 seconds. Finally, the soundbar group buffer factor set is obtained, which contains the total buffer factor of each soundbar.
[0110] Step S36: Perform network jitter compensation calculation on the Bluetooth soundbar group according to the short-term network performance prediction result set to obtain a soundbar group jitter compensation factor set; wherein the soundbar 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 calculation. First, extract network jitter related data such as delay changes and packet loss events from the short-term network performance prediction result set. Use these data to calculate the jitter standard deviation factor, which reflects the degree of network jitter. Next, analyze the trend of network jitter, for example, find that network jitter has an increasing trend in a certain 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 result shows 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, the soundbar group jitter compensation factor set is obtained, which contains the jitter compensation factor of each soundbar.
[0112] Step S37: According to the set of speaker group buffer factors and the set of speaker group jitter compensation factors, the buffer size of the Bluetooth speaker group is calculated to obtain an audio buffer allocation scheme, and the audio preloading segment of the Bluetooth speaker group is determined to obtain a speaker group audio preloading sequence.
[0113] Specifically, the detailed implementation process of the embodiment can refer to the sub-steps of step S37.
[0114] The application significantly improves the prediction accuracy of future network states by using a long short-term memory neural network architecture to deeply model and predict the network performance of the Bluetooth speaker group. Based on these prediction results, the buffer size can be dynamically adjusted to optimize buffer management, making it more flexible and efficient to adapt to changing network conditions. By predicting and compensating for network jitter, the impact on audio streaming is effectively reduced, improving the stability and smoothness of audio playback and further enhancing the user's listening experience. The application can automatically adjust the buffer parameters according to real-time network conditions, better adapting to different network environments. By predicting network parameter changes in advance and making corresponding buffer adjustments, not only is potential delay reduced, but also data transmission efficiency is improved. Through the automated network performance monitoring and prediction process, manual intervention is reduced, and the intelligent level of the system is improved, making network quality management more efficient. At the same time, by reasonably allocating buffer resources, the system can make full use of available bandwidth, improving the utilization rate of overall network resources and providing a strong guarantee for the stable operation of the Bluetooth speaker group in complex network environments.
[0115] Preferably, step S37 includes the following steps:
[0116] Step S371: Based on the set of speaker group buffer factors, the expected playback delay of the Bluetooth speaker group is calculated to obtain an expected playback delay matrix;
[0117] Specifically, the structure of the expected playback delay matrix can be defined, which includes the buffer factor of each speaker, the expected network delay, and the expected total playback delay. A table or database is used to store these data. Next, according to the set of speaker group buffer factors, including the basic buffer factor, the network quality adjustment factor and the bandwidth utilization factor, the expected playback delay of each speaker is calculated. For example, the following formula is used to calculate the expected playback delay: expected playback delay = basic buffer factor + (network quality adjustment factor x network quality score) + (bandwidth utilization factor x bandwidth utilization); the expected playback delay of each speaker is calculated and filled into the expected playback delay matrix. This matrix can provide the expected delay of each speaker under different network conditions. Finally, the expected playback delay matrix is obtained, which contains the expected playback delay of each speaker in the speaker group.
[0118] Step S372: Perform audio stream speed measurement on the Bluetooth speaker group to obtain an audio stream speed feature vector;
[0119] Specifically, audio stream speed 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 network traffic of the Bluetooth speaker group, particularly data packets related to audio stream. Focus on the size and transmission time of these data packets, as 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 within a certain time. Then, use these data to calculate the audio stream speed feature vector. This vector includes the average stream speed, the range of stream speed variation, and the peak value of stream speed information. Use statistical methods such as calculating the mean, standard deviation, and maximum value to obtain these features. For example, if the average value of the measured audio stream speed on a speaker is 500kbps, the standard deviation is 50kbps, and the maximum value is 600kbps within a certain time, these values will be included in the audio stream speed feature vector. Finally, obtain the audio stream speed feature vector, which provides detailed information about the audio stream speed of each speaker in the speaker group.
[0120] Step S373: Perform buffer demand calculation on the Bluetooth speaker group according to the playback delay expectation matrix and the audio stream speed feature vector to obtain a speaker group buffer demand dataset;
[0121] Specifically, buffer demand calculation can be performed using a data processing and analysis software such as Python with Pandas library. Import the playback delay expectation matrix and the audio stream speed feature vector into the Python environment. These data include the expected playback delay and audio stream speed features of each speaker, such as average stream speed, stream speed variation range, and peak value. Next, define a buffer demand calculation formula that takes into account the expected playback delay and audio stream speed features. For example, the buffer demand is defined as the product of the expected playback delay and the peak value of the audio stream speed, plus a safety margin based on the stream speed variation range, i.e.: Buffer demand = expected playback delay × audio stream speed peak value + (stream speed variation range × safety margin coefficient). Calculate the buffer demand for each speaker and store these values in a dataset, i.e. the speaker group buffer demand dataset. This dataset can provide the buffer demand situation of each speaker under different network conditions.
[0122] Step S374: Extract the maximum buffer demand value from the speaker group buffer demand dataset to obtain the speaker group buffer area reference value;
[0123] Specifically, data analysis software such as Excel or Python can be used to perform the maximum buffer requirement value extraction. The speaker group buffer requirement dataset is imported into the 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 zone benchmark value. This benchmark value will be used to determine the overall buffer strategy of the speaker group, ensuring that all speakers have enough buffer to cope with network latency and jitter in the worst case.
[0124] Step S375: Compensate and adjust the speaker group buffer requirement dataset according to the speaker group jitter compensation factor set and the speaker group buffer zone benchmark value, obtain the adjusted speaker group buffer requirement set, and allocate the buffer zone to the Bluetooth speaker group according to the adjusted speaker group buffer requirement set, to obtain an audio buffer zone allocation scheme;
[0125] Specifically, the speaker group jitter compensation factor set can be loaded, which includes the jitter standard deviation factor, the jitter trend factor and the jitter prediction compensation factor. At the same time, the speaker group buffer zone benchmark value is also loaded. Next, the compensation adjustment value of each speaker is calculated. For example, according to the jitter standard deviation factor, the buffer zone size is increased to adapt to network jitter. If the jitter trend factor shows that the jitter is increasing, the buffer zone size needs to be further increased. At the same time, according to the jitter prediction compensation factor, the future jitter demand on the buffer zone size is predicted. Set an algorithm to combine the jitter compensation factor set and the buffer zone benchmark value to adjust the buffer requirement of each speaker. For example, if the buffer requirement of a speaker is originally 2 seconds, but its jitter standard deviation factor is high, its buffer requirement is increased to 2.5 seconds. Then, according to the adjusted buffer requirement set, the buffer zone is allocated to the Bluetooth speaker group. Ensure that the buffer zone size of each speaker at least meets its adjusted buffer requirement, while not exceeding the buffer zone benchmark value. Finally, an audio buffer zone allocation scheme is obtained, which details the buffer zone size of each speaker.
[0126] Step S376: Collect audio stream characteristics based on the audio buffer zone allocation scheme for the Bluetooth speaker group, to obtain an audio stream characteristic dataset;
[0127] Specifically, audio stream characteristic collection can be performed using audio analysis software like Adobe Audition in conjunction with network monitoring tools like Wireshark. First, configure Wireshark to capture the network traffic of the Bluetooth speaker group, specifically the packets related to the audio stream. Focus on the size, transmission time, and order of arrival of these packets, as 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, as 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, discover that the bit rate of the audio stream varies significantly over different time periods, or that the audio encoding format has special requirements for buffer size. Use a script or software program to organize and analyze this data, and save the results in an audio stream characteristic dataset. This dataset includes the audio stream characteristics of each speaker, such as average bit rate, peak bit rate, encoding format, and any observed variations. Finally, obtain the audio stream characteristic dataset, 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 based on the audio stream characteristic dataset, resulting in a speaker group audio preloading sequence.
[0129] Specifically, the audio stream characteristic dataset can be loaded and analyzed for each speaker's audio stream characteristics. Focus on those characteristics that affect the preloading strategy, such as bit rate variations and encoding format. Generate a preloading sequence based on the audio stream characteristics and the buffer allocation scheme. For example, for speakers with large bit rate variations, generate a more frequently updated preloading sequence to ensure that there is always enough data in the buffer to handle peak bit rates. For speakers using a specific encoding format, adjust the preloading sequence to accommodate the specific requirements of that format. Use a script or software program to calculate the preloading sequence for each speaker. This program will take into account the characteristics of the audio stream and the size of the buffer to determine the optimal preloading timing and data volume. Then, generate a preloading task list for each speaker, which details the timing, data volume, and priority of the preloading.
[0130] The application realizes accurate playback delay control and can manage playback delay more meticulously by calculating the expected playback delay and forming an expected matrix. By combining the audio stream speed feature vector and the playback delay expected matrix, the buffer requirements of the speaker group can be accurately calculated, and more reasonable buffer allocation can be performed, thereby optimizing buffer requirement analysis. By extracting the maximum buffer requirement value and performing compensation adjustment, the efficiency of buffer allocation is further improved, ensuring the stability of the audio stream. Reasonable buffer allocation and audio stream characteristic collection help to reduce interruptions and stalls during playback, enhance the smoothness of audio playback, and improve audio quality. The application can dynamically adjust buffer allocation according to real-time audio stream characteristics and buffer requirements, enhancing the adaptive ability of the system and enabling it to adapt to different network environments and audio characteristics. Through accurate buffer requirement calculation and compensation adjustment, waste of buffer area resources is avoided, and resource utilization is improved. Finally, the speaker group audio preloading sequence is obtained, which contains the preloading task list of each speaker in the speaker group.
[0131] Preferably, step S4 comprises the following steps:
[0132] Step S41: Memory allocation is performed on the Bluetooth speaker group according to the audio buffer allocation scheme, and a speaker group cache space allocation diagram is obtained.
[0133] Specifically, a memory management tool such as Windows Memory Diagnostic Tool or Linux Memtool can be used to perform memory allocation. First, determine the buffer size required by each speaker, which is obtained from the audio buffer allocation scheme. Assign a data structure to each speaker to represent its cache space, including the starting address, size, and other related attributes. Next, use the memory management tool to scan available memory resources and allocate them according to the buffer requirements of the speakers. For example, if a speaker needs a 10MB buffer, allocate a continuous 10MB space from the available memory to the speaker. Record the memory allocation of each speaker, including the starting address and size, and generate a speaker group cache space allocation diagram. This diagram can be a table or a graphical interface showing the cache space location and size of each speaker. Finally, the speaker group cache space allocation diagram is obtained, which details the cache space allocation of each speaker.
[0134] Step S42: Task decomposition and mapping are performed 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 a preloading sequence based on the audio stream feature dataset 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:00 AM, 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 preloading task list for the speaker group is obtained.
[0136] Step S43: extracting audio data from a preset audio source according to the pre-loaded task list of the speaker group to obtain an original audio pre-cached data set;
[0137] Specifically, this work can be performed using audio processing software such as Audacity and a scripting language such as Python, in conjunction with its audio processing library, such as librosa. The details of the audio data to be extracted are 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, the audio source file is opened using Audacity and its built-in cropping tool is used to extract the required audio segment. For automated processing, a Python script is used in conjunction with the librosa library to automate the extraction process. The script iterates through 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, one for each 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 the compression encoding. First, the compression encoding format of the audio data is determined, which is selected based on the characteristics of the audio data and the decoding capabilities of the soundbar. For example, a high-efficiency audio encoding format such as AAC or Opus is selected. Next, FFmpeg is used to compression encode each audio file in the original audio pre-buffering dataset. The encoding process is controlled by inputting corresponding parameters such as encoding format, bit rate, sampling rate, etc. through command line tools. For example, the following FFmpeg command is used to encode an audio file: ffmpeg -i input_audio.wav -c:a aac -b:a 128k output_audio.aac; this command encodes the input file input_audio.wav into an AAC format audio with a bit rate of 128 kbps. Then, the compression encoded audio files are collected and packaged into a compression encoded audio data package. This package can be a single file containing all the compression audio data of the soundbars, or a collection of multiple files, each corresponding to a soundbar.
[0140] Step S45: Write the compression encoded audio data package into the cache of each Bluetooth soundbar in the Bluetooth soundbar group according to the soundbar group cache space allocation map, thereby obtaining the audio pre-buffering dataset;
[0141] Specifically, the soundbar group cache space allocation map can be loaded, which contains detailed information of the cache space of each soundbar, including the starting address and size of the cache. Next, the compression encoded audio data package is transmitted to each soundbar using Bluetooth technology. A Bluetooth transmission protocol such as Bluetooth Advanced Audio Distribution Profile (A2DP) is used to realize the wireless transmission of audio data. According to the cache space allocation map, the transmitted audio data is written into the cache space of the corresponding soundbar. Ensure that each soundbar 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 to the cache of the soundbar and no errors occur. If errors are found, retransmit and write the data until successful. Finally, the audio pre-buffering dataset is obtained, which indicates that the corresponding compression encoded audio data has been stored in the cache space of all soundbars.
[0142] Step S46: Perform clock synchronization calibration on the audio pre-buffering dataset based on the soundbar group time synchronization network, obtain the soundbar group synchronization time reference, and perform timing association between the audio pre-buffering dataset and the soundbar group synchronization time reference, obtain the soundbar group synchronization playback timing diagram;
[0143] Specifically, clock synchronization calibration can be performed using a time synchronization protocol, such as the Network Time Protocol (NTP), and a custom timing analysis tool. The NTP client is used to synchronize the network time on each soundbar. The NTP client is configured to communicate with a precise network time server to obtain accurate time information. Next, the timing analysis tool is used to calibrate the soundbar group's clocks. The internal clock of each soundbar is compared with the time of the NTP server, the time deviation is calculated, and the soundbar's clock is adjusted to synchronize with the network time. According to the clock synchronization result, the soundbar group synchronization time reference is obtained. This reference is a common time reference followed by all soundbars to ensure the synchronization of audio playback. The audio pre-cached dataset is time-correlated with the soundbar group synchronization time reference. Time labels are added to each audio clip in the audio dataset, indicating the specific time they should be played. Finally, the soundbar group synchronization playback timing diagram is obtained, which lists in detail the audio clips of each soundbar and their playback times.
[0144] Step S47: The soundbar group synchronization playback timing diagram is serialized into instruction sets to obtain the soundbar group synchronization playback control instruction set.
[0145] Specifically, the instruction serialization can be completed using the SyncPlay Command Generator software tool. First, open the SyncPlay Command Generator software and load the soundbar group synchronization playback timing diagram. Set the software to generate playback instructions. For each soundbar, the software will generate a playback instruction according to the information in the timing diagram, which includes the unique identification of the soundbar, the name of the audio clip, and the specific time of playback. Check the generated instructions to ensure they accurately reflect the requirements of the timing diagram. For example, if a soundbar A should play an audio clip "AudioClip_01" at 10 seconds, verify that the instruction matches the timing diagram. If there is any discrepancy, correct the instruction accordingly. After confirming the correctness of all instructions, collect all generated instructions to form a complete soundbar group synchronization playback control instruction set. This instruction set will contain the playback instructions of all soundbars, each of which clearly indicates the time point and audio clip to be played. Figure 1
[0146] The application ensures the reasonable use of cache space through efficient memory management, and the optimized preloading strategy makes the preloading process of audio data more orderly and efficient. Through the extraction and compression encoding processing of audio data, not only the efficiency of data transmission and storage is improved, the time and space required for pre-caching are reduced, but also the consistency of data in the speaker group is ensured. Through clock synchronization calibration and timing association, accurate synchronization playback of the speaker group is realized, which significantly improves the synchronization accuracy of audio playback. The synchronization playback timing diagram and instruction serialization ensure the smooth and continuous playback of audio content, significantly improving the user's auditory experience. In addition, through precise time synchronization and a set of playback control instructions, the stability and reliability of the system in the face of network fluctuations or other abnormal situations are enhanced. The application also has good flexibility and scalability, and can adapt to different sizes of speaker groups and different audio sources.
[0147] Preferably, the application also provides a Bluetooth speaker synchronous playback system for executing the Bluetooth speaker synchronous playback method as described above, which comprises:
[0148] A synchronization network construction module is configured to perform master device election on the Bluetooth speaker group to obtain a speaker group master device identifier, and perform distributed time synchronization network construction on the Bluetooth speaker group based on the speaker group master device identifier to obtain a speaker group time synchronization network.
[0149] A frequency band allocation module is configured to perform environment signal scanning on the Bluetooth speaker group to obtain environment frequency band signal data, and perform dynamic frequency band allocation on the Bluetooth speaker group based on the environment frequency band signal data to obtain a speaker group frequency band allocation scheme.
[0150] A preloading module is configured to perform network performance parameter monitoring on the Bluetooth speaker group to obtain a set of speaker group network performance parameters, perform audio buffer determination on the Bluetooth speaker group according to the set of speaker group network performance parameters to obtain an audio buffer allocation scheme, and perform audio preloading segment determination on the Bluetooth speaker group according to the audio buffer allocation scheme to obtain a speaker group audio preloading sequence.
[0151] A synchronous playback module is configured to perform distributed audio data pre-caching on the Bluetooth speaker group according to the audio buffer allocation scheme and the speaker group audio preloading sequence to obtain a set of audio pre-caching data, and perform synchronous playback control on the set of audio pre-caching data based on the speaker group time synchronization network to obtain a set of speaker group synchronous playback control instructions.
[0152] Therefore, from any point of view, the embodiments should be regarded as exemplary and non-limiting, the scope of the application is defined by the appended claims rather than the above description, and therefore all changes falling within the meaning and scope of the equivalent elements of the application file are intended to be included in the application.
[0153] The foregoing is considered as illustrative only of the principles of the application. Numerous modifications and changes will readily occur to those skilled in the art, and it is intended to embrace all such modifications and changes that fall within the scope of the application. Accordingly, the application is not to be restricted in scope to the specific embodiments disclosed herein but is to be accorded the full scope that the principles and novel features request appropriately granted.
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 and obtain the master device identifier of the speaker group; A distributed time synchronization network is constructed for the Bluetooth speaker group based on the speaker group master device identifier 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 to the Bluetooth speaker group based on the environmental frequency band signal data to obtain a frequency band allocation plan for the speaker group; Step S3: monitoring the network performance parameters of the Bluetooth speaker group to obtain a speaker group network performance parameter set; determining 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 an audio preloading sequence for the speaker group; wherein 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 cluster network performance parameter set to perform model training on a preset long short-term memory neural network architecture to obtain a speaker cluster 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 based on 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: Calculating 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 determining the audio preloading segment for the Bluetooth speaker group to obtain an audio preloading sequence for the speaker group; 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.
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 to obtain a speaker group timestamp data set; Step S14: performing delay compensation on the Bluetooth speaker group based on the speaker group timestamp dataset to obtain an optimized timestamp dataset for the speaker group; Step S15: performing distributed clock synchronization on the Bluetooth speaker group based on the optimized timestamp data set of the speaker group 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 an election process for 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 plurality of Bluetooth speaker status data, each Bluetooth speaker status data including clock stability data, processor performance parameters, and network connection quality data; Step S112: performing a comprehensive suitability evaluation on the corresponding Bluetooth speaker based on the clock stability data, the processor performance parameters, and the network connection quality data to obtain device suitability 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 and a network delay test on the Bluetooth speakers corresponding to the master device candidate list, and obtaining a clock stability test result set and a network delay test result set; Step S115: performing 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, and obtaining 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: Calculating the time deviation of the Bluetooth speaker group based on the speaker group timestamp dataset to obtain a speaker time deviation result set; Step S142: Designing a PI controller for the Bluetooth speaker group based on the speaker time deviation result set to obtain a speaker group PI controller; Step S143: calculating a frequency adjustment amount for 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 a phase adjustment amount for 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 dataset according to the synchronization signal transition strategy and the maximum adjustment limit data to obtain an optimized timestamp dataset for the speaker group.
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 ambient 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 features from the potential interference source data based on the environmental frequency band signal data to obtain potential interference source feature data, and identifying the potential interference source type from the potential interference source data based on the potential interference source feature data to obtain potential interference source type data; Step S27: Calculating the frequency band occupancy of the segmented signal data based on 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 generating a spectrum occupancy heat map based on 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 graph for the spectrum occupancy heat map to obtain a frequency band spectrum graph for the speaker group, and mapping the frequency band spectrum graph for the speaker group with the device nodes of the Bluetooth speaker group to obtain a spectrum node graph for the speaker group; Step S282: performing spatial distribution measurement on the Bluetooth speaker group to obtain a spatial distribution diagram of the speaker group, and determining 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 based on 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 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 a playback delay expectation matrix; Step S372: measuring the audio flow rate of the Bluetooth speaker group to obtain an audio flow rate feature vector; Step S373: Calculating the buffering requirements of the Bluetooth speaker group based on the expected playback delay matrix and the audio flow rate feature vector to obtain a speaker group buffering requirement dataset; 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 buffers to the Bluetooth speaker group according to the adjusted speaker group buffer requirement set to obtain an audio buffer allocation plan; 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.
8. The Bluetooth speaker synchronous playback method according to claim 1, characterized in that: Step S4 includes the following steps: Step S41: Allocating 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 pre-loaded 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 encoded audio data packet into the cache of each Bluetooth speaker in the Bluetooth speaker group according to the speaker group cache space allocation map, 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 speaker group synchronous playback timing diagram to obtain the speaker group synchronous playback control instruction set.
9. A Bluetooth speaker synchronous playback system, characterized in that: The Bluetooth speaker synchronous playback system includes: A synchronization 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 ambient signal of the Bluetooth speaker group to obtain ambient frequency band signal data; based on the ambient frequency band signal data, the module dynamically allocates the frequency band of the Bluetooth speaker group to obtain a frequency band allocation plan for the speaker group; A 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 based on the set of network performance parameters of the speaker group to obtain an audio buffer allocation plan; determine the audio preloading segment of the Bluetooth speaker group based on the audio buffer allocation plan to obtain an audio preloading sequence of the speaker group; Monitor the network performance parameters of the Bluetooth speaker group to obtain a set of network performance parameters of the speaker group; The speaker cluster network performance parameter set is used to train the preset long short-term memory neural network architecture to obtain the speaker cluster network performance time series model; The speaker cluster network performance time series model is used to predict network parameter changes in a preset future time window to obtain a short-term network performance prediction result set; Score the network quality of the Bluetooth speaker group based on the short-term network performance prediction result set to obtain the speaker group network quality score; 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; Performing network jitter compensation calculation on the Bluetooth speaker group based on 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; Calculating 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 determining the audio preloading segment of the Bluetooth speaker group to obtain an 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 speaker group audio preloading sequence to obtain an audio pre-cache data set; and to perform synchronous playback control on the audio pre-cache data set based on the speaker group time synchronization network to obtain a speaker group synchronous playback control instruction set.
Citation Information
Patent Citations
Real-time audio interaction method based on LE Audio multi-Bluetooth audio equipment
CN117295043A
Bluetooth earphone low-delay transmission method
CN117440440A