Bluetooth communication synchronization control method and intelligent lamp
By receiving multiple frames of data at the receiver in a Bluetooth Mesh network and calculating the actual time difference between the frames, the latency problem of synchronous control of smart lights in Bluetooth Mesh technology is solved, thereby improving the synchronous control of multiple smart lights and data processing efficiency.
Patent Information
- Application Number
- CN202211362663.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-02
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2042-11-02
AI Technical Summary
Existing Bluetooth Mesh technology fails to provide a solution for delayed command execution in the synchronous control of smart lighting fixtures, resulting in delayed actions of some lighting fixtures and making it impossible to achieve synchronous control of multiple smart lighting fixtures.
By receiving multiple frames of data during the instruction delay execution period, the difference between the actual interval time of two adjacent frames and the target interval time is calculated to determine the actual delay time for executing the first frame of data, so as to ensure that multiple Bluetooth devices operate synchronously.
It enables synchronized control of multiple Bluetooth devices, reduces data processing latency, improves data processing efficiency, and ensures the synchronization of lighting adjustments.
Smart Images

Figure CN115942286B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of control of intelligent lamps, in particular, a Bluetooth communication synchronous control method and an intelligent lamp implementing the method. BACKGROUND
[0002] In recent years, the application of intelligent lamps is more and more extensive. The intelligent lamps usually have a wireless communication chip, and the user can remotely control the intelligent lamps through a smart terminal device, such as controlling the luminous brightness and color temperature of the intelligent lamps. Generally, the intelligent lamps are provided with a WiFi module or a Bluetooth module and other wireless communication modules.
[0003] The Bluetooth communication technology is a very common wireless communication technology. The traditional Bluetooth communication technology can only realize point-to-point communication, for example, after a Bluetooth device is connected to another Bluetooth device, it cannot communicate with other Bluetooth devices. The advantage of this communication mode is that the data transmission is highly secure and private, but the disadvantage is also very obvious. Since it cannot realize the interconnection communication between multiple Bluetooth devices, it cannot realize the grid communication.
[0004] Since the number of intelligent lamps set in the office and home environment is large, if the intelligent lamps use the traditional Bluetooth communication mode, one smartphone can usually only control one intelligent lamp, and cannot control multiple intelligent lamps, which limits the use of intelligent lamps. In order to control multiple intelligent lamps, some existing intelligent lamps use the Bluetooth Mesh technology communication mode.
[0005] The Bluetooth Mesh technology not only solves the problem of network control, but also realizes long-distance control. In the field of light control, without a dedicated gateway, only a Bluetooth-enabled smartphone is needed, and the control distance does not need to be considered, so that the remote control of intelligent lamps can be realized. The Bluetooth Mesh technology is a Bluetooth communication technology with relay function. The Bluetooth Mesh technology uses a broadcast mode for communication. When the Bluetooth Mesh technology is applied to the control of intelligent lamps, each intelligent lamp is usually set as a node in the Bluetooth Mesh network. Each node can receive signals sent by other nodes and can send signals to other nodes, so each node will transmit data in a broadcast manner.
[0006] If the number of intelligent lamps in the Bluetooth Mesh network is large, that is, the number of nodes is large, the communication will be under pressure. Usually, the nodes need to be processed by the relay mode, and some nodes may need to be retransmitted to receive the expected data, that is, some nodes need to repeatedly send the same data. When the light needs to be controlled synchronously, some intelligent lamps may have a delay action and other situations.
[0007] In order to ensure that all the smart lamps needing synchronization are synchronized in light control, the smart lamps receiving the data usually need to delay for a certain time before executing the corresponding instructions, so as to ensure that the multiple smart lamps are synchronized to adjust the light. However, the current Bluetooth Mesh technology does not provide a solution for delayed execution of instructions, and cannot meet the requirements of synchronized control of smart lamps. SUMMARY
[0008] The first object of the present application is to provide a Bluetooth communication synchronization control method capable of realizing synchronized control of multiple Bluetooth devices.
[0009] The second object of the present application is to provide a smart lamp applying the above method.
[0010] To achieve the first object of the present application, the Bluetooth communication synchronization control method provided by the present application comprises receiving multiple frames of data sent by a sending end at intervals within an instruction delay execution time period, the target interval time of adjacent two frames of data being less than the instruction delay execution time, and the target interval time of any adjacent two frames of data being equal; wherein the actual interval time of the adjacent two frames of data received is calculated, the difference between the actual interval time and the target interval time is compared, and the actual delay time for executing the first frame of data is determined according to the difference; after the actual delay time is reached, the instructions corresponding to the multiple frames of data are executed in sequence according to the target interval time starting from the first frame of data.
[0011] As can be seen from the above scheme, the receiving end does not execute the instructions corresponding to the data sent by the sending end immediately after receiving the data, but executes the instructions after a predetermined delay time. In addition, within the instruction delay execution time period, the sending end sends multiple frames of data, and the receiving end can judge the current communication state, such as whether the received data is subject to delay, by comparing the actual interval time of adjacent two frames of data, and calculates the actual delay time for executing the first frame of data according to the delay condition of the currently received data. In this way, the multiple Bluetooth devices can execute the instructions corresponding to the first frame of data at the preset time, realizing the synchronized action requirement of the multiple Bluetooth devices.
[0012] A preferred scheme is that, in any adjacent three frames of data, the actual interval time between every two adjacent frames of data is equal to the target interval time, and after receiving the last frame of data of the adjacent three frames of data, the target interval time corresponding to the remaining data is taken as the actual delay time.
[0013] Therefore, in any three adjacent frames of data, the actual interval time between every two adjacent frames of data is equal to the target interval time, which indicates that the three frames of data do not have a receiving delay, and it can be inferred that the current data transmission does not have a delay phenomenon, and the target interval time corresponding to the remaining data is directly used as the actual delay time to ensure the synchronous communication of the Bluetooth device.
[0014] Preferably, after receiving the last frame of data of the three adjacent frames of data, the calculation of the actual interval time of subsequent data is stopped.
[0015] Since the current data transmission does not have a delay phenomenon, the calculation of the actual interval time of subsequent data is stopped after receiving the last frame of data of the three adjacent frames of data, which can reduce the subsequent calculation amount and improve the data processing efficiency of the Bluetooth device.
[0016] A further solution is that, if the difference between the first two actual interval times and the target interval time contains positive and negative numbers, and the third actual interval time is equal to the target interval time, the actual delay time is calculated according to the difference between the first two actual interval times and the target interval time.
[0017] Since the difference between the first two actual interval times and the target interval time contains positive and negative numbers, it indicates that the transmission of at least one frame of data has a delay phenomenon, but the third actual interval time is equal to the target interval time, which indicates that the transmission of the fourth frame of data has returned to normal, and the actual delay time can be calculated according to the difference between the first two actual interval times and the target interval time, thereby ensuring that the execution time of the first frame of data is not affected.
[0018] A further solution is that, according to the difference between the first two actual interval times and the target interval time, the actual delay time is calculated by calculating the vector sum average of the difference between the first two actual interval times and the target interval time, and using the difference between the target interval time corresponding to the remaining data and the vector sum average as the actual delay time.
[0019] Therefore, by calculating the vector sum average of the difference between the first two actual interval times and the target interval time, the transmission delay of the previous multiple frames of data is comprehensively calculated and processed, and the actual delay time is calculated in combination with the target interval time corresponding to the remaining data, which can accurately calculate the actual execution time of the first frame of data and ensure the synchronous communication of the Bluetooth device.
[0020] Further, if the difference between the first and second actual interval time and the target interval time is positive or negative, and the third actual interval time is equal to the target interval time, the average difference between the first and second actual interval time and the target interval time is calculated, and the difference between the target interval time corresponding to the remaining data and the average difference is used as the actual delay time.
[0021] When the difference between the first and second actual interval time and the target interval time is positive or negative, it indicates that the previous multiple frames of data are all delayed, but the subsequent frame of data restores the normal communication timing, and the actual delay time can be calculated according to the delay of the previous multiple frames of data.
[0022] Further, if the difference between the first and second actual interval time and the target interval time is positive or negative, and the third actual interval time is equal to the target interval time, the average difference between the first and second actual interval time and the target interval time is calculated, and the difference between the target interval time corresponding to the remaining data and the average difference is used as the actual delay time.
[0023] It can be seen that the difference between the first and second actual interval time and the target interval time is positive or negative, and the third actual interval time is equal to the target interval time, which indicates that the continuous multiple frames of data are all delayed, and the actual delay time can be calculated only by considering the delay of the first actual interval time.
[0024] Further, if the first frame of data is not received, the actual interval time of the adjacent two frames of data is calculated starting from the second frame of data, and the actual delay time is calculated.
[0025] Therefore, in the case of missing the first frame of data, the actual interval time of the adjacent two frames of data is calculated starting from the second frame of data, and the actual delay time can be accurately calculated by ignoring the first frame of data.
[0026] Further, if the middle frame of data is not received, the actual receiving time of the two frames of data before and after the missing middle frame of data is divided by two as the actual interval time, and the actual delay time is calculated.
[0027] It can be seen that if the missing frame occurs after the second frame, the missing middle frame of data needs to be considered when calculating the actual interval time of multiple frames of data to avoid errors in the calculation of the actual interval time affecting the calculation of the actual delay time.
[0028] To achieve the second object, the intelligent lamp provided by the application comprises a light emitting device, a Bluetooth module and a controller, the controller is provided with a processor and a memory, the memory stores a computer program, and the processor realizes the Bluetooth communication synchronization control method when executing the computer program. Attached Figure Description
[0029] Figure 1 It is a timing diagram of multiple frames of data sent by the sending end.
[0030] Figure 2 This is a flowchart of an embodiment of the Bluetooth communication synchronization control method of the present invention.
[0031] Figure 3 This is a timing diagram of multiple frames of data received by the receiver under various conditions in an embodiment of the Bluetooth communication synchronization control method of the present invention.
[0032] The present invention will be further described below with reference to the accompanying drawings and embodiments. Detailed Implementation
[0033] The intelligent lighting fixture of this invention is an LED lighting fixture with an LED chip. The intelligent lighting fixture includes a Bluetooth module, enabling communication with other Bluetooth devices. For example, the intelligent lighting fixture can communicate with other intelligent lighting fixtures with Bluetooth modules, or with a smartphone. Preferably, the intelligent lighting fixture uses Mesh technology for data transmission, and the intelligent lighting fixture achieves synchronous control between multiple intelligent lighting fixtures through the Bluetooth communication synchronization control method of this invention.
[0034] Example of Bluetooth communication synchronization control method:
[0035] This embodiment is applied to smart lighting fixtures. Of course, in practical applications, this embodiment can also be applied to other scenarios that use Bluetooth Mesh technology for wireless communication, such as in electronic devices such as smartphones and tablets.
[0036] In Bluetooth Mesh communication, one smart light fixture can send data to another. The sending smart light fixture acts as the data transmitter, and the receiving smart light fixture acts as the data receiver. After receiving the data, the receiver does not immediately execute the corresponding command; instead, it executes the command after a delay. In this way, the transmitter broadcasts data to multiple smart light fixtures, allowing multiple Bluetooth devices to receive the data simultaneously and execute the commands synchronously after the same delay, thus achieving synchronized operation and control of multiple smart light fixtures and Bluetooth devices.
[0037] Since the data received by the receiving end can have a delay, the embodiment sets a synchronization control method for the sending end and the receiving end. Specifically, the sending end sends multiple frames of data to the receiving end at a preset time interval within a preset time period, the preset time period is the instruction delay execution time period, and the preset time interval is the target interval time. In theory, the interval time of the adjacent two frames of data received by the receiving end should also be the target interval time. If a delay occurs during data transmission, the actual interval time of the adjacent two frames of data received by the receiving end is not equal to the target interval time. By calculating the difference between the actual interval time and the target interval time, the data transmission delay between the receiving end and the sending end can be calculated, and the actual delay time of the execution of the first frame of data can be calculated.
[0038] For example, the sending end and the receiving end agree that after the sending end sends a frame of data to the receiving end, the receiving end executes the instruction corresponding to the data after the instruction delay execution time, for example, the instruction delay execution time is T. In order to enable the receiving end to accurately calculate the delay of data transmission, the sending end sends multiple frames of data at a target interval time within the instruction delay execution time period, for example, the sending end sends multiple frames of data within the instruction delay execution time T, and the sending time of the adjacent two frames of data is the target interval time, so the target interval time is T / 5.
[0039] Referring to Figure 1 After the sending end sends the first frame of data D0, the second frame of data D1 is sent after the target interval time T / 5, and the third frame of data D2 is sent after the target interval time T / 5, and so on. Preferably, each frame of data sent by the sending end includes the serial number of the data, for example, D0, D1, etc. After the receiving end receives a frame of data, the serial number of the frame of data can be obtained, so as to determine the sending order of each frame of data. In addition, the receiving end is provided with a local timer, and the local timer is used to calculate the actual interval time of the reception of the adjacent two frames of data. If there is no delay in the data transmission between the sending end and the receiving end, the actual interval time is equal to the target interval time. If the target interval time is not equal to the actual interval time, it indicates that there is a delay between the sending end and the receiving end. Preferably, the instruction delay execution time T and the target interval time can be preset, that is, the sending end and the receiving end agree on the instruction delay execution time T and the target interval time in advance. If there is no delay in the receiving of each frame of data by the receiving end, the actual delay time of the actual execution of the first frame of data can be obtained by adding the first frame data receiving time to the instruction delay execution time T. However, since the receiving end cannot determine whether the first frame of data has a delay, the actual delay time needs to be calculated by the method of the embodiment.
[0040] Referring to Figure 2The embodiment first performs step S1, the sending end sends multiple frames of data to the receiving end, and the receiving end receives the multiple frames of data. Then, step S2 is performed, the receiving end calculates the actual interval time between the adjacent two frames of data received. Since each frame of data received by the receiving end includes a serial number, the receiving end can determine the order of the currently received data according to the serial number, and thus calculate which frame of data is the last frame of data of the currently received data. The receiving end calculates the actual interval time between the adjacent two frames of data by a local timer.
[0041] Then, step S3 is performed, the difference between the actual interval time of the adjacent two frames of data and the target interval time is determined, that is, the difference between the actual interval time and the target interval time is calculated. Specifically, the actual interval time is subtracted from the target interval time, if the actual interval time is equal to the target interval time, the difference is 0, if the actual interval time is greater than the target interval time, the difference is a positive number, if the actual interval time is less than the target interval time, the difference is a negative number. If the difference is positive, it means that among the adjacent two frames of data, the previous frame of data is normally delivered, and the transmission of the next frame of data is delayed, resulting in that the actual interval time difference of the adjacent two frames of data exceeds the target interval time. If the difference is negative, it means that among the adjacent two frames of data, the transmission of the previous frame of data is delayed, and the next frame of data is normally delivered, resulting in that the actual interval time difference of the adjacent two frames of data is less than the target interval time. The embodiment determines whether the transmission of the multiple frames of data is delayed according to the case of the difference, and thus determines the actual delay time of the first frame of data, that is, step S4 is performed.
[0042] The following will be described in combination with Figure 3 introduce methods for determining the actual delay time of the first frame of data in various cases. For example Figure 3 (a) shows that the first actual interval time between data D0 and data D1 is T / 5, and the second actual interval time between data D1 and data D2 is T / 5, that is, the actual interval time between any adjacent two frames of data in the previous three frames of data is equal to the target interval time, which can be considered as a case that there is no delay in the data transmission between the sending end and the receiving end, and then the instruction corresponding to the first frame of data is executed after data D2 after 3T / 5 time.
[0043] And in Figure 3(a) As shown in FIG. 2 (a), after receiving the data D2, the actual interval time of the subsequently received data does not need to be calculated, thereby reducing the calculation amount of the receiving end. The receiving end can provide the operation resource to other programs, thereby improving the efficiency of the receiving end in processing other matters. Since the target interval time corresponding to the remaining three frames of data is T / 5, the sum of the target interval time corresponding to the three frames of data is 3T / 5, therefore, after receiving the data D2, the target interval time corresponding to the remaining three frames of data is taken as the actual delay time of executing the instruction corresponding to the first frame of data.
[0044] As shown in FIG. 2 (b), the first actual interval time between the data D0 and the data D1 is T / 5-x%, that is, the transmission of the data D0 exists a delay, the second actual interval time between the subsequent data D1 and the data D2 is T / 5, and the third actual interval time between the data D2 and the data D3 is also T / 5, that is, among the continuous three frames of data from the data D1 to the data D3, the actual interval time between any two adjacent frames of data is equal to the target interval time, which can be considered as the case that the data transmission between the sending end and the receiving end does not exist a delay after the data D1, and then the instruction corresponding to the first frame of data is executed after the data D3 through the time of 2T / 5. Figure 3 (b) As shown in FIG. 2 (b), the first actual interval time between the data D0 and the data D1 is T / 5-x%, that is, the transmission of the data D0 exists a delay, the second actual interval time between the subsequent data D1 and the data D2 is T / 5, and the third actual interval time between the data D2 and the data D3 is also T / 5, that is, among the continuous three frames of data from the data D1 to the data D3, the actual interval time between any two adjacent frames of data is equal to the target interval time, which can be considered as the case that the data transmission between the sending end and the receiving end does not exist a delay after the data D1, and then the instruction corresponding to the first frame of data is executed after the data D3 through the time of 2T / 5.
[0045] It should be noted that, Figure 3 x in the formula represents the time error of the receiving, which dynamically changes according to the communication condition of the network node. +x% means that the previous frame of data is normally sent, and the receiving of the subsequent frame of data exists a delay, which causes the actual interval time between the two adjacent frames of data to be greater than the target interval time; -x% means that the transmission of the previous frame of data exists a delay, and the subsequent frame of data is normally received, which causes the actual interval time between the two adjacent frames of data to be less than the target interval time.
[0046] In the case of Figure 3 (b) As shown in FIG. 2 (b), the first actual interval time between the data D0 and the data D1 is T / 5-x%, that is, the transmission of the data D0 exists a delay, the second actual interval time between the subsequent data D1 and the data D2 is T / 5, and the third actual interval time between the data D2 and the data D3 is also T / 5, that is, among the continuous three frames of data from the data D1 to the data D3, the actual interval time between any two adjacent frames of data is equal to the target interval time, which can be considered as the case that the data transmission between the sending end and the receiving end does not exist a delay after the data D1, and then the instruction corresponding to the first frame of data is executed after the data D3 through the time of 2T / 5.
[0047] As shown in FIG. 2 (c), the first actual interval time between the data D0 and the data D1 is T / 5-x%, that is, the transmission of the data D0 exists a delay, the second actual interval time between the subsequent data D1 and the data D2 is T / 5, and the third actual interval time between the data D2 and the data D3 is also T / 5, that is, among the continuous three frames of data from the data D1 to the data D3, the actual interval time between any two adjacent frames of data is equal to the target interval time, which can be considered as the case that the data transmission between the sending end and the receiving end does not exist a delay after the data D1, and then the instruction corresponding to the first frame of data is executed after the data D3 through the time of 2T / 5. Figure 3(c) as shown, according to the plurality of actual interval times calculated from the previous multiple frames of data, the first actual interval time is T / 5+x1%, the second actual interval time is T / 5-x2%, and the third actual interval time is T / 5, thus, the difference between the first two actual interval times and the target interval time is positive and negative respectively, and the third actual interval time is equal to the target interval time. In this case, it can be considered that the transmission of data D1 exists delay, which causes the actual interval time between data D1 and data D2 to be shortened, but from data D3, the normal communication has been restored, and there is no delay. Therefore, the actual time of the transmission of data D0 needs to be determined according to the first two actual interval times, and then the actual delay time of the first frame of data is calculated.
[0048] Specifically, the actual delay time is calculated according to the difference between the first two actual interval times and the target interval time. For example, the vector sum average of the difference between the first two actual interval times and the target interval time is calculated, and the result is (x1%-x2%) / 2, which is denoted as xx%, the vector sum average xx% can be positive, negative or 0. Then, the difference between the target interval time corresponding to the remaining data and the vector sum average is used as the actual delay time, since after receiving data D3, the target interval time corresponding to the remaining two frames of data is 2T / 5, thus, the calculated actual delay time is 2T / 5-xx%.
[0049] As Figure 3 (d) as shown, according to the plurality of actual interval times calculated from the previous multiple frames of data, the first two actual interval times are T / 5+x1% and T / 5+x2% respectively, thus, the difference between the first two actual interval times and the target interval time is positive, and the third actual interval time is equal to the target interval time. At this time, it can be considered that the transmission of data D1 and D2 both exist delay, but since the actual interval time between data D2 and D3 is equal to the target interval time, thus, the actual time of the transmission of data D0 needs to be determined according to the first two actual interval times, and then the actual delay time of the first frame of data is calculated.
[0050] Specifically, the average difference between the first two actual interval times and the target interval time is calculated, and the result is (x1%+x2%) / 2, then, the difference between the target interval time corresponding to the remaining data and the average difference is calculated, for example, the target interval time corresponding to the remaining data is 2T / 5, thus, the calculated difference is 2T / 5-(x1%+x2%) / 2, and the difference is the actual delay time of the first frame of data. Preferably, after receiving data D3, the actual interval time between adjacent two frames of data is no longer calculated.
[0051] If the difference between the first actual interval time and the target interval time is negative, and the difference between the second actual interval time and the target interval time is negative, the average difference is -(x1%+x2%) / 2, which is negative, and the actual delay time is 2T / 5+(x1%+x2%) / 2, which is a value greater than 2T / 5.
[0052] As shown in Figure 3 (e), according to the fact that the first actual interval time and the second actual interval time are not equal to the target interval time, which indicates that the data received by the receiving end has multiple delay times, the first actual interval time is directly used to calculate the actual delay time. Specifically, the difference between the first actual interval time and the target delay time is calculated, for example, the difference is -x1%, and the actual interval time between adjacent frames of data starting from data D3 is no longer calculated, and the target interval time corresponding to the remaining data starting from data D3, i.e., 2T / 5, is calculated. The actual delay time is obtained by subtracting the difference between the first actual interval time and the target delay time from the target interval time corresponding to the remaining data. Since the difference between the first actual interval time and the target delay time is -x1%, the actual delay time is 2T / 5+x1%. Preferably, after receiving data D3, the actual interval time between adjacent frames of data is no longer calculated.
[0053] As shown in Figure 3 (f), data D0 is not received, so the actual interval time between data D0 and data D1 cannot be calculated. This situation is a frame loss, i.e., data D0 is lost. At this time, the first frame of data, i.e., data D0, is ignored, and the actual delay time is calculated using the actual interval time between data D1 and data D2, the actual interval time between data D2 and data D3, and the actual interval time between data D3 and data D4. Specifically, the actual interval time between each pair of adjacent frames of data of multiple frames of data between data D1 and D4 is obtained, and the actual interval time between each pair of adjacent frames of data is used as the first three actual interval times. According to Figure 3 (a) to Figure 3 (e), the actual delay time is calculated.
[0054] As shown in Figure 3(g) as shown, the receiving end receives data D0, D1, D3, D4, but does not receive data D2, indicating that a frame loss occurs, and the lost data is not the first frame data, but a frame data D2 in the middle. In this case, when calculating the actual interval time between the adjacent two frame data, the case of losing one frame data needs to be considered, that is, using the actual receiving time between the adjacent two frame data of the lost one frame data as the basis to calculate the two actual interval times associated with the lost data D2. Specifically, the actual receiving time between data D1 and data D3 is 2T / 5-x2%, and the result obtained by dividing the actual receiving time by two is T / 5-x2% / 2, which is used as the actual interval time between data D1 and data D2, and also as the actual interval time between data D2 and data D3. In this way, multiple actual interval times between data D0 and data D4 are obtained, and the actual delay time is calculated according to the multiple actual interval times. Figure 3 (a) to Figure 2 (e) several cases.
[0055] Looking back After determining the actual delay time of the instruction corresponding to the first frame data in step S4, step S5 is performed to determine whether the actual delay time is reached. If not, continue to wait, if it has been reached, step S6 is performed to sequentially execute the instructions corresponding to multiple frame data, that is, starting from the first frame data. Since each frame data is sent according to the target interval time, when executing the instructions of each frame data, it is also executed sequentially according to the target interval time.
[0056] As can be seen, by continuously sending multiple frame data in the instruction delay execution time period, the receiving end can calculate the actual delay time actually needed to execute the first frame data according to the actual interval time of the multiple frame data received. In this way, after the sending end sends data to multiple receiving ends in a broadcast manner, multiple receiving ends can calculate their own actual delay time. In this way, the time interval between the sending of the first frame data from the sending end and the start of the execution of the first frame data by each receiving end is equal, so that multiple receiving ends can execute the instructions corresponding to the first frame data synchronously.
[0057] Smart lamp embodiment:
[0058] The embodiment has a shell, the shell is provided with a light emitting device, for example, LED chip, etc., and is also provided with a Bluetooth module and a controller, the controller is provided with a processor and a memory, the memory stores a computer program, and the processor executes the above-mentioned computer program to realize the above-mentioned Bluetooth communication synchronization control method.
[0059] The processor described above can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The processor is the control center of the terminal device, and connects all parts of the terminal device through various interfaces and lines.
[0060] The memory can be used to store computer programs and / or modules, and the processor realizes various functions of the terminal device by running or executing the computer programs and / or modules stored in the memory, and calling 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 by a function, etc.; and the data storage area can store data created according to the use of the mobile phone, 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 media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other volatile solid-state memory devices.
[0061] Finally, it should be emphasized that the present application is not limited to the above-described embodiments, for example, the change of the amount of data sent in the instruction delay execution period, or the change of the set instruction delay execution time length, etc. These changes should also be included in the protection scope of the claims of the present application.
Claims
1.A Bluetooth communication synchronization control method, comprising: receiving multiple frames of data sent by a sending end at intervals within an instruction delay execution time period, a target interval time between two adjacent frames of data being less than the instruction delay execution time, and the target interval time between any two adjacent frames of data being equal; characterized by: calculating actual interval times of two adjacent frames of data received, comparing a difference between the actual interval times and the target interval time, and determining an actual delay time for executing a first frame of data according to the difference; if the difference is positive, it is considered that the former frame of data among the two adjacent frames of data is normally arrived, and the latter frame of data is delayed in transmission; if the difference is negative, it is considered that the former frame of data among the two adjacent frames of data is delayed in transmission, and the latter frame of data is normally arrived; and determining whether delay in transmission of the multiple frames of data occurs according to the difference, and determining the actual delay time for executing the first frame of data according to the difference; after the actual delay time is reached, executing instructions corresponding to the multiple frames of data in sequence according to the target interval time starting from the first frame of data; if the differences between the first two actual interval times and the target interval time contain positive and negative numbers, and the third actual interval time is equal to the target interval time, the actual delay time is calculated according to the differences between the first two actual interval times and the target interval time. In the method, the actual delay time is calculated according to the differences between the first two actual interval times and the target interval time, which includes calculating a vector sum average of the differences between the first two actual interval times and the target interval time, and using a difference between a target interval time corresponding to remaining data and the vector sum average as the actual delay time. 2.The Bluetooth communication synchronization control method according to claim 1, characterized by: if actual interval times between two adjacent frames of data among any three adjacent frames of data are equal to the target interval time, a target interval time corresponding to remaining data is used as the actual delay time after a last frame of data of the three adjacent frames of data is received. 3.The Bluetooth communication synchronization control method according to claim 2, characterized by: after the last frame of data of the three adjacent frames of data is received, calculation of actual interval times of subsequent data is stopped. 4.The Bluetooth communication synchronization control method according to any one of claims 1 to 3, characterized by: if the differences between the first two actual interval times and the target interval time contain positive and negative numbers, and the third actual interval time is equal to the target interval time, an average difference between the first two actual interval times and the target interval time is calculated, and a difference between a target interval time corresponding to remaining data and the average difference is used as the actual delay time. 5.The Bluetooth communication synchronization control method according to any one of claims 1 to 3, characterized by: If the differences between the first three actual interval times and the target interval time are all positive or all negative, the actual delay time is calculated using the difference between the first actual interval time and the target interval time; the actual delay time is calculated using the target interval time corresponding to the remaining data minus the difference between the first actual interval time and the target interval time. 6.The Bluetooth communication synchronization control method according to any one of claims 1 to 3, characterized in that: If the first frame data is not received, the actual interval time of the adjacent two frame data is calculated starting from the second frame data, and the actual delay time is calculated. 7.The Bluetooth communication synchronization control method according to any one of claims 1 to 3, characterized in that: If the intermediate frame data is not received, the actual interval time is calculated by dividing the actual receiving time of the frame data before and after the missing intermediate frame data by two, and the actual delay time is calculated. 8.An intelligent lamp, comprising a light emitting device, a Bluetooth module and a controller, wherein the controller is provided with a processor and a memory, and the memory stores a computer program, characterized in that: The processor executes the computer program to realize the Bluetooth communication synchronization control method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method for synchronizing control signals, electronic device, and computer storage medium
CN111511013A
Method for synchronous frame transmitting on IP network and network apparatus for transmission
CN1852265A