Audio synchronization and communication method for offline terminal

Through the synchronization module of GPS clock and local clock and LoRa wireless radio frequency technology, the time and audio synchronization of multiple offline terminals without network connection is realized, and wide-range and infinite cascaded coverage communication is supported, solving the problems of synchronization error and communication distance limitation in the prior art.

CN117879748BActive Publication Date: 2025-05-13GUANGZHOU BAOLUN ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410052247.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-12
Publication Date
2025-05-13
Estimated Expiration
2044-01-12

AI Technical Summary

Technical Problem

The prior art is difficult to realize time and audio synchronization of multiple offline terminals without network connection, and the existing communication methods cannot realize any number of mutual communication between multiple devices.

Method used

By obtaining the 1PPS second pulse signal generated by the GPS clock and the 1PPS pulse signal generated by the local clock, the synchronization module of the phase comparator, low-pass filter and voltage-controlled oscillator is used to adjust the local clock signal to synchronize with the GPS clock, and the LoRa wireless radio frequency technology is used to achieve wide-range and infinite cascaded coverage communication between multiple devices.

Benefits of technology

Time and audio synchronization of multiple offline terminals without network connection is realized, and long-distance, wide-range and infinite cascaded coverage communication is supported, solving the problems of time synchronization error and communication distance limitation in the prior art.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117879748B_ABST
    Figure CN117879748B_ABST
Patent Text Reader

Abstract

The present invention discloses an audio synchronization and communication method for an offline terminal. The audio synchronization method is applied to a first offline terminal, which is one of several offline terminals in a communication system. Each offline terminal in the communication system is respectively connected to other offline terminals in a preset range for communication. The audio synchronization method comprises: if the first offline terminal receives broadcast data sent by a second offline terminal, a response message is sent to the second offline terminal, so that the second offline terminal sends synchronization messages to each target offline terminal after receiving responses from all target offline terminals. If the first offline terminal receives a synchronization message sent by the second offline terminal, a time difference between a received first timestamp and a local second timestamp is calculated, and respective task execution times are determined according to the time difference. According to the task execution time and the broadcast data, corresponding broadcast tasks are executed to achieve time and audio synchronization of multiple offline terminals.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to an audio synchronization and communication method of an offline terminal. Background Art

[0002] Offline audio terminals, also known as offline audio terminals, refer to devices that can independently operate and process audio without an Internet connection or an external server. These devices usually have built-in audio processing capabilities and storage media, and can play, record, process and store audio files. Such as music players, portable speakers, digital audio amplifiers, audio collectors, etc.

[0003] Because offline terminals have no network connection and are independent offline devices, the use scenarios of the devices are relatively limited. For example, in some application scenarios, when multiple offline terminals, such as speakers and amplifiers, are required to synchronously collect and play audio data at precise time, independent devices need to maintain precise synchronization in time and cooperate with each other in tasks to avoid confusion and misalignment of audio data. In the current existing technology, the clock of the offline terminal is mainly based on a single-chip microcomputer combined with a clock chip to provide a reference clock. However, the clock chip will have a reference error in the long-term use, and there is also a deviation between the time chips of each offline device. Another technical solution is to use a GPS module to obtain satellite UTC time synchronization. Because the message data of the GPS module is sent to the MCU through the serial port, the UTC time received by the system will have a delay in serial communication and a machine cycle difference in message data processing and operation, so the time node may have a slight drift, resulting in the time nodes between devices cannot be completely synchronized, thereby destroying the audio synchronization between devices.

[0004] In terms of task collaboration, the main technologies currently used are Bluetooth, WiFi, ZigBee, 2.4G, infrared and NFC communications. Usually, the transmission distance of these communication methods is relatively short, or only one of the two can be chosen: long distance and low power consumption. Moreover, the communication between them is usually point-to-point, and it is impossible for any number of devices to communicate with each other. Summary of the invention

[0005] The present invention provides an audio synchronization and communication method for offline terminals, so as to realize time and audio synchronization of multiple offline terminals and realize long-distance, wide-range and unlimited cascade coverage communication of multiple offline devices without network connection.

[0006] The present invention provides an audio synchronization method for an offline terminal, which is applied to a first offline terminal, which is one of several offline terminals in a communication system; each of the offline terminals in the communication system is respectively connected to other offline terminals within a preset range for communication;

[0007] The audio synchronization method comprises:

[0008] If the first offline terminal receives broadcast data sent by any second offline terminal in the communication system, a response message is sent to the second offline terminal according to the transmission path of the broadcast data, so that after receiving the responses from all target offline terminals, the second offline terminal sends a synchronization message to each target offline terminal according to the communication connection relationship between the second offline terminal and each target offline terminal, and the synchronization message includes a first timestamp of the execution time of each target offline terminal; the target offline terminal is obtained by the second offline terminal according to the received broadcast task;

[0009] If the first offline terminal receives the synchronization message sent by the second offline terminal, the time difference between the received first timestamp and the local second timestamp is calculated, and the respective task execution times are determined according to the time difference, wherein the first timestamp is obtained by the UTC time acquired by the GPS module of the second offline terminal and sent by the second offline terminal; the second timestamp is obtained according to the local time of the local clock of the first offline terminal, specifically:

[0010] The GPS second pulse signal and the local clock pulse signal are input into the synchronization module, so that the MCU module of the first offline terminal adjusts the local clock signal according to the output signal of the synchronization module, so that the output frequency and phase of the local clock are the same as those of the GPS second pulse clock; according to the task execution time and the broadcast data, the corresponding broadcast task is executed.

[0011] Further, the GPS second pulse signal and the local clock pulse signal are input into a synchronization module so that the MCU module of the first offline terminal adjusts the local clock signal according to the output signal of the synchronization module, so that the output frequency and phase of the local clock are the same as those of the GPS second pulse clock, specifically:

[0012] The synchronization module includes: a phase comparator, a low-pass filter and a voltage-controlled oscillator;

[0013] The GPS second pulse signal and the local clock pulse signal are input into the phase comparator to obtain the frequency error and phase error between the GPS second pulse signal and the local clock pulse signal, and generate an error signal; the error signal is input into the low-pass filter to convert the error signal into a DC pulse voltage; the DC pulse voltage is input into the voltage-controlled oscillator so that the voltage-controlled oscillator generates output frequency data according to the DC pulse voltage, so that the MCU module adjusts the local clock signal according to the output frequency data, so that the output frequency and phase of the local clock are the same as those of the GPS second pulse clock.

[0014] Furthermore, the GPS second pulse signal and the local clock pulse signal are input into the phase comparator to obtain the frequency error and phase error between the GPS second pulse and the local clock pulse, and generate an error signal, specifically:

[0015] An analog multiplier is used as a phase comparator, the first voltage of the input GPS second pulse signal and the second voltage of the voltage-controlled oscillator output signal are input into the analog multiplier, and the product of the GPS second pulse signal, the local clock pulse signal and the multiplication gain is output as an error signal; the second voltage is output by the voltage-controlled oscillator according to the acquired local clock pulse signal.

[0016] Furthermore, the step of inputting the error signal into the low-pass filter and converting the error signal into a DC pulse voltage is specifically as follows:

[0017] The error signal is input into the low-pass filter, the sum frequency component in the error signal is filtered out, the difference frequency component in the error signal is obtained, and the difference frequency component is used as a DC pulse voltage.

[0018] Further, the DC pulse voltage is input into the voltage-controlled oscillator so that the voltage-controlled oscillator generates output frequency data according to the DC pulse voltage, and the MCU module adjusts the local clock signal according to the output frequency data so that the output frequency and phase of the local clock are the same as the GPS second pulse clock, specifically:

[0019] The DC pulse voltage is used as the input signal of the voltage-controlled oscillator; the instantaneous phase difference is calculated according to the instantaneous oscillation angular frequency of the input signal, the oscillation angular frequency when the input signal is zero or a DC voltage, the instantaneous phase of the input signal and the instantaneous phase of the output signal;

[0020] Differentiate the instantaneous phase difference to obtain frequency difference information; when the frequency difference information is not equal to zero, obtain the output voltage of the phase comparator, input the output voltage into a low-pass filter to filter the sum frequency component in the output voltage, and obtain the remaining difference frequency component; use the difference frequency component as the input control voltage of the voltage-controlled oscillator, and adjust the output frequency of the voltage-controlled oscillator until the frequency difference information is equal to zero.

[0021] As a preferred solution, the present invention obtains the 1PPS pulse signal generated by the GPS clock and the 1PPS pulse signal generated by the local clock of each terminal, and uses the phase error of the two electrical signals to adjust the loop's own feedback to achieve the frequency locking and phase tracking function of the output signal to the input signal. The local pulse signal continuously tracks the GPS clock pulse, and the local voltage-controlled crystal oscillator is adjusted through an algorithm to eliminate the error between the local pulse signal and the GPS pulse clock, thereby achieving time synchronization and further achieving audio synchronization.

[0022] Other features and advantages of the present invention will be described in detail in the following detailed description.

[0023] Accordingly, the present invention also provides a communication method of an offline terminal, which is applied to a second offline terminal; the second offline terminal is one of several offline terminals in a communication system; each of the offline terminals in the communication system is respectively connected to communicate with other offline terminals within a preset range;

[0024] The communication method comprises:

[0025] When the second offline terminal receives the broadcast task, it obtains target offline terminal information; the target offline terminal is one or more offline terminals in the communication system; if the communication connection relationship between the second offline terminal and all the target offline terminals is recorded in the first list record of the second offline terminal, then according to the communication connection relationship, broadcast data is sent to each of the target offline terminals through a preset broadcast channel, so that each of the target offline terminals sends a response message to the second offline terminal after receiving the broadcast data;

[0026] After receiving responses from all the target offline terminals, a synchronization message is sent to each of the target offline terminals according to the communication connection relationship, and the synchronization message includes a first timestamp of the execution time of each target offline terminal, so that when all the target offline terminals receive the broadcast data, they can use the audio synchronization method of the offline terminal as any one of the contents of the present invention to perform time synchronization, determine their respective task execution times, and execute corresponding broadcast tasks according to the task execution time and the broadcast data.

[0027] Furthermore, it also includes:

[0028] If the first list record does not record the communication connection relationship between the second offline terminal and any of the target offline terminals, the target offline terminal with unknown communication connection relationship is used as the query target;

[0029] By sending an inquiry broadcast, the communication connection relationship with the query target is determined, specifically:

[0030] Sending an inquiry broadcast to the sending target of the second offline terminal, the sending target of the second offline terminal is a third offline terminal that is communicatively connected to the second offline terminal, so that each of the third offline terminals queries its own second list record; if the second list record does not record the query target, sending an inquiry broadcast to the sending target of the third offline terminal, until any fourth offline terminal responds to the received inquiry broadcast, and the offline terminal that receives the response responds to its own inquiry broadcast; the reply operation is triggered when the fourth offline terminal queries the query target in the list record, or when the fourth offline terminal is the query target; the sending target of any offline terminal is the offline terminal that is communicatively connected to it;

[0031] According to the reply received by the second offline terminal, a communication connection relationship with the query target is determined.

[0032] Further, according to the communication connection relationship, broadcast data is sent to each of the target offline terminals through a preset broadcast channel, so that each of the target offline terminals sends a response message to the second offline terminal after receiving the broadcast data, specifically:

[0033] The MCU module is used to transmit the broadcast data to the LoRa radio frequency module through the SPI interface, so that the LoRa radio frequency module modulates the broadcast data to generate task data, and sends the task data to the corresponding third offline terminal through a preset broadcast channel, so that the corresponding third offline terminal receives and demodulates the task data, or sends the task data to the next offline terminal according to the communication connection relationship, until the target offline terminal receives the task data;

[0034] The preset broadcast channel is selected according to the target offline terminal, and the preset broadcast channel is the number of the target offline terminal, or the number corresponding to the whole network broadcast.

[0035] Furthermore, it also includes:

[0036] If the corresponding third offline terminal is the target offline terminal, receiving and demodulating the task data;

[0037] If the corresponding third offline terminal is not the target offline terminal, the task data is sent to the next offline terminal according to the communication connection relationship until the target offline terminal receives the task data.

[0038] As a preferred solution, the present invention uses multiple offline devices to form a distributed interactive communication system. When an offline device initiates a broadcast task, it can be combined with the main control MCU algorithm task scheduling. Through the distributed interactive communication system, the principle of mutual communication between multiple offline devices is used to transfer the broadcast task between multiple offline devices in sequence until it reaches the target offline device. At the same time, the present invention adopts LoRa wireless radio frequency technology, and utilizes the low bandwidth, low power consumption, long distance and multi-node characteristics of LoRa communication to achieve long-distance, wide-range and unlimited cascade coverage communication between multiple offline devices without network connection.

[0039] Correspondingly, the present invention also provides a computer-readable storage medium, which includes a stored computer program; wherein, when the computer program is running, it controls the device where the computer-readable storage medium is located to execute an audio synchronization method for an offline terminal or a communication method for an offline terminal as described in the content of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 It is a flowchart of an embodiment of the audio synchronization method of an offline terminal provided by the present invention;

[0041] Figure 2 It is a structural schematic diagram of a main control system of each offline terminal in an embodiment of the audio synchronization method of the offline terminal provided by the present invention;

[0042] Figure 3 It is a schematic diagram of the interaction relationship between the synchronization module and the MCU module of each offline terminal in an embodiment of the audio synchronization method of the offline terminal provided by the present invention;

[0043] Figure 4 It is a flow chart of an embodiment of a communication method for an offline terminal provided by the present invention;

[0044] Figure 5 It is a structural diagram of a cellular network interactive communication network of an embodiment of the communication method of an offline terminal provided by the present invention;

[0045] Figure 6 It is a structural schematic diagram of an embodiment of an audio synchronization device for an offline terminal provided by the present invention;

[0046] Figure 7 It is a structural schematic diagram of an embodiment of a communication device for an offline terminal provided by the present invention. DETAILED DESCRIPTION

[0047] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0048] Embodiment 1

[0049] Please refer to Figure 1 , an audio synchronization method for an offline terminal provided in an embodiment of the present invention, is applied to a first offline terminal, the first offline terminal is one of several offline terminals in a communication system; each of the offline terminals in the communication system is respectively connected to other offline terminals within a preset range for communication;

[0050] The audio synchronization method comprises steps S101-S103:

[0051] Step S101: If the first offline terminal receives broadcast data sent by any second offline terminal in the communication system, a response message is sent to the second offline terminal according to the transmission path of the broadcast data, so that after receiving the responses from all target offline terminals, the second offline terminal sends a synchronization message to each target offline terminal according to the communication connection relationship between the second offline terminal and each target offline terminal, and the synchronization message includes a first timestamp of the execution time of each target offline terminal; the target offline terminal is obtained by the second offline terminal according to the received broadcast task;

[0052] Step S102: If the first offline terminal receives the synchronization message sent by the second offline terminal, the time difference between the received first timestamp and the local second timestamp is calculated, and the respective task execution times are determined according to the time difference. The first timestamp is obtained by the UTC time acquired by the GPS module of the second offline terminal and sent by the second offline terminal; the second timestamp is obtained according to the local time of the local clock of the first offline terminal, specifically:

[0053] The GPS second pulse signal and the local clock pulse signal are input into the synchronization module, so that the MCU module of the first offline terminal adjusts the local clock signal according to the output signal of the synchronization module, so that the output frequency and phase of the local clock are the same as those of the GPS second pulse clock; according to the task execution time and the broadcast data, the corresponding broadcast task is executed.

[0054] Further, the GPS second pulse signal and the local clock pulse signal are input into a synchronization module so that the MCU module of the first offline terminal adjusts the local clock signal according to the output signal of the synchronization module, so that the output frequency and phase of the local clock are the same as those of the GPS second pulse clock, specifically:

[0055] The synchronization module includes: a phase comparator, a low-pass filter and a voltage-controlled oscillator;

[0056] The GPS second pulse signal and the local clock pulse signal are input into the phase comparator to obtain the frequency error and phase error between the GPS second pulse signal and the local clock pulse signal, and generate an error signal; the error signal is input into the low-pass filter to convert the error signal into a DC pulse voltage; the DC pulse voltage is input into the voltage-controlled oscillator so that the voltage-controlled oscillator generates output frequency data according to the DC pulse voltage, so that the MCU module adjusts the local clock signal according to the output frequency data, so that the output frequency and phase of the local clock are the same as those of the GPS second pulse clock.

[0057] Furthermore, the GPS second pulse signal and the local clock pulse signal are input into the phase comparator to obtain the frequency error and phase error between the GPS second pulse and the local clock pulse, and generate an error signal, specifically:

[0058] An analog multiplier is used as a phase comparator, the first voltage of the input GPS second pulse signal and the second voltage of the voltage-controlled oscillator output signal are input into the analog multiplier, and the product of the GPS second pulse signal, the local clock pulse signal and the multiplication gain is output as an error signal; the second voltage is output by the voltage-controlled oscillator according to the acquired local clock pulse signal.

[0059] Furthermore, the step of inputting the error signal into the low-pass filter and converting the error signal into a DC pulse voltage is specifically as follows:

[0060] The error signal is input into the low-pass filter, the sum frequency component in the error signal is filtered out, the difference frequency component in the error signal is obtained, and the difference frequency component is used as a DC pulse voltage.

[0061] Further, the DC pulse voltage is input into the voltage-controlled oscillator so that the voltage-controlled oscillator generates output frequency data according to the DC pulse voltage, and the MCU module adjusts the local clock signal according to the output frequency data so that the output frequency and phase of the local clock are the same as the GPS second pulse clock, specifically:

[0062] The DC pulse voltage is used as the input signal of the voltage-controlled oscillator; the instantaneous phase difference is calculated according to the instantaneous oscillation angular frequency of the input signal, the oscillation angular frequency when the input signal is zero or a DC voltage, the instantaneous phase of the input signal and the instantaneous phase of the output signal;

[0063] Differentiate the instantaneous phase difference to obtain frequency difference information; when the frequency difference information is not equal to zero, obtain the output voltage of the phase comparator, input the output voltage into a low-pass filter to filter the sum frequency component in the output voltage, and obtain the remaining difference frequency component; use the difference frequency component as the input control voltage of the voltage-controlled oscillator, and adjust the output frequency of the voltage-controlled oscillator until the frequency difference information is equal to zero.

[0064] In this embodiment, please refer to Figure 2 , which is the main control system of each offline terminal, including: audio input and output interface, other third-party interfaces, MCU module, LoRa radio frequency module, GPS module and synchronization module;

[0065] Each offline terminal has a built-in GPS module to achieve accurate timing of the device and 1PPS second pulse reference signal. The pulse signal is synchronized by the synchronization module and input to the MCU module to ensure the accuracy of the terminal clock and the synchronization of audio played between multiple devices. The LoRa wireless radio frequency uses the SX1268 as the core radio frequency transceiver module, which supports data transparent transmission, fixed-point transmission, fixed-point broadcasting and channel monitoring. It is set to work in the 433MHz ISM frequency band, and the communication distance can reach 5km, which is enough to cover large scenes such as parks, playgrounds and lecture halls.

[0066] In this embodiment, please refer to Figure 3 , is the interaction relationship between the synchronization module of each offline terminal and the MCU module, the synchronization module includes: a phase comparator PD, a low-pass filter LPF and a voltage-controlled oscillator VCO;

[0067] Get the 1PPS pulse-per-second signal f generated by the GPS clock g , the local clock generates a 1PPS pulse signal f v , f g and f v Sent to the phase comparator to generate an error signal V pd ; The error signal V pd Input low-pass filter to convert the error signal into a DC pulse voltage V co , control V co Input to the voltage-controlled oscillator to notify the MCU module to adjust the output frequency f of the local clock v , so that the MUC can adjust the clock frequency and phase to be completely synchronized with the GPS second pulse 1PPS clock, ensuring the time synchronization of the entire wireless communication system.

[0068] In this embodiment, the phase comparator is composed of an analog multiplier. Assume that the voltage of the second pulse signal input by the GPS is: i (t) = U m sin[ω i t+θ i (t)];

[0069] The signal voltages output by the voltage-controlled oscillator are: o (t) = U om cos[ω o t+θ o (t)];

[0070] In the formula, ω o is the oscillation angular frequency of the voltage-controlled oscillator when the input control voltage is zero or a DC voltage, then the output voltage u of the analog multiplier D for:

[0071]

[0072] Among them, K is the multiplication gain. The output voltage u D The sum frequency component in the formula is filtered out, and the remaining difference frequency component is used as the input control voltage Uc(t) of the voltage-controlled oscillator, which is:

[0073]

[0074] In the above formula, ω i is the instantaneous oscillation angular frequency of the input signal, θ i (t) and θ o (t) are the instantaneous phases of the input signal and the output signal respectively. According to the relationship between the phasors, the relationship between the instantaneous frequency and the instantaneous phase is: Then the instantaneous phase difference θ d is: d =(ω i -ω o )t+θ i (t)-θ o (t);

[0075] Differentiating both sides, we can get the frequency difference relationship as:

[0076]

[0077] When the frequency difference is equal to zero, the frequency and phase of the output and input signals remain constant. c (t) is a constant value. When the frequency difference relation is not equal to zero, the frequencies of the input signal and the output signal are not equal, u c (t) varies with time.

[0078] Implementing the embodiments of the present invention has the following effects:

[0079] The present invention obtains the 1PPS pulse signal generated by the GPS clock and the 1PPS pulse signal generated by the local clock of each terminal, and uses the phase error of the two electrical signals to adjust the loop's own feedback to achieve the frequency locking and phase tracking function of the output signal to the input signal. The local pulse signal continuously tracks the GPS clock pulse, and the local voltage-controlled crystal oscillator is adjusted through an algorithm to eliminate the error between the local pulse signal and the GPS pulse clock, thereby achieving time synchronization and further achieving audio synchronization.

[0080] Embodiment 2

[0081] Please refer to Figure 4 , a communication method for an offline terminal provided in an embodiment of the present invention, applied to a second offline terminal; the second offline terminal is one of several offline terminals of a communication system; each of the offline terminals in the communication system is respectively connected to communicate with other offline terminals within a preset range;

[0082] The communication method comprises steps S201-S203:

[0083] Step S201: when the second offline terminal receives a broadcast task, it obtains target offline terminal information; the target offline terminal is one or more offline terminals in the communication system; if the communication connection relationship between the second offline terminal and all the target offline terminals is recorded in the first list record of the second offline terminal, then according to the communication connection relationship, broadcast data is sent to each of the target offline terminals through a preset broadcast channel, so that each of the target offline terminals sends a response message to the second offline terminal after receiving the broadcast data;

[0084] Step S202: After receiving responses from all the target offline terminals, a synchronization message is sent to each of the target offline terminals according to the communication connection relationship, and the synchronization message includes a first timestamp of the execution time of each target offline terminal, so that when all the target offline terminals receive the broadcast data, the audio synchronization method of the offline terminal of any one of the first embodiments is used to perform time synchronization, determine the respective task execution time, and execute the corresponding broadcast task according to the task execution time and the broadcast data.

[0085] Furthermore, it also includes:

[0086] If the first list record does not record the communication connection relationship between the second offline terminal and any of the target offline terminals, the target offline terminal with unknown communication connection relationship is used as the query target;

[0087] By sending an inquiry broadcast, the communication connection relationship with the query target is determined, specifically:

[0088] Sending an inquiry broadcast to the sending target of the second offline terminal, the sending target of the second offline terminal is a third offline terminal that is communicatively connected to the second offline terminal, so that each of the third offline terminals queries its own second list record; if the second list record does not record the query target, sending an inquiry broadcast to the sending target of the third offline terminal, until any fourth offline terminal responds to the received inquiry broadcast, and the offline terminal that receives the response responds to its own inquiry broadcast; the reply operation is triggered when the fourth offline terminal queries the query target in the list record, or when the fourth offline terminal is the query target; the sending target of any offline terminal is the offline terminal that is communicatively connected to it;

[0089] According to the reply received by the second offline terminal, a communication connection relationship with the query target is determined.

[0090] Further, according to the communication connection relationship, broadcast data is sent to each of the target offline terminals through a preset broadcast channel, so that each of the target offline terminals sends a response message to the second offline terminal after receiving the broadcast data, specifically:

[0091] The MCU module is used to transmit the broadcast data to the LoRa radio frequency module through the SPI interface, so that the LoRa radio frequency module modulates the broadcast data to generate task data, and sends the task data to the corresponding third offline terminal through a preset broadcast channel, so that the corresponding third offline terminal receives and demodulates the task data, or sends the task data to the next offline terminal according to the communication connection relationship, until the target offline terminal receives the task data;

[0092] The preset broadcast channel is selected according to the target offline terminal, and the preset broadcast channel is the number of the target offline terminal, or the number corresponding to the whole network broadcast.

[0093] Furthermore, it also includes:

[0094] If the corresponding third offline terminal is the target offline terminal, receiving and demodulating the task data;

[0095] If the corresponding third offline terminal is not the target offline terminal, the task data is sent to the next offline terminal according to the communication connection relationship until the target offline terminal receives the task data.

[0096] In this embodiment, multiple offline terminals are combined into a cellular network interactive communication network with a distributed structure, such as Figure 5 As shown, the cellular network interactive communication network includes AH and 8 offline terminals.

[0097] Each of the offline terminals is respectively communicatively connected with other offline terminals within a preset range, specifically: offline terminal A is communicatively connected with offline terminals B, C and D within a preset range, and has no direct communication connection relationship with other offline terminals; offline terminal B is communicatively connected with offline terminals A, F and G within a preset range, and has no direct communication connection relationship with other offline terminals; and so on.

[0098] Each offline terminal device supports two-way communication, and each offline terminal device has two downlink receiving windows. The offline terminal can be used as a completely independent device. When there are many devices distributed in the application scenario or multi-offline collaboration is required, any device can initiate a task broadcast request to the specified channel through the LoRa wireless radio frequency. The MCU communicates with the RF module through the spi interface, and the digital data is converted into a LoRa modulated signal after the modulation process. The modulation process changes the frequency, amplitude or phase of the signal according to the input data, thereby forming a LoRa signal, and the modulated LoRa signal is sent out through the antenna. The LoRa module at the receiving end is responsible for demodulating the received signal. The demodulation process involves tracking the frequency changes of the signal and restoring it to the original modulated signal.

[0099] The FSK modem can transmit and receive 2-FSK modulated data packets at rates ranging from 0.6kbps to 300kbps. The bit rate setting involves the crystal oscillator, and the formula is as follows:

[0100]

[0101] FSK modulation is performed within the bandwidth of the PLL and is achieved by changing the fractional division ratio in the PLL feedback loop. A high-resolution Σ-Δ modulator allows very narrow frequency deviations. The frequency deviation Fdev is:

[0102]

[0103] Additionally, in transmit mode, in packet mode or continuous mode, several shaping filters can be used for signal processing. In receive mode, the best receive bandwidth is selected according to its own parameters.

[0104] In this embodiment, in order to realize the system composition and the data transmission mode between each layer, each LoRa node in the system communication protocol is reasonably assigned a node number (ID) and a channel. This system adopts a dual-segment ID allocation method, and the communication mode is divided into full-network broadcast and unicast, and the channel ID (number) occupies 2 bytes. The full-network broadcast channel ID is 0xFFxx, and the unicast channel ID is 0x00xx-0xFExx (the upper 8 bits are the broadcast or unicast device number, and the lower 8 bits are the number of the final target device). When full-network broadcast communication is required, the channel ID of 0xFFFF is used as the broadcast address; when a broadcast search for a certain device is required, the channel ID of 0xFF00-0xFFFE is used as the broadcast address.

[0105] As a preferred implementation scheme, assuming that the A offline terminal initiates a network-wide broadcast task after receiving the broadcast task, the MCU transmits the message to the LoRa RF module of the A offline terminal through the SPI interface. The LoRa RF module modulates the data and broadcasts it through the network-wide broadcast channel ID (0xFFFF). After other devices (BH) monitor the signal of the corresponding channel 0xFFFF, they demodulate the received signal and restore the data. After all devices receive the coordinated task, they are ready to enter the task execution state, wait for the GPS 1PSS second pulse synchronization signal, and start executing the task.

[0106] As another preferred implementation scheme, if it is necessary to specify the device communication, the unicast mode is adopted. For example, if A and B communicate, assuming that A is numbered 01 and B is numbered 02, the communication channel ID for A to send data to B is 0x0202. After the B offline terminal monitors the signal corresponding to the channel 0x0202, it demodulates the received signal and restores the data. After all devices receive the coordinated task, they are ready to enter the task execution state, wait for the GPS 1PSS second pulse synchronization signal, and start executing the task.

[0107] If the target device is beyond the communication distance of device A, it will be transferred by the intermediate device. For example, if A and G communicate, and G is numbered 03, the communication between A and G will be transferred by B, and the ID sent by A is 0x0203 (the upper 8 bits of 02 represent the number of device B, and the lower 8 bits of 03 represent the number of target device G). After the B offline terminal monitors the signal corresponding to channel 0x0203, it sends the received signal to the G offline terminal. After the G offline terminal monitors the signal corresponding to channel 0x0203, it demodulates the received signal and restores the data. After all devices receive the coordinated task, they are ready to enter the task execution state, waiting for the GPS 1PSS second pulse synchronization signal to start executing the task.

[0108] If one device fails or goes offline temporarily, the other devices can continue to play and transfer to each other and resync when the failed device comes back online.

[0109] In this embodiment, it is assumed that all devices have just been powered on and no communication record list is cached internally. After A is initially powered on, it obtains the communicable devices around it by sending broadcasts and records the information of all responding devices in the list. If device A wants to send information to device G, but A searches its own list records and finds that there is no G device in the list, then device A will broadcast to inquire about the devices B, C and D in the list (the same is true for devices B, C and D. When they are initially powered on, they have obtained the communicable devices around them through broadcasts and recorded the list). After receiving A's broadcast inquiry, B finds that the target device G that A wants to communicate with is in its own device list, so it responds to A. Then A sends the data to be sent to G to B, and B forwards it to G.

[0110] If devices B, C, and D do not find device G in their own lists, devices B, C, and D initiate an inquiry broadcast to the next device, where device B initiates an inquiry broadcast to devices F and G. After device G responds, device B responds to the inquiry broadcast sent by device A based on the response result of device G. Therefore, device A obtains the communication connection relationship of ABG and sets the channel ID to 0x0203.

[0111] In this embodiment, the distributed interactive communication system of the present invention can query the communication connection relationship between itself and other offline terminals by initiating an inquiry broadcast through any offline device; the broadcast data can be cascaded and propagated through the communication connection relationship between each offline terminal until it is delivered to the designated offline device.

[0112] Implementing the embodiments of the present invention has the following effects:

[0113] The present invention utilizes multiple offline devices to form a distributed interactive communication system. When an offline device initiates a broadcast task, it can be combined with the main control MCU algorithm task scheduling. Through the distributed interactive communication system, the broadcast task can be sequentially transferred between multiple offline devices by utilizing the principle of mutual communication between multiple offline devices until it reaches the target offline device. At the same time, the present invention adopts LoRa wireless radio frequency technology and utilizes the low bandwidth, low power consumption, long distance and multi-node characteristics of LoRa communication to realize long-distance, wide range and unlimited cascade coverage communication between multiple offline devices without network connection.

[0114] Embodiment 3

[0115] Please refer to Figure 6 , an audio synchronization device for an offline terminal provided in an embodiment of the present invention, is applied to a first offline terminal, the first offline terminal is one of several offline terminals in a communication system; each of the offline terminals in the communication system is respectively connected to communicate with other offline terminals within a preset range;

[0116] The audio synchronization device comprises: a sending module 301 and a time synchronization module 302;

[0117] The sending module is used for sending a response message to the second offline terminal according to the sending path of the broadcast data if the first offline terminal receives the broadcast data sent by any second offline terminal in the communication system, so that after receiving the responses from all target offline terminals, the second offline terminal sends a synchronization message to each target offline terminal according to the communication connection relationship between the second offline terminal and each target offline terminal, and the synchronization message includes a first timestamp of the execution time of each target offline terminal; the target offline terminal is obtained by the second offline terminal according to the received broadcast task;

[0118] The time synchronization module is used to calculate the time difference between the received first timestamp and the local second timestamp if the first offline terminal receives the synchronization message sent by the second offline terminal, and determine the respective task execution time according to the time difference, wherein the first timestamp is obtained by the UTC time acquired by the GPS module of the second offline terminal and sent by the second offline terminal; the second timestamp is obtained according to the local time of the local clock of the first offline terminal, specifically:

[0119] The GPS second pulse signal and the local clock pulse signal are input into the synchronization module, so that the MCU module of the first offline terminal adjusts the local clock signal according to the output signal of the synchronization module, so that the output frequency and phase of the local clock are the same as those of the GPS second pulse clock; according to the task execution time and the broadcast data, the corresponding broadcast task is executed.

[0120] The above-mentioned audio synchronization device for offline terminals can implement the audio synchronization method for offline terminals in the above-mentioned method embodiment. The options in the above-mentioned method embodiment are also applicable to this embodiment and will not be described in detail here. The rest of the contents of the embodiment of the present application can refer to the contents of the above-mentioned method embodiment and will not be described in detail in this embodiment.

[0121] Embodiment 4

[0122] Please refer to Figure 7 , a communication device for an offline terminal provided in an embodiment of the present invention, applied to a second offline terminal; the second offline terminal is one of several offline terminals of a communication system; each of the offline terminals in the communication system is respectively connected to communicate with other offline terminals within a preset range;

[0123] The communication device comprises: a broadcast data sending module 401 and a synchronization message sending module 402;

[0124] The broadcast data sending module is used to obtain target offline terminal information when the second offline terminal receives the broadcast task; the target offline terminal is one or more offline terminals in the communication system; if the communication connection relationship between the second offline terminal and all the target offline terminals is recorded in the first list record of the second offline terminal, then according to the communication connection relationship, broadcast data is sent to each of the target offline terminals through a preset broadcast channel, so that each of the target offline terminals sends a response message to the second offline terminal after receiving the broadcast data;

[0125] The synchronization message sending module is used to send synchronization messages to each target offline terminal according to the communication connection relationship after receiving responses from all the target offline terminals. The synchronization message includes a first timestamp of the execution time of each target offline terminal, so that when all the target offline terminals receive the broadcast data, they can use the audio synchronization method of the offline terminal in any one of the first embodiments to perform time synchronization, determine their respective task execution times, and execute corresponding broadcast tasks according to the task execution time and the broadcast data.

[0126] The communication device of the offline terminal can implement the communication method of the offline terminal of the method embodiment. The options in the method embodiment are also applicable to this embodiment and will not be described in detail here. The rest of the contents of the embodiment of the present application can refer to the contents of the method embodiment, and will not be repeated in this embodiment.

[0127] Embodiment 5

[0128] Correspondingly, the present invention also provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute an audio synchronization method for an offline terminal or a communication method for an offline terminal as described in any one of the above embodiments.

[0129] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program in the terminal device.

[0130] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.

[0131] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal device, and uses various interfaces and lines to connect various parts of the entire terminal device.

[0132] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the terminal device by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created according to the use of the mobile terminal, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0133] Wherein, if the module / unit integrated in the terminal device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0134] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.

Claims

1. An audio synchronization method for an offline terminal, characterized in that: Applied to a first offline terminal, the first offline terminal is one of several offline terminals in a communication system; each offline terminal in the communication system is respectively connected to other offline terminals within a preset range for communication; each offline terminal has a built-in GPS module for realizing accurate timing of the device and obtaining GPS second pulse signals; The audio synchronization method comprises: If the first offline terminal receives broadcast data sent by any second offline terminal in the communication system, a response message is sent to the second offline terminal according to the transmission path of the broadcast data, so that after receiving the responses from all target offline terminals, the second offline terminal sends synchronization messages to each target offline terminal according to the communication connection relationship between the second offline terminal and each target offline terminal, and the synchronization message includes a first timestamp of the execution time of each target offline terminal; the target offline terminal is obtained by the second offline terminal according to the received broadcast task; the target offline terminal includes at least the first offline terminal; If the first offline terminal receives the synchronization message sent by the second offline terminal, it calculates the time difference between the received first timestamp and the local second timestamp, and determines the respective task execution time according to the time difference, wherein the first timestamp is obtained by the UTC time acquired by the GPS module of the second offline terminal and sent by the second offline terminal; the second timestamp is obtained according to the local time of the local clock of the first offline terminal; Inputting the GPS second pulse signal and the local clock pulse signal into the synchronization module, so that the MCU module of the first offline terminal adjusts the local clock signal according to the output signal of the synchronization module, so that the output frequency and phase of the local clock are the same as those of the GPS second pulse clock; Execute a corresponding broadcast task according to the task execution time and the broadcast data.

2. The audio synchronization method of an offline terminal as claimed in claim 1, characterized in that: The GPS second pulse signal and the local clock pulse signal are input into the synchronization module, so that the MCU module of the first offline terminal adjusts the local clock signal according to the output signal of the synchronization module, so that the output frequency and phase of the local clock are the same as those of the GPS second pulse clock, specifically: The synchronization module includes: a phase comparator, a low-pass filter and a voltage-controlled oscillator; The GPS second pulse signal and the local clock pulse signal are input into the phase comparator to obtain the frequency error and phase error between the GPS second pulse signal and the local clock pulse signal, and generate an error signal; the error signal is input into the low-pass filter to convert the error signal into a DC pulse voltage; the DC pulse voltage is input into the voltage-controlled oscillator so that the voltage-controlled oscillator generates output frequency data according to the DC pulse voltage, so that the MCU module adjusts the local clock signal according to the output frequency data, so that the output frequency and phase of the local clock are the same as those of the GPS second pulse clock.

3. The audio synchronization method of an offline terminal as claimed in claim 2, characterized in that: The GPS second pulse signal and the local clock pulse signal are input into the phase comparator to obtain the frequency error and phase error between the GPS second pulse and the local clock pulse, and generate an error signal, specifically: An analog multiplier is used as a phase comparator, the first voltage of the input GPS second pulse signal and the second voltage of the voltage-controlled oscillator output signal are input into the analog multiplier, and the product of the GPS second pulse signal, the local clock pulse signal and the multiplication gain is output as an error signal; the second voltage is output by the voltage-controlled oscillator according to the acquired local clock pulse signal.

4. The audio synchronization method of an offline terminal as claimed in claim 2, characterized in that: The step of inputting the error signal into the low-pass filter and converting the error signal into a DC pulse voltage is specifically as follows: The error signal is input into the low-pass filter, the sum frequency component in the error signal is filtered out, the difference frequency component in the error signal is obtained, and the difference frequency component is used as a DC pulse voltage.

5. The audio synchronization method of an offline terminal as claimed in claim 2, characterized in that: The DC pulse voltage is input into the voltage-controlled oscillator so that the voltage-controlled oscillator generates output frequency data according to the DC pulse voltage, and the MCU module adjusts the local clock signal according to the output frequency data so that the output frequency and phase of the local clock are the same as the GPS second pulse clock, specifically: The DC pulse voltage is used as the input signal of the voltage-controlled oscillator; the instantaneous phase difference is calculated according to the instantaneous oscillation angular frequency of the input signal, the oscillation angular frequency when the input signal is zero or a DC voltage, the instantaneous phase of the input signal and the instantaneous phase of the output signal; Differentiating the instantaneous phase difference to obtain frequency difference information; when the frequency difference information is not equal to zero, obtaining the output voltage of the phase comparator, inputting the output voltage into a low-pass filter to filter the sum frequency component in the output voltage, and obtaining the remaining difference frequency component; The difference frequency component is used as an input control voltage of a voltage-controlled oscillator to adjust the output frequency of the voltage-controlled oscillator until the frequency difference information is equal to zero.

6. A communication method for an offline terminal, characterized in that: Applied to a second offline terminal; the second offline terminal is one of several offline terminals of the communication system; each of the offline terminals in the communication system is respectively connected to communicate with other offline terminals within a preset range; The communication method comprises: When the second offline terminal receives the broadcast task, it obtains target offline terminal information; the target offline terminal is one or more offline terminals in the communication system; if the communication connection relationship between the second offline terminal and all the target offline terminals is recorded in the first list record of the second offline terminal, then according to the communication connection relationship, broadcast data is sent to each of the target offline terminals through a preset broadcast channel, so that each of the target offline terminals sends a response message to the second offline terminal after receiving the broadcast data; After receiving responses from all the target offline terminals, a synchronization message is sent to each of the target offline terminals according to the communication connection relationship, and the synchronization message includes a first timestamp of the execution time of each target offline terminal, so that when all the target offline terminals receive the broadcast data, the audio synchronization method of the offline terminal as claimed in any one of claims 1 to 5 is used for time synchronization to determine the respective task execution time, and the corresponding broadcast task is executed according to the task execution time and the broadcast data.

7. A communication method for an offline terminal as claimed in claim 6, characterized in that: Also includes: If the first list record does not record the communication connection relationship between the second offline terminal and any of the target offline terminals, the target offline terminal with unknown communication connection relationship is used as the query target; By sending an inquiry broadcast, the communication connection relationship with the query target is determined, specifically: Sending an inquiry broadcast to the sending target of the second offline terminal, the sending target of the second offline terminal is a third offline terminal that is communicatively connected to the second offline terminal, so that each of the third offline terminals queries its own second list record; if the second list record does not record the query target, sending an inquiry broadcast to the sending target of the third offline terminal, until any fourth offline terminal responds to the received inquiry broadcast, and the offline terminal that receives the response responds to its own inquiry broadcast; the reply operation is triggered when the fourth offline terminal queries the query target in the list record, or when the fourth offline terminal is the query target; the sending target of any offline terminal is the offline terminal that is communicatively connected to it; According to the reply received by the second offline terminal, a communication connection relationship with the query target is determined.

8. A communication method for an offline terminal as claimed in claim 7, characterized in that: The method of sending broadcast data to each of the target offline terminals through a preset broadcast channel according to the communication connection relationship, so that each of the target offline terminals sends a response message to the second offline terminal after receiving the broadcast data, is specifically: The MCU module is used to transmit the broadcast data to the LoRa radio frequency module through the SPI interface, so that the LoRa radio frequency module modulates the broadcast data to generate task data, and sends the task data to the corresponding third offline terminal through a preset broadcast channel, so that the corresponding third offline terminal receives and demodulates the task data, or sends the task data to the next offline terminal according to the communication connection relationship, until the target offline terminal receives the task data; The preset broadcast channel is selected according to the target offline terminal, and the preset broadcast channel is the number of the target offline terminal, or the number corresponding to the whole network broadcast.

9. A communication method for an offline terminal as claimed in claim 8, characterized in that: Also includes: If the corresponding third offline terminal is the target offline terminal, receiving and demodulating the task data; If the corresponding third offline terminal is not the target offline terminal, the task data is sent to the next offline terminal according to the communication connection relationship until the target offline terminal receives the task data.

Citation Information

Patent Citations

  • Audio synchronization communication method and system and electronic equipment

    CN114499587A

  • Synchronous broadcasting system, and transmitting device

    JP2017092901A