Synchronization method, synchronization equipment, pattern synchronous display method and display device

By introducing counters and broadcast receiving mechanisms into bicycle taillights, bicycle taillight synchronization under dynamic changes is achieved, solving the problems of synchronization complexity and resource utilization in the prior art, and achieving efficient and simple multi-device synchronization.

CN119865892AActive Publication Date: 2025-04-22泉州艾奇科技有限公司
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510356649.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-25
Publication Date
2025-04-22
Estimated Expiration
2045-03-25

AI Technical Summary

Technical Problem

The prior art is difficult to achieve simple, efficient and resource-consuming dynamic changes synchronization of equipment in bicycle taillight synchronization scenarios, especially when the equipment group is dispersed and dynamically joined/leave.

Method used

By introducing a counter into the device, the count value of its own is broadcast periodically, and the count value of other devices is received during a period when the self-count value is not broadcasted, and the self-count value is compared and updated to achieve synchronization. This method does not require unified host search, but only requires two-way devices to compare, simplifying processing steps and reducing resource usage.

Benefits of technology

It realizes efficient synchronization between multiple bicycle taillights in the dynamic changes of equipment, reducing system complexity and resource utilization, and is suitable for dispersed equipment groups.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119865892A_ABST
    Figure CN119865892A_ABST
Patent Text Reader

Abstract

The invention relates to a distributed equipment communication technology, and discloses a synchronization method, equipment, a pattern synchronous display method and a pattern synchronous display device.The synchronization method comprises the following steps that self count values are periodically broadcasted, the self count values are from counters contained in the equipment, and the count values of the counters are increased at a fixed speed; receiving the count value broadcasted by other equipment in a time period in which the own count value is not broadcasted; when receiving a count value, comparing the count value with the current count value per se, and if the count value is greater than the sum of the current count value per se and a set threshold value, updating the count value of a counter contained in the count value per se by using the received count value, and if the count value is greater than the sum of the current count value per se and the set threshold value, updating the count value of the counter per se; if the count value is smaller than or equal to the sum of the current count value and a set threshold value, the count value is not updated, and the threshold value is zero or positive. The synchronization method is simple, occupies few resources, and can be applied to a scene in which the equipment dynamically changes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to distributed device communication technology, and more particularly to a synchronization method, device, pattern synchronization display method and display device. Background Art

[0002] With the popularity of cycling, night riding safety has become the focus of attention for cycling enthusiasts and manufacturers. As an important equipment to improve the visibility of night riding, the design and function of bicycle taillights are constantly being improved. When a team rides in a team, the taillights of all team members will be adjusted to display a consistent identification mark or the same flashing mode. The characteristics of cycling are that the formation is loose, and bicycles can join and leave at any time; the bicycles may be concentrated in a small area, but a small number of bicycles are far apart. These characteristics bring technical challenges to the synchronization of bicycle taillights.

[0003] The most common synchronization technology among multiple devices currently requires that one or more hosts (i.e., synchronization benchmarks) be determined among multiple devices before synchronizing other devices with these hosts. If the device group is very scattered, and some are even far away, and the communication capability becomes weak (for example, the Bluetooth system message distance is very short, etc.), it is not possible to ensure that each device in this group can receive the signal of all other devices, which makes it easy to make mistakes or fail to find the host when searching for the host. If there is interference in the surrounding environment, it will be even more difficult to receive the signal, resulting in the inability to find the host or the wrong host. Moreover, in the existing synchronization among multiple devices, generally multiple devices have been determined, so the host may be found, but for dynamically added devices, the host cannot be confirmed, that is, the confirmation process cannot be completed. Therefore, the existing synchronization method among multiple devices cannot be applied to the scenario where devices dynamically join or leave.

[0004] In addition, although some synchronization technologies are relatively advanced, they occupy more hardware resources or require the use of more complex and expensive processing equipment, and are not suitable for consumer electronic products such as bicycle taillights.

[0005] Therefore, a new synchronization method is needed to achieve simple, efficient, resource-saving synchronization of bicycle taillights that can be applied to scenarios where equipment changes dynamically. Summary of the invention

[0006] The present application provides a synchronization method, a device, a pattern synchronization display method and a display device. The synchronization method is simple, efficient, and occupies few resources. At the same time, it can be applicable to scenarios where the device changes dynamically.

[0007] In the first aspect, the present application provides a synchronization method, which adopts the following technical solution: A synchronization method, the method comprising the following steps: periodically broadcasting its own count value, wherein the own count value comes from a counter included in the device, and the count value of the counter increases at a fixed speed; receiving count values ​​broadcasted by other devices during a time period when the own count value is not broadcast; each time a count value is received, comparing the count value with the current count value of the device, if the count value is greater than the sum of the current count value of the device plus a set threshold, using the received count value to update the count value of the counter included in the device, if the count value is less than or equal to the sum of the current count value of the device plus a set threshold, not using the received count value to update the count value of the counter included in the device, the threshold being zero or a positive number.

[0008] Furthermore, the method of periodically broadcasting the counter's own count value is: generating a random number, and when the counter's current count value is an integer multiple of the random number, broadcasting the counter's current count value.

[0009] Furthermore, the method of periodically broadcasting its own count value is: setting a predetermined broadcast period and generating a random number that is smaller than the predetermined broadcast period, and when the remainder of the current count value of the counter itself divided by the predetermined broadcast period is equal to the random number, broadcasting the current count value of the counter itself.

[0010] Furthermore, it also includes: when receiving the count value of other devices, obtaining the random number of other devices according to the count value received from other devices; comparing the random number of other devices with its own random number; when the comparison result is the same, the device regenerates a random number different from its current random number, and when the comparison result is different, does not process the random number.

[0011] Furthermore, the time interval for each count value of the counter to increase is less than 10 ms.

[0012] Furthermore, when the device is started, the count value of the included counter is reset to a preset initial value.

[0013] In a second aspect, the present application provides a method for synchronizing multiple devices. The following technical solution is adopted: A method for synchronizing between a plurality of devices, each of the plurality of devices comprising a counter, each counter having a count value, the count value of each respective counter of the plurality of devices increasing at the same fixed rate, the method comprising the following steps: each of the plurality of devices performing the following steps: periodically broadcasting its own count value; During the time period when its own count value is not broadcasted, the count value broadcasted by other devices is received; each time a count value is received, the count value is compared with its own current count value, if the count value is greater than the sum of its own current count value plus a set threshold, the received count value is used to update the count value of the counter contained in itself, if the count value is less than or equal to the sum of its own current count value plus the set threshold, the received count value is not used to update the count value of the counter contained in itself, and the threshold is zero or a positive number.

[0014] Furthermore, the manner of periodically broadcasting its own count value is: each of the multiple devices generates a random number, and when the current count value of the device's counter is an integer multiple of the random number, the current count value of the counter is broadcast.

[0015] Furthermore, the method of periodically broadcasting its own count value is: setting a predetermined broadcast period, and each of the multiple devices generates a random number that is less than the predetermined broadcast period, and when the remainder of the device's current count value divided by the predetermined broadcast period is equal to the random number, the counter's current count value is broadcast, wherein the predetermined broadcast period of each device is the same or different.

[0016] In a third aspect, the present application provides a device that adopts the following technical solution: A device capable of achieving synchronization with other devices, the device comprising: a counter, whose count value increases at a fixed speed; a broadcast module, used to receive the count value output by the counter and periodically broadcast the count value; a receiving module, used to receive the count value broadcasted by the other device during a time period when the count value of the device itself is not broadcast; a processing module, used to compare each of the received count values ​​with the current count value of the device itself, if the count value is greater than the sum of the current count value of the device itself plus a set threshold, then use the received count value to update the count value of the counter contained in the device itself, if the count value is less than or equal to the sum of the current count value of the device itself plus a set threshold, then do not use the received count value to update the count value of the counter contained in the device itself, the threshold being zero or a positive number.

[0017] In a fourth aspect, the present application provides a method for synchronously displaying patterns, which adopts the following technical solution: A method for synchronous display of patterns, executing the aforementioned synchronization method, wherein at least one pattern is stored in the device, each of the at least one pattern corresponds to a count value range, and the at least one pattern includes a pattern to be displayed; the count value of the device itself is used to take the modulus of the count value range corresponding to the pattern to be displayed; when the modulus is a preset value, the first frame of the pattern to be displayed is displayed.

[0018] Furthermore, the preset value is the same as the preset value in the other device.

[0019] In a fifth aspect, the present application provides a pattern synchronization display device, which adopts the following technical solution: A pattern synchronization display device comprises a counter, whose count value increases at a fixed speed, and the count value is the count value of the pattern synchronization display device itself; a broadcast module, used to receive the count value output by the counter, and periodically broadcast the count value; a receiving module, used to receive the count value broadcasted by other pattern synchronization display devices during a time period when the count value of the pattern synchronization display device itself is not broadcast; a processing module, used to compare each of the received count values ​​with the current count value of the pattern synchronization display device itself, and if the count value is greater than the sum of the current count value of the pattern synchronization display device itself plus a set threshold value, then use the received count value to update the count value of the counter contained in the pattern synchronization display device itself; if the count value is less than or equal to the sum of the current count value of the pattern synchronization display device itself plus a set threshold value, then do not use the received count value to update the count value of the counter contained in the pattern synchronization display device itself, and the threshold value is zero or a positive number; a storage module, used to store at least one pattern, each of the at least one pattern corresponds to a count value range, and the at least one pattern includes a pattern to be displayed; a display module, used to use the count value of the pattern synchronization display device itself to take the modulus of the count value range corresponding to the pattern to be displayed, and when the modulus is a preset value, display the first frame of the pattern to be displayed.

[0020] Furthermore, the preset value is the same as the preset value in the other pattern synchronous display device.

[0021] This application has significant technical effects due to the adoption of the above technical solutions: The device periodically broadcasts its own count value, and receives the count values ​​broadcast by other devices during the time period when it does not broadcast its own count value. Each time the device receives a count value (the count value broadcast by other devices), it compares the received count value with its current count value. If the received count value is greater than the current count value of the device or greater than the current count value of the device by a set threshold, the device's own count value is updated to the received count value, and the two devices are synchronized. The device repeats the above steps, and finally the group of devices can complete the synchronization of the count values. Compared with the existing method that requires a unified comparison of all received data to find the host, this application only needs to compare the count values ​​of each pair (each received count value with the current count value of the device itself), and the processing steps are simpler and fewer resources are occupied.

[0022] In this application, among a group of devices (greater than or equal to three devices), any first device can obtain the count value broadcast by the second device, and can indirectly obtain the count value broadcast by the third device through the second device (provided that the second device can obtain the count value broadcast by the third device), thereby achieving synchronization between the first device and the second device and the third device. Similarly, the first device can also indirectly obtain the count value broadcast by the fourth device through other devices, and so on. In other words, any device can directly or indirectly obtain the count value of the device group through other devices, and finally achieve synchronization of multiple devices. Even for a relatively dispersed group of devices, as long as the above conditions are met, synchronization of multiple devices can be achieved. Among them, the first device, the second device, the third device, the fourth device, etc. are descriptions set to indicate that the devices are not the same, and are not limited to four devices.

[0023] Of course, the synchronization method of the present application is also applicable to the case where there are only two devices.

[0024] At the same time, no matter which device joins at any time, it can also receive the count value of other devices, and finally achieve synchronization with other devices. For devices that leave, other devices just cannot receive their count values, which will not affect synchronization with other devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 A simplified diagram of the communication status of multiple dispersed devices according to an embodiment of the present application; Figure 2 A flowchart of a synchronization method according to an embodiment of the present application; Figure 3 A flowchart of a synchronization method according to another embodiment of the present application; Figure 4 A flowchart of synchronizing multiple devices according to an embodiment of the present application; Figure 5 It is a schematic diagram of the communication status of the dispersed devices AD in the embodiment of the present invention; Figure 6 A module diagram of a device capable of achieving synchronization with other devices according to an embodiment of the present invention; Figure 7 It is a module diagram of a pattern synchronization display device according to an embodiment of the present invention; Figure 8 This is a flowchart of a specific application scenario embodiment of the present invention; Fig. 9 A timing diagram of working mode M and working mode N of a device according to an embodiment of the present invention; Fig.10 1 is a timing diagram of working mode M and working mode N of multiple devices (devices ae) according to an embodiment of the present invention.

[0026] The names of the parts indicated by the digital labels in the accompanying drawings are as follows: A'—communication range of device A, B'—communication range of device B, C'—communication range of device C, D'—communication range of device D, X—road, H—counter, I—broadcast module, J—receiving module, K—processing module, and L—display module. DETAILED DESCRIPTION

[0027] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0028] It should be noted that the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined. Example

[0029] To achieve synchronization of a dispersed group of devices, it is generally required that each device in the group be arranged within a certain distance range, that is, this distance range is such that the two devices farthest apart in the group can also receive data from each other, to ensure that all devices can communicate with each other, that is, any device must be able to receive data sent by any other device, and then process all received data (data sent by all devices) to find one or more hosts among all devices, and then synchronize other devices with these hosts.

[0030] However, such existing methods cannot be applied to scenarios where the device groups are very dispersed, for example, they cannot be applied to scenarios where some devices are arranged beyond the aforementioned distance range. This is because the communication capability between at least two devices in such a device group that are beyond the aforementioned distance range becomes weak, which will result in the inability to receive data sent to each other, that is, some devices may not be able to receive data sent by other devices, and the data they send cannot be received by other devices, resulting in the inability to find the host by processing all the data. At the same time, it is also not applicable to scenarios where devices dynamically join or leave, because the aforementioned synchronization method is generally set to complete synchronization within a certain period of time, and it is necessary to verify whether all devices are synchronized within a certain period of time. For scenarios where some devices change at any time, the synchronization time will increase infinitely, the synchronization difficulty will increase, and the system cannot preset the synchronization time.

[0031] Based on this, in an embodiment provided by the present application, in a method for synchronizing between multiple uncertain devices (the number of devices is greater than three), any first device does not need to receive count values ​​broadcast by all other devices. Specifically, the any first device can send and receive count values ​​with at least one second device, and the second device can send and receive count values ​​with at least one third device, and the third device can also send and receive count values ​​with at least one fourth device, and so on.

[0032] This means that the first device can send and receive count values ​​to the third device indirectly through the second device, and can also send and receive count values ​​to the fourth device indirectly through the third device, and so on. In short, any device can send and receive count values ​​to a group of devices directly or indirectly through other devices. The sending and receiving mode of count values ​​between multiple devices is similar to a tree-like spread, and will not form a closed-loop communication between several or several devices, and ultimately can achieve synchronization of multiple device groups.

[0033] It should be noted that the aforementioned first device, second device, third device, fourth device, etc. are descriptions set to indicate that the devices are not the same, and are not limited to four devices.

[0034] Specifically, see, for example, Figure 1 , in a dispersed group of devices ai, device a is close to device b, device c, and device d, and they are all within the communication range of device a, that is, device a can receive the count values ​​broadcast by device b, device c, and device d, but due to the distance, device a cannot receive the count values ​​broadcast by device e, device f, device g, device h, and device i. Similarly, device e is close to device b, device c, device d, device f, device h, and device i, and they are all within the communication range of device e. Device e can receive the count values ​​broadcast by device b, device c, device d, device f, device h, and device i, but due to the distance, device e cannot receive the count values ​​broadcast by device a and device g. However, device a can indirectly obtain the count values ​​broadcast by device e through device b, device c, or device d, and similarly, device e can indirectly obtain the count values ​​broadcast by device a through devices b, device c, or device d, and the same is true for any other device, and finally any device can directly or indirectly obtain the count values ​​broadcast by the device group.

[0035] The following describes the synchronization method of this application in detail. Figure 2 , the method for achieving synchronization includes steps S11 to S13, as described below.

[0036] Step S11: The device periodically broadcasts its own count value, wherein the count value comes from a counter included in the device, and the count value of the counter increases at a fixed speed. The count value increases at a preset fixed speed, for example, by 1 each time. In some embodiments, the time interval for each count value increase of the counter can be set to be less than 10ms, for example, the time interval for each count value increase of the counter is set to be 2ms.

[0037] It should be noted that "periodic broadcasting" does not mean broadcasting strictly at regular intervals, but means that the broadcasting has a certain periodicity, which may be constant or not, as long as the broadcasting is repeated over and over again.

[0038] In order to avoid conflicts caused by simultaneous broadcasting of a device with multiple other devices, a random factor may be introduced into one or both of the broadcast cycle and the timing of broadcasting within each cycle. Considering that the count value of the counter of each device may also be updated in the technical solution of the present application, two feasible methods for determining the time point when a device periodically broadcasts its own count value (also referred to as "a method for periodically broadcasting its own count value") are provided below.

[0039] In the first method, the device generates a random number K, and when the current count value of its counter is K multiplied by a positive integer N, it broadcasts the count value. In other words, the broadcast is triggered when the current count value of the counter is K*N (where N=1, 2, 3, ...). Generally speaking, the device uses the initially generated random number K as the basis, and once the current count value of the counter reaches K*N (N=1, 2, 3, ...), it broadcasts once. For example, if the random number K is generated by the device as 20, the first broadcast trigger condition is that the current count value of the counter reaches 20×1=20, and the second trigger condition is that the current count value of the counter reaches 20×2=40, and so on, and the broadcast will be carried out in an arithmetic progression sequence of 20, 40, 60, and so on.

[0040] However, during operation, the device will receive count values ​​from other devices, which will cause the current count value of the counter to be updated. Due to the existence of this update mechanism, some of the count values ​​that should have appeared according to the K*N rule (N is a positive integer, 1, 2, 3, 4... in sequence) will be skipped. Therefore, when the device broadcasts, it will not strictly broadcast in an arithmetic progression sequence of count values ​​such as N, 2N, 3N, 4N... For example, the random number K is generated by the device as 20. When the current count value of the device's counter increases to 18, it receives a count value of 42 from other devices. At this time, the current count value of the device's counter is immediately updated to 42. Afterwards, when the count value increases to 60, the device will broadcast the count value.

[0041] It should be noted that “current” is only used to emphasize the count value of the counter itself at this moment.

[0042] The second method: set a predetermined broadcast cycle, which usually does not change, but it does not rule out changes over time due to special needs, and generate a random number that is less than the predetermined broadcast cycle. When the remainder of the current count value of the device's counter divided by the predetermined broadcast cycle is equal to the random number, broadcast the current count value of the counter. That is, the broadcast triggering time point of this method is: broadcast when the remainder of the current count value of the counter divided by the predetermined broadcast cycle is equal to the random number. For example, the predetermined broadcast cycle is set to 100, and the random number generated by the device is 21. When the remainder of the current count value of the counter divided by 100 is equal to 21, broadcast. For example, broadcast once when the current count value of the counter is 321, and the next broadcast is when the current count value of the counter is 621.

[0043] Of course, the time point at which the device broadcasts the current count value of the counter can also be determined by other methods, as long as the device can periodically broadcast its own count value. For example, the method for determining the broadcast time point is as follows: based on the growth rate of the counter's count value itself and the new random number generated during each broadcast. The specific process is: when the counter's count value increases by the value of the random number generated during the last broadcast at its own growth rate, the broadcast is triggered, and the device will broadcast the counter's current count value and generate a new random number; the next broadcast time point is when the counter's count value increases by the value of the newly generated random number at its own growth rate. Among them, when the counter is turned on, an initial random number is automatically generated, and the time point of the first broadcast is when the counter's count value increases to a value equal to the initial random number at its own growth rate. For example, when the counter is turned on, it generates a random number of 20. The counter's count value increases by one count value every 2us, that is, the count value increases by 1 every 2us, and each increase in count value is a beat (that is, every 2us is a beat). When the counter's count value increases by 20 according to its own growth rate, that is, the counter has walked 20 beats, the device broadcasts for the first time and generates a new random number 89; the next broadcast time point is when the count value increases by 89 according to its own growth rate, at this time the counter's current count value is broadcast and a new random number 120 is generated; after that, the next broadcast time point is when the count value increases by 120 according to its own growth rate, and the cycle continues. The device will broadcast periodically in this way.

[0044] Step S12: The device receives the count value broadcasted by other devices during the time period when the device does not broadcast its own current count value.

[0045] See also Fig. 9 , which is a timing diagram of working mode M and working mode N of a certain device in one embodiment of the present application, setting the time period when the device broadcasts its current count value as working mode M, and in other time periods when it does not broadcast its current count value, the device receives the count values ​​broadcast by other devices, at which time the device is in working mode N. Adjacent working modes M and working modes N constitute a broadcast cycle. In a broadcast cycle, once the device completes the broadcast of its current count value, it continues to be in working mode N, that is, it continues to receive and process the count values ​​broadcast by other devices until entering the next working mode M. That is, in a certain time period (the time period is greater than the broadcast cycle of the device), it is composed of continuous and alternating working modes M and working modes N, and the operating time of working mode M is less than the operating time of working mode N.

[0046] It should be noted that, for the convenience of description, Fig. 9 The time periods required for the working modes M and N in the figure are not drawn to scale. In fact, the time periods of the working modes M and N are very different, and the time period of the working mode M is only one percent of the time period of the working mode N or even less.

[0047] See also Fig.10 , which is a timing diagram of the working mode M and working mode N of multiple devices (device ae) in an embodiment of the present application, from top to bottom are the timing diagrams of the working mode M and working mode N of device ae. Among them, Fig.10 The dotted line in the figure is a reference line. Since the time period of working mode M is much smaller than the time period of working mode N (the former is one percent or even less than the latter), the time period of working mode M of each device is difficult to overlap. In addition, as described later in this application, a certain anti-collision algorithm can be set so that the time period of working mode M of each device does not overlap to avoid broadcast conflicts). Even in extreme cases, broadcast conflicts occur between devices. Since this situation is extremely rare and the broadcast time of the device is very short, it is also easy to resolve through the conflict resolution method provided by the communication protocol itself.

[0048] It should be noted that in Fig. 9 , Fig.10 The medium-high level represents the working mode M, the low level represents the working mode N, and the distance between the rising edges of each two adjacent high levels is the time interval between the two adjacent working modes M of the device. For example Fig. 9 In the illustrated embodiment, the time interval between two adjacent working modes M of the device (that is, the time interval between two adjacent broadcasts) is a broadcast cycle of the device. It should be noted that the time of two adjacent broadcast cycles is not necessarily the same.

[0049] Step S13: Each time the device receives a count value, it compares the count value with its own current count value. If the count value is greater than its own current count value, the received count value is used to update the count value of the counter contained in itself, that is, to update the current count value of the counter itself. If the count value is less than or equal to its own current count value, the received count value is not used to update the count value of the counter contained in itself.

[0050] It should be noted that the device will compare each count value it receives with its current count value. If the received count value is greater than the current count value of the device, the received count value will be updated to the current count value of the device itself, and the device can be synchronized with the device with the larger count value.

[0051] For example, device A receives a count value of 51 from device B, and its current count value is 50. Device A compares the received count value 51 with its current count value 50, determines that the received count value 51 is larger, and updates the count value of device A from 50 to 51, thereby achieving synchronization between device A and device B.

[0052] It should also be noted that in actual applications, the count value increment time points of the counters of each device may be inconsistent. In extreme cases, the time points when the count values ​​of two devices are incremented by 1 are close to the time interval required for the count value of the device to be incremented by 1, which will cause the devices to be unable to maintain synchronization. Specifically, the time points when the count values ​​of different devices are incremented by 1 may be different. For example, the time point when the count value of device A is incremented by 1 is not consistent with the time point when the count value of device B is incremented by 1. There is a time difference. In extreme cases, for example, the count value increment speed of device A and device B is incremented by 1 every 2us, that is, the time interval required for the count value of the device to be incremented by 1 is 2us, and the time points when the count values ​​of device A and device B are incremented by 1 differ by nearly 2us (must be less than 2us). The time difference between the count values ​​of the two devices may cause device A to receive the count value of device B at a certain moment (for example, the count value of device B is 16) and update its own count value to 16. However, according to the count value increment rhythm of the counter of device A, after device A updates its own count value, its count value is immediately incremented by 1 and becomes 17. At this time, according to the growth rhythm of the count value of device B, its count value has not yet reached the time of adding 1 (it will add 1 after nearly 2us), and the count value of device B is still 16, which will cause device A and device B to be unable to keep pace.

[0053] At the same time, it may take a certain amount of time for the device to receive the count value, and it may also take a certain amount of time to process and update the count value after receiving the count value, which will cause a certain time delay. In addition, the steps of receiving the count value of the device and updating the count value of the counter may not be synchronized. The counter of the device may just be updated with the count value received from other devices, and the count value of the counter of the device will be increased by 1 immediately. This will cause errors in some extreme cases: if the count value received by the device from other devices is very close to the current count value of the device, it may cause the device to update the count value frequently, increasing the work inside the device.

[0054] For example, device A receives a count value of 51 from device B, and the current count value of device A is 50. When comparing the count values, the received 51 is compared with the current 50. As a result, the current count value of device A's counter is updated from 50 to 51. It takes a certain amount of time for device A to process the count value and complete the comparison and judgment. The current count value of its own may have reached the edge of the jump. It is possible that just after device A updates its current count value to 51, its own count value has jumped and increased by 1 to 52. However, at this time, the count value of device B is still 51, and the situation changes to: the current count value of device A is 1 greater than that of device B. Then, in the next round of broadcasting, device B may update its current count value due to receiving the count value of device A, for example, from 53 to 54. If the same situation repeats in device B, the count value of device B will become 1 greater than that of device A, causing the count value of device A to continue to increase by 1 in the next round of broadcasting. In this way, the count values ​​of the two devices will increase incorrectly.

[0055] Therefore, in order to reduce the impact of the above situation, the embodiment of the present application sets a threshold to reduce the asynchrony between devices caused by the inconsistent time point of the count value adding 1 (in extreme cases) or the frequent unnecessary updates of the device count value caused by errors such as delay. Figure 3 , the method for achieving synchronization includes steps S21 to S23, as described below.

[0056] Step S21: The device periodically broadcasts its own count value, wherein the count value comes from a counter included in the device, and the count value of the counter increases at a fixed speed. The count value increases at a preset fixed speed.

[0057] Step S22: The device receives the count values ​​broadcasted by other devices during a time period when it does not broadcast its own count value.

[0058] Step S23: Each time the device receives a count value, it compares the count value with its own current count value. If the count value is greater than the sum of its own current count value plus a set threshold, the received count value is used to update the count value of the counter contained in itself. If the count value is less than or equal to the sum of its own current count value plus the set threshold, the received count value is not used to update the count value of the counter contained in itself, where the threshold is a positive number.

[0059] In step S23, once the device receives a count value, it compares the count values. When the received count value is greater than the sum of the current count value of the device itself plus the set threshold value, the current count value of the counter of the device itself is replaced with the larger count value, and the device is synchronized with the device with the larger count value. The device receives another count value, continues to compare the count values, and then updates or does not process, and keeps looping the above steps. During the loop, the device is always synchronized with the device whose count value is greater than the sum of the current count value of the device itself plus the set threshold value. Of course, it is possible to continue to receive the count values ​​of other devices after processing the received count value, and stop receiving the count values ​​of other devices before processing. It is also possible to continue to receive the count values ​​of other devices, but the device compares and processes them one by one in the order of the time of receipt, that is, each comparison only compares the received count value with the current count value of the counter of the device itself, and updates or does not update after comparison.

[0060] By setting this threshold, the device will update its current count value only when the received count value is greater than the sum of the current count value of the counter of the device plus the set threshold value, which can reduce the situation where the count value of the device is modified unnecessarily due to errors caused by time delays, etc., and can prevent the occurrence of the above-mentioned errors to a certain extent, improve the stability of the device operation, and reduce the problem of synchronization between devices caused by the increase of the count value at different time points (in extreme cases). Of course, in the above example, when device A updates its own count value 50 to 51 due to receiving the count value 51 of device B, in some other embodiments, it is also possible that after comparison and judgment, the current count value of device A is still 50, that is, the processing time is relatively fast, and the update of the count value is normal. In some other embodiments, it is also possible that after comparison and judgment, the current count value of device A has been increased by 1 to 51, but device A still updates its own count value to 51, but this operation does not actually produce any actual effect and does not cause any problems.

[0061] It should be noted that this threshold can be set to 1. This solution can effectively reduce the problem of frequent and unnecessary updates of count values ​​due to errors such as delays, and can also reduce the problem of device synchronization due to extreme differences in count value growth rhythms between different devices.

[0062] exist Figure 3 In the embodiment shown, the device only compares two count values ​​(a received count value and the current count value of the counter of the device) at a time. Of course, if a threshold is set, the received count values ​​are compared one by one with the sum of the current count value of the device plus the set threshold value. The processing speed is fast and efficient, and it does not need to occupy more hardware resources. After the comparison, the device updates its current count value to a count value larger than the sum of its current count value plus the threshold value, that is, it can achieve synchronization with the device with a larger count value. Any device is the same operation, and multiple devices can be synchronized in the end. The method is relatively simple. And the same operation is also applied to devices that join at any time, and devices that leave will not affect other devices to do the same operation. Therefore, the scenes of other devices joining and / or leaving at any time will not affect the realization of the synchronization of two devices spreading to multiple devices, so it can be applied to scenes with dynamic changes in devices.

[0063] It should be noted that the threshold is a pre-set value, which may be a value set according to user requirements, a value set according to market data, or a value set by the device itself.

[0064] It should also be noted that in order to reduce the possibility that the random number of this device is the same as the random number of other devices and reduce the broadcast conflict between this device and other devices, it is possible to include a check on the uniqueness of the random number of this device, that is, to check whether the random number of this device is the same as the random number of other devices corresponding to the received count value, see Figure 4 , which includes steps S31 to S33, as described below.

[0065] Step S31: When receiving the count value of other devices, obtain the random number of other devices corresponding to the count value according to the count value received from other devices. Specifically, it can be: according to the received count value and the predetermined broadcast period, calculate the random number of the corresponding device. For example, the predetermined broadcast period is 1000, the count value received by the device is 3045, and the random number of the device corresponding to the count value received by the device is calculated to be 45.

[0066] Step S32: Compare the random numbers obtained from other devices with the random number of the device itself.

[0067] Step S33: When the comparison result is the same, the device regenerates a random number that is different from its current random number. When the comparison result is different, the random number is not processed.

[0068] It should be noted that when it is found that the random numbers of this device and other devices are the same, this device can change its own random number, that is, regenerate a random number different from its current random number, so that it is different from the random number of the other device. At this time, this device will broadcast when the remainder of its current count value divided by the predetermined broadcast period is equal to the regenerated random number. The purpose of the embodiment of the present application is to make the broadcast time point of this device and other devices different, reduce the broadcast conflict between devices, and improve the broadcast efficiency and reception efficiency.

[0069] In all embodiments of the present application, the time interval for each increment of a count value of the counter included in the device is less than 10ms. Within this time interval, the human eye cannot perceive the difference in count values ​​of multiple synchronized devices, that is, the time interval for the increment of the count value is greater than 10ms, and the human eye can easily distinguish the asynchrony of the count value. The preferred time interval for the increment of the count value is 2ms.

[0070] It should also be noted that, in order to extend the working time of the counter included in the device, in the embodiment of the present application, when the device is started, the counter included therein is reset to a preset initial value. Resetting the count value of the counter can extend the counting time of the device since it is turned on. The initial value may be zero or non-zero. The initial value is a pre-set value, which may be a value set according to user requirements, a value set according to market data, or a value set by the device itself.

[0071] See now Figure 5 , assuming that on a road X, devices A to D are a scattered device group and need to be synchronized, but the distance between device B and device D exceeds the communication reception range of device A, that is, device B and device D cannot receive the count value broadcast by device A because they are too far away from device A, but device C can receive the count value broadcast by device A and device D, device D can receive the count value broadcast by device C and device B, and device B can receive the count value broadcast by device D.

[0072] It should be noted that Figure 5 The curve shown in the figure represents the road, the black dot represents the location of the device, and the dotted circle represents the communication range within which the device can broadcast and receive count values. For example, circle A' represents a circle with device A as the center and the farthest communication distance of device A as the radius. The range of the circle is the communication range of device A. Similarly, circle B' is the communication range of device B, circle C' is the communication range of device C, and circle D' is the communication range of device D.

[0073] To achieve synchronization between multiple distributed device groups, such as Figure 5 The method for synchronizing multiple devices such as device A to device D in the embodiment of the present invention comprises: each of the multiple devices comprises a counter, each counter has a count value, and the count value of each counter of the multiple devices increases at the same fixed speed. The method for synchronizing multiple devices comprises the following steps: Each of the multiple devices performs the following steps: periodically broadcasting its own count value; wherein each of the multiple devices receives the count values ​​broadcasted by other devices during a time period when the current count value of the device is not broadcasted, and each time a count value is received, the count value is compared with the current count value of the device, if the count value is greater than the sum of the current count value of the device plus a set threshold, the count value of the counter contained in the device is updated using the received count value, and if the count value is less than or equal to the sum of the current count value of the device plus the set threshold, the count value of the counter contained in the device is not updated using the received count value.

[0074] The device groups of the present application can send and receive count values ​​without establishing a connection relationship, which reduces the time to achieve synchronization, and adopts multicast in the form of point-to-multiple propagation, which improves the efficiency of count value broadcasting. Each of the multiple devices periodically broadcasts its own count value, and repeatedly receives the count values ​​of other devices. After receiving a count value, it compares the count values ​​of two devices, updates the count value or does not process it. Finally, the count values ​​of any two devices in the multiple devices will be the same, achieving the purpose of synchronization.

[0075] This application does not perform a unified search for the host. The device group does not need to uniformly receive the count values ​​of all devices except itself. Instead, it only needs to be able to receive the count values ​​of adjacent devices. There is no need to receive the count values ​​of all other devices regardless of distance, so as to avoid the situation where the count values ​​are not fully received. If two devices are far apart (out of communication range), the communication capability becomes weak and they cannot receive the count values ​​between each other. Therefore, even if there are two devices that are far apart, as long as there are one or more adjacent devices between them, these one or more adjacent devices can directly or indirectly receive the count values ​​of both devices, and multiple devices can be synchronized.

[0076] Specifically: See Figure 5, Assume that at a certain moment, the current count value of device A is 2, the current count value of device B is 4, the current count value of device C is 3, and the current count value of device D is 5. Each device periodically broadcasts its own count value. Assume that device B receives the count value 5 of device D, then the count value of device B is updated to 5. At the same time, device A receives the count value 3 of device C, then the count value of device A is updated to 3. At the same time, device C receives the count value 5 of device D, then the count value of device C is updated to 5. At this time, the current count value of device A is 3, and the current count values ​​of devices B, C, and D are all 5, and the three are synchronized. At another certain moment, the current count value of device A increases to 5, and the current count values ​​of devices B, C, and D increase to 7. Device C receives the count value 5 of device A, and device C does not update. At the same time, device A receives the count value 7 of device C, then the count value of device A is updated to 7. The current count values ​​of devices A, B, C, and D are all 7, and the purpose of synchronization of the four devices is achieved.

[0077] In order to avoid conflicts caused by multiple devices broadcasting at the same time, a random factor may be introduced into one or both of the broadcast cycle and the timing of broadcasting in each cycle. Considering that the count value of each device may also be updated in the technical solution of the present application, the following provides three feasible methods for determining the broadcast time point when the device periodically broadcasts its own count value (also referred to as "methods for periodically broadcasting its own count value").

[0078] In the first method, each of the multiple devices generates a random number K, and when the current count value of the counter is K multiplied by a positive integer N, the count value will be broadcast. In other words, the broadcast is triggered when the current count value of the counter is K*N (where N=1, 2, 3, ...). Generally speaking, the device uses the initially generated random number K as the basis, and once the current count value of the counter reaches K*N (N=1, 2, 3, ...), it will broadcast once. For example, if the random number K is generated by the device as 20, the first broadcast trigger condition is that the current count value of the device's counter reaches 20×1=20, and the second trigger condition is that the current count value of the device's counter reaches 20×2=40, and so on, and the broadcast will be carried out in an arithmetic progression sequence of 20, 40, 60, and so on.

[0079] However, during operation, this device will receive count values ​​from other devices, which will cause its own count value to be updated. Due to the existence of this update mechanism, some of the count values ​​that should have appeared according to the K*N rule (N is a positive integer, 1, 2, 3, 4... in sequence) will be skipped. Therefore, when the device broadcasts, it will not strictly broadcast in an arithmetic progression sequence of count values ​​such as N, 2N, 3N, 4N... For example, the random number K is generated by the device as 20. When the count value of the counter of this device increases to 18, it receives a count value of 42 from other devices. At this time, the count value of this device itself is immediately updated to 42. Later, when the count value continues to increase to 60, the device will broadcast the count value.

[0080] The second method: set a predetermined broadcast cycle, which usually does not change, but it does not exclude changes over time due to special needs, and each of the multiple devices generates a random number that is less than the predetermined broadcast cycle. When the remainder of the current count value of the counter of the device divided by the predetermined broadcast cycle is equal to the random number, the current count value of the counter is broadcast. That is, the broadcast triggering time point of this method is: broadcast when the remainder of the current count value of the counter divided by the predetermined broadcast cycle is equal to the random number. For example, the predetermined broadcast cycle is set to 100, and the random number generated by the device is 21. When the remainder of the current count value of the counter divided by 100 is equal to 21, broadcast, for example, broadcast once when the current count value of the counter is 321, and the next broadcast is when the current count value of the counter is 621.

[0081] Of course, the time point at which the device broadcasts the current count value of the counter can also be determined by other methods, as long as the device can periodically broadcast its own count value. For example, the method for determining the broadcast time point is as follows: based on the growth rate of the counter's count value itself and the new random number generated during each broadcast. The specific process is: when the counter's count value increases by the value of the random number generated during the last broadcast at its own growth rate, the broadcast is triggered, and the device will broadcast the counter's current count value and generate a new random number; the next broadcast time point is when the counter's count value increases by the value of the newly generated random number at its own growth rate. Among them, when the counter is turned on, an initial random number is automatically generated, and the time point of the first broadcast is when the counter's count value increases to a value equal to the initial random number at its own growth rate. For example, when the counter is turned on, it generates a random number of 20. The counter's count value increases by one count value every 2us, that is, the count value increases by 1 every 2us, and each increase in count value is a beat (that is, every 2us is a beat). When the counter's count value increases by 20 according to its own growth rate, that is, the counter has walked 20 beats, the device broadcasts for the first time and generates a new random number 89; the next broadcast time point is when the count value increases by 89 according to its own growth rate, at this time the counter's current count value is broadcast and a new random number 120 is generated; after that, the next broadcast time point is when the count value increases by 120 according to its own growth rate, and the cycle continues. The device will broadcast periodically in this way.

[0082] It should be noted that in the second method described above, the broadcast cycle scheduled by each device can be the same, which makes it easier to verify whether the random numbers of other devices corresponding to the received count values ​​are the same, so as to determine whether to change its own random number, thereby reducing the possibility of broadcast conflicts. Of course, the broadcast cycle scheduled by each device can also be different, because the addition of random factors can also reduce the possibility of device broadcast conflicts, but it is impossible to verify whether broadcast conflicts with other devices will occur.

[0083] It should be noted that, in the case of the second method, when the device scale (that is, the number of devices) is known in advance, a predetermined broadcast period can be set according to the device scale. The predetermined broadcast period is larger than the device scale, so that enough random numbers can be set to ensure that the random numbers set for each device after verification are different, and finally broadcast conflicts between devices can be completely avoided. For example, if the device scale is 998 devices, the predetermined broadcast period can be set to 1000 or 1020 or 2000, etc., as long as it is larger than the device scale. If the predetermined broadcast period is set to 1000 and the random number is set to 1-998, each device will eventually have a unique random number after verification, and the broadcast time point of each device will be different, so there will be no broadcast conflict.

[0084] In order to extend the working time of the counter included in the device, in the embodiment of the present application, when the device is started, the counter included therein is reset to a preset initial value. The initial value may be zero or non-zero. The initial value is a value set in advance, which may be a value set according to user requirements, a value set according to market data, or a value set by the device itself.

[0085] A device provided in an embodiment of the present application is described below. The device described below can be referenced in correspondence with the synchronization method described above.

[0086] See also Figure 6 An embodiment of the present application provides a device that can achieve synchronization with other devices. The device includes: a counter, a broadcast module, a receiving module, and a processing module.

[0087] The count value of the counter increases at a preset fixed speed; this growth rate is a pre-set value, which can be a value set according to user requirements, a value set according to market data, or a value set by the device itself. In some embodiments, the time interval for each count value increase of the counter can be set to be less than 10ms. For example, the time interval for each count value increase of the counter is set to 2ms, that is, the time required for the count value to increase by 1 is 2ms, that is, the growth rate of the count value is 1 value every 2ms. It should be noted that the count value growth time interval of each of the multiple devices is set to be the same, and the count value growth rate of each of the multiple devices is the same.

[0088] The broadcast module is used to receive the count value output by the device counter and broadcast the count value periodically. The receiving module is used to receive the count value broadcast by other devices during the time period when the broadcast module does not broadcast its own count value. The processing module is used to compare each of the received count values ​​with the current count value of the device. If the count value is greater than the sum of the current count value of the device plus the set threshold, the received count value is used to update the count value of the counter contained in the device. If the count value is less than or equal to the sum of the current count value of the device plus the set threshold, the received count value is not used to update the count value of the counter contained in the device, wherein the threshold is zero or a positive number. The receiving module can stop receiving each time a count value is received, and continue receiving after the processing module compares and processes the count value. It can also continue to receive count values, but the processing module compares and processes each received count value with its own count value one by one according to the time sequence of the count value reception, that is, only one received count value is compared and processed with its own count value each time. It should be noted that after each processing and judgment by the processing module, if the received count value is greater than the sum of the current count value of the processing module itself plus the set threshold, the received count value will be transmitted to the counter, and the counter will be updated.

[0089] It should be noted that in some embodiments, the threshold is set to zero. In this case, this threshold does not actually exist. The device directly compares the received count value with its own current count value. If the received count value is greater than its own current count value, the received count value is used to update the count value of the counter contained in itself, and the device can be synchronized with the device with the larger count value.

[0090] In an embodiment of the present application, a method for realizing synchronous display of patterns is also provided, which executes the synchronization method in the embodiment described above, wherein at least one pattern is stored in the device, each of the at least one pattern corresponds to a counting value range, and at least one pattern contains a pattern to be displayed, and the pattern and the counting value range defined by the pattern to be displayed contained therein are the same, for example, pattern A to be displayed corresponds to a counting value range of 0-150, and pattern B to be displayed corresponds to a counting value range of 0-200; the counting value of the device itself is used to take the modulus of the counting value range corresponding to the pattern to be displayed; when the modulus is a preset value, the first frame of the pattern to be displayed is displayed, wherein the preset value is pre-set, and the preset value can be 0, 1, 2, 3, etc., but it is generally necessary to ensure that the preset value is within the counting value range of all patterns in the device.

[0091] It should be noted that the "pattern" and the "pattern" in the pattern to be displayed do not only include patterns composed of various colors, lines, texts, or any combination of at least two of them. It can include a display without a pattern and pure color, or a display without a pattern and pure text (including numbers). That is, pure color or pure text is also the pattern mentioned in this application. The pattern can be a static image or each frame of a moving picture. Therefore, as long as the information to be displayed has an indication or decorative effect, it falls within the scope of "pattern".

[0092] It should be noted that the preset values ​​of this device are the same as the preset values ​​in other devices, so as to achieve synchronization of pattern display between this device and other devices, as described in detail below.

[0093] The pattern to be displayed is stored in advance, and a count value range is defined for the pattern to be displayed. For example, if the display time of the pattern to be displayed is 3S, and the time required for the count value of the counter in the device to increase by 1 is 2mS (milliseconds), then the corresponding count value range is 1500 count values. The current count value of the counter is modulo 1500 (the count value range corresponding to the pattern to be displayed), and the result of the modulo operation presents a periodic change characteristic, that is, when the count value of the counter starts to increase from 0, the result of the modulo operation of 1500 is 0, 1, 2, 3, 4...1499, 0, 1, 2, 3, 4...1499, 0, 1, 2...... etc. The same pattern synchronization point is set in advance for all devices. The so-called "pattern synchronization point" means that no matter which pattern to be displayed is stored in the device, as long as the device count value modulo the count value range corresponding to the pattern to be displayed is a preset value, such as 0, the pattern to be displayed begins to be displayed, for example, the first frame of the pattern to be displayed is displayed. This preset value is pre-set and is the same for each pattern to be displayed stored in the device. In this way, when the count values ​​between the devices are synchronized, the result of taking the modulus of the count value range corresponding to the same pattern to be displayed is the same, and the pattern to be displayed must be displayed at the same time. Therefore, after determining the time point to start displaying the pattern to be displayed, the synchronization of pattern display of each device can be achieved. After determining the time point to start displaying the pattern to be displayed, how to display all the patterns to be displayed belongs to the prior art, and those skilled in the art can understand that there are many implementation methods, which will not be repeated here.

[0094] In fact, as long as the display time of the patterns to be displayed on each device is the same, the pattern display can also be synchronized. For example, between two devices, one displays a beating heart pattern, and the other displays a little boy hitting a ball with the same rhythm. The two patterns are displayed for the same length of time, and the above method can also be used to synchronize the two patterns.

[0095] A device may store multiple patterns to be displayed in advance, and the display time lengths of the patterns to be displayed are the same or different. When displaying the patterns, the modulo values ​​are also the same or different accordingly. If the time required for the count value of the counter in the device to increase by 1 is still 2mS, and the display time length of a pattern to be displayed is 2S, then the corresponding count value range is 1000, and the modulo value is 0-999. If you want to synchronize the display of patterns between two devices, you generally need to do it for patterns with the same display time length.

[0096] A pattern synchronization display device provided in an embodiment of the present application is described below. The pattern synchronization display device described below can correspond to the pattern synchronization display method described above.

[0097] See also Figure 7 An embodiment of the present application provides a pattern synchronization display device, including: a counter, a broadcast module, a receiving module, a processing module, a storage module, and a display module.

[0098] The count value of the counter increases at a fixed speed, and the count value is the count value of the pattern synchronization display device itself. The broadcast module is used to receive the count value output by the counter and broadcast the count value periodically. The receiving module is used to receive the count value broadcasted by other pattern synchronization display devices during the time period when the broadcast module does not broadcast its own count value. The processing module is used to compare each of the received count values ​​with the current count value of itself. If the count value is greater than the sum of the current count value of itself plus the set threshold, the count value of the counter contained in itself is updated using the received count value. If the count value is less than or equal to the sum of the current count value of itself plus the set threshold, the count value of the counter contained in itself is not updated using the received count value, wherein the threshold is zero or a positive number. The storage module is used to store at least one pattern, each of the at least one pattern corresponds to a count value range, and at least one pattern includes a pattern to be displayed. The storage module can be a non-volatile memory. The display module is used to use the count value of the pattern synchronization display device itself to take a modulus of the count value range corresponding to the pattern to be displayed, and when the modulus is a preset value, the first frame of the pattern to be displayed is displayed, wherein the preset value is pre-set. The display module can be at least one of an LED, an LCD, an OLED or a seven-segment display.

[0099] The preset value is the same as the preset value in other pattern synchronous display devices.

[0100] It should be noted that the "pattern" in the "pattern" to be displayed does not only include a pattern composed of various colors, lines, texts, or any combination of at least two of them. It can include a display without a pattern and pure color, or a display without a pattern and pure text (including numbers). That is, pure color or pure text is also a pattern mentioned in this application. The pattern can be a static image or each frame of a moving picture. Therefore, as long as the information to be displayed has an indication or decorative effect, it falls within the scope of "pattern".

[0101] The specific implementation of the present application is described below in conjunction with a specific application scenario. The specific application scenario is the application of a bicycle taillight, that is, the device that executes the synchronization method of the present application is installed on the bicycle taillight. Figure 8 In this embodiment, the bicycle taillight synchronization method is implemented through the following steps S101-S107.

[0102] Step S101: When the bicycle taillight is started, the counter contained therein is reset to zero. Of course, in other embodiments, it can also be reset to a non-zero value.

[0103] Step S102: The bicycle taillight periodically broadcasts its own count value, wherein the count value comes from the counter included in the bicycle taillight, and the count value of the counter increases at a fixed speed. The time point of the bicycle taillight broadcasting its own count value is determined by: setting a predetermined broadcast period, which generally does not change, but does not exclude changes over time due to special needs, and broadcasting with the predetermined broadcast period as a period, and the bicycle taillight generates a random number less than the predetermined broadcast period, and in each broadcast period, when the remainder of the current count value of the bicycle taillight divided by the predetermined broadcast period is equal to the random number, the current count value of the bicycle taillight is broadcast. Of course, in other embodiments, the time point of the bicycle taillight broadcasting its own count value can also be determined by: generating a random number, and when the current count value of the counter of the bicycle taillight is an integer multiple of the random number, the current count value of the counter is broadcast. Of course, it can also be determined by other methods, as long as the bicycle taillight can periodically broadcast its own count value.

[0104] Step S103: During the time period when the bicycle taillight does not broadcast its own count value, the bicycle taillight receives the count values ​​broadcasted by other bicycle taillights.

[0105] Step S104: Every time the bicycle taillight receives a count value, it compares the count value with its own current count value. If the count value is greater than the sum of the current count value of the bicycle taillight plus the set threshold value, the count value of the counter contained in the bicycle taillight is updated with the received count value. If the count value is less than or equal to the sum of the current count value of the bicycle taillight plus the set threshold value, the count value of the counter contained in the bicycle taillight is not updated with the received count value. The threshold value can be a positive number, so the count value of the bicycle taillight will be updated to the received count value only when the received count value is greater than its own count value by the threshold value. Of course, the threshold value can be set to zero, that is, as long as the received count value is greater than its own current count value, the bicycle taillight will change its own count value to the received count value.

[0106] Step S105: At the same time, when the count value of other bicycle taillights is received, the corresponding random number of other bicycle taillights is obtained according to the count value received from other bicycle taillights. Specifically, the random number of other bicycle taillights is calculated according to the received count value and the predetermined broadcast cycle.

[0107] Step S106: Compare the obtained random numbers of other bicycle taillights with the own random number.

[0108] Step S107: When the comparison result is the same, the bicycle taillight regenerates a random number that is different from its current random number. When the comparison result is different, the random number is not processed.

[0109] Of course, in other embodiments, steps S105-S107 may also be performed before step S104, which will not affect the implementation of the present application.

[0110] The following is a detailed description of the method for implementing synchronization between multiple bicycle taillights in the present application in conjunction with a specific application scenario. The specific application scenario is the application of bicycle taillights, that is, the device for executing the synchronization method of the present application is installed on the bicycle taillight. In this embodiment, synchronization between multiple bicycle taillights is implemented through the following steps.

[0111] Each of the plurality of bicycle taillights is equipped with a counter, and the count value of each counter increases at the same fixed speed. The method for synchronizing the plurality of bicycle taillights comprises the following steps: Each of the plurality of bicycle taillights periodically broadcasts its own count value; wherein the bicycle taillight periodically broadcasts its own count value in the following manner: In the first method, the bicycle taillight generates a random number K, and when the current count value of the counter is K multiplied by a positive integer N, the count value will be broadcast. In other words, the broadcast is triggered when the count value of the counter is K*N (where N=1, 2, 3, ...). Generally speaking, the bicycle taillight uses the initially generated random number K as the basis, and once the count value of the counter reaches K*N (N=1, 2, 3, ...), a broadcast will be performed. For example, the random number K is generated as 20 by the bicycle taillight, then the first broadcast trigger condition is that the count value reaches 20×1=20, the second trigger condition is 20×2=40, and so on, and the broadcast will be performed in an arithmetic progression sequence of 20, 40, 60, and so on.

[0112] However, during operation, the bicycle taillight will receive count values ​​from other bicycle taillights, which will cause its own count value to be updated. Due to the existence of this update mechanism, some of the count values ​​that should have appeared according to the K*N rule (N is a positive integer, 1, 2, 3, 4... in sequence) will be skipped. Therefore, when the bicycle taillight is broadcasting, it will not strictly broadcast in sequence according to the arithmetic progression sequence of count values ​​such as N, 2N, 3N, 4N... For example, the random number K is generated by the bicycle taillight as 20. When the count value of the bicycle taillight counter increases to 18, it receives a count value of 42 from other bicycle taillights, and the count value of the bicycle taillight is then updated to 42. Afterwards, when the count value continues to increase to 60, the bicycle taillight will broadcast the count value.

[0113] The second method: set a predetermined broadcast cycle, which usually does not change, but it does not exclude that it may change over time due to special needs, and generate a random number less than the predetermined broadcast cycle. When the remainder of the current count value of the counter of the bicycle taillight divided by the predetermined broadcast cycle is equal to the random number, the current count value of the counter is broadcast. That is, the broadcast triggering time point of this method is: broadcast when the remainder of the current count value of the counter divided by the predetermined broadcast cycle is equal to the random number. For example, the predetermined broadcast cycle is set to 100, and the random number generated by the bicycle taillight is 21. When the remainder of the current count value of the counter divided by 100 is equal to 21, the broadcast is broadcast. For example, the current count value of the counter is 321, and the next broadcast is when the current count value of the counter is 621.

[0114] Of course, it can also be determined by other methods, as long as the bicycle taillight can periodically broadcast its own counting value.

[0115] Each bicycle taillight receives the count values ​​broadcasted by other bicycle taillights during a time period when it does not broadcast its own count value.

[0116] Each bicycle taillight receives a count value and compares the count value with its own current count value. If the count value is greater than the sum of the current count value of the bicycle taillight plus the set threshold, the received count value is used to update the count value of the counter contained in the bicycle taillight. If the count value is less than or equal to the sum of the current count value of the bicycle taillight plus the set threshold, the received count value is not used to update the count value of the counter contained in the bicycle taillight. The threshold value can be a positive number, so the count value of the bicycle taillight will be updated to the received count value only when the received count value is greater than its own count value by the threshold value. Of course, the threshold value can be set to zero, that is, as long as the received count value is greater than its own current count value, the bicycle taillight will change its own count value to the received count value.

[0117] The device provided by the present application is introduced below in combination with an application scenario. The device of this embodiment is configured in a bicycle taillight, and the counter, broadcast module, receiving module, and processing module of the device are all installed in the bicycle taillight. Among them, the counter, the broadcast module, and the receiving module are all connected to the processing module, and the count value of the counter increases at a fixed speed; the counter can directly output the count value to the broadcast module, and the broadcast module receives the count value output by the counter and periodically broadcasts the count value, or the counter can output the count value to the processing module, and then the processing module transmits it to the broadcast module, and periodically broadcasts the count value; during the time period when the count value of its own is not broadcast, the receiving module is used to receive the count value broadcast by other bicycle taillights, and transmit the received count value to the processing module; each time the processing module receives a count value, the count value is compared with the current count value of the processing module, if the count value is greater than the sum of the current count value of the processing module plus the set threshold value, the received count value is used to update the count value of the counter contained in the processing module, if the count value is less than or equal to the sum of the current count value of the processing module plus the set threshold value, the received count value is not used to update the count value of the counter contained in the processing module, wherein the threshold value is zero or a positive number.

[0118] In order to display patterns synchronously, the bicycle taillight further includes a storage module and a display module. The storage module is used to store at least one pattern, each of which corresponds to a count value range, and at least one pattern includes a pattern to be displayed; the display module is used to use the count value of the bicycle taillight itself to take the modulus of the count value range corresponding to the pattern to be displayed, and when the modulus is a preset value, the first frame of the pattern to be displayed is displayed, wherein the preset value is pre-set and the preset value is the same as the preset value in other bicycle taillights. The display module can be at least one of LED, LCD, OLED or a seven-segment display.

[0119] In short, the above is only the preferred embodiment of the present application, and all equivalent changes and modifications made according to the scope of the patent application of the present application should fall within the scope of coverage of the patent application of the present application.

Claims

1. A synchronization method, characterized in that: The method comprises the following steps: Periodically broadcasting its own count value, wherein the count value of the own comes from a counter included in the device, and the count value of the counter increases at a fixed rate; Receive count values ​​broadcasted by other devices during a period when the count value of the device itself is not broadcasted; Each time a count value is received, the count value is compared with the current count value of the device. If the count value is greater than the sum of the current count value of the device and the set threshold, the received count value is used to update the count value of the counter contained in the device. If the count value is less than or equal to the sum of the current count value of the device and the set threshold, the received count value is not used to update the count value of the counter contained in the device. The threshold is zero or a positive number.

2. The synchronization method according to claim 1, characterized in that: The method of periodically broadcasting its own count value is: A random number is generated, and when the current count value of the counter itself is an integer multiple of the random number, the current count value of the counter itself is broadcasted.

3. The synchronization method according to claim 1, characterized in that: The method of periodically broadcasting its own count value is: A predetermined broadcast cycle is set, and a random number smaller than the predetermined broadcast cycle is generated, and when the remainder of the current count value of the counter divided by the predetermined broadcast cycle is equal to the random number, the current count value of the counter is broadcast.

4. The synchronization method according to claim 3, characterized in that: Also includes: When receiving the count value of the other device, obtaining the random number of the other device according to the count value received from the other device; Compare the random numbers of other devices with its own random number; When the comparison result is the same, the device regenerates a random number that is different from its current random number. When the comparison result is different, the random number is not processed.

5. The synchronization method according to any one of claims 1 to 4, characterized in that: The time interval for each increment of a count value of the counter is less than 10 ms.

6. The synchronization method according to any one of claims 1 to 4, characterized in that: When the device is started, the count value of the included counter is reset to a preset initial value.

7. A device capable of achieving synchronization with other devices, characterized in that: The device comprises: A counter whose count value increases at a fixed rate; A broadcast module, used for receiving the count value output by the counter and periodically broadcasting the count value; A receiving module, used for receiving the count value broadcasted by the other device during a time period when the count value of the other device is not broadcasted; A processing module is used to compare each of the received count values ​​with its own current count value. If the count value is greater than the sum of the current count value of the self plus a set threshold, the received count value is used to update the count value of the counter contained in the self. If the count value is less than or equal to the sum of the current count value of the self plus the set threshold, the received count value is not used to update the count value of the counter contained in the self. The threshold is zero or a positive number.

8. A method for synchronously displaying a pattern, characterized in that: Executing the synchronization method according to any one of claims 1 to 6, wherein the device stores at least one pattern, each of the at least one pattern corresponds to a count value range, and the at least one pattern includes a pattern to be displayed; Using the count value of the device itself to take the modulus of the count value range corresponding to the pattern to be displayed; When the modulus is a preset value, the first frame of the pattern to be displayed is displayed.

9. The pattern synchronous display method according to claim 8, characterized in that: in, The preset value is the same as the preset value in the other device.

10. A pattern synchronization display device, characterized in that: include: A counter, whose count value increases at a fixed speed, and the count value is the count value of the pattern synchronization display device itself; A broadcast module, used for receiving the count value output by the counter and periodically broadcasting the count value; A receiving module, used for receiving count values ​​broadcasted by other pattern synchronization display devices during a time period when the count values ​​of the device itself are not broadcasted; a processing module, configured to compare each of the received count values ​​with the current count value of the counter, and if the count value is greater than the sum of the current count value of the counter and a set threshold, use the received count value to update the count value of the counter, and if the count value is less than or equal to the sum of the current count value of the counter and the set threshold, do not use the received count value to update the count value of the counter, wherein the threshold is zero or a positive number; A storage module, used for storing at least one pattern, each of the at least one pattern corresponds to a count value range, and the at least one pattern includes a pattern to be displayed; The display module is used to use the count value of the pattern synchronization display device itself to take the modulus of the count value range corresponding to the pattern to be displayed, and when the modulus is a preset value, display the first frame of the pattern to be displayed.

11. The pattern synchronization display device according to claim 10, characterized in that: in, The preset value is the same as the preset value in the other pattern synchronous display device.

Citation Information

Patent Citations

  • Distributed clock synchronization method

    CN103078697A

  • Moving pedestrian or vehicle position synchronization signal device and method

    CN115376362A

  • Time synchronization method, central control host and wireless device

    CN117295148A

  • Synchronous control method and system among multiple devices

    CN117675155A

  • Time synchronization method of distributed sensor

    CN118354415A