A lamp control node time synchronization method and system based on an internet of things
By using an IoT-based time synchronization method for lighting control nodes and employing the RBS algorithm to correct, synchronize, and compensate for time differences, the synchronization error caused by different time bases of the lighting control nodes is resolved, improving the time synchronization accuracy and enabling intelligent and remote control of landscape lighting.
Patent Information
- Application Number
- CN202211078367.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-05
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2042-09-05
AI Technical Summary
In existing technologies, the different time bases of the lighting control nodes lead to synchronization time errors, which affect the lighting control effect.
By using an IoT-based lighting control node time synchronization method, lighting control commands are generated by the landscape lighting control terminal, the lighting control initiation node is determined, the RBS algorithm is used to correct and synchronize the correction node, and the synchronization time error is saved and the average error is calculated for time compensation when it is not the first synchronization.
This improved the time synchronization accuracy of the lighting control nodes, met the node time error requirements, ensured the lighting control effect, and realized the intelligent and remote control of landscape lighting.
Smart Images

Figure CN115499080B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of lighting control, and more particularly to a method and system for synchronizing the time of lighting control nodes based on the Internet of Things. Background Technology
[0002] Landscape lighting refers to the use of light to decorate the environment. Landscape lighting encompasses various mediums, including urban roads, important buildings, urban gardens, and other public spaces and facilities. Utilizing LED lighting fixtures to integrate light with urban architecture creates a visual feast that blends the socio-cultural level and art of modern cities. In large-scale landscape lighting control systems, a single controller often manages tens of thousands of LED lights, which are distributed throughout the application area. Therefore, ensuring time synchronization between different lighting control nodes is a key technology for achieving coordinated control of lighting effects and timed playback.
[0003] However, existing technologies have different time bases, resulting in synchronization time errors and causing technical problems that affect the lighting control effect. Summary of the Invention
[0004] This application provides a time synchronization method and system for lighting control nodes based on the Internet of Things (IoT). It solves the technical problem in existing technologies where different node time bases lead to synchronization time errors, which affect the lighting control effect. The method optimizes the RBS algorithm for adaptability and corrects the synchronization time application of lighting control nodes, so that the nodes have the same time base, improves the time synchronization accuracy, meets the requirements for node time error, and meets the limitations of time synchronization consumption, thus ensuring the lighting control effect and achieving the technical effect of intelligent and remote landscape lighting control.
[0005] In view of the above problems, the present invention provides a method and system for time synchronization of lighting control nodes based on the Internet of Things.
[0006] In a first aspect, this application provides a method for time synchronization of lighting control nodes based on the Internet of Things (IoT). The method includes: generating lighting control commands through a landscape lighting control terminal; obtaining information of nodes to be controlled according to the lighting control commands; performing initiating node analysis on the information of nodes to be controlled to determine the lighting control initiating node; traversing other nodes in the information of nodes to be controlled based on the lighting control initiating node to determine whether the correction node is the first synchronization; if the correction node is the first synchronization, performing correction synchronization on the correction node based on the RBS algorithm to obtain a synchronization time result; when the correction node is not the first synchronization, saving the synchronization time error and calculating the average error; and performing time compensation based on the synchronization time result and the average error to achieve time synchronization of the lighting control nodes.
[0007] On the other hand, this application also provides an IoT-based lighting control node time synchronization system, the system comprising: an instruction generation module for generating lighting control instructions through a landscape lighting control terminal; a node to be controlled module for obtaining node information to be controlled according to the lighting control instructions; an initiating node determination module for analyzing the node information to be controlled to determine the lighting control initiating node; a synchronization judgment module for traversing other nodes in the node information to be controlled based on the lighting control initiating node to determine whether the correction node is the first synchronization; a correction synchronization module for performing correction synchronization on the correction node based on the RBS algorithm if the correction node is the first synchronization to obtain a synchronization time result; an error calculation module for saving the synchronization time error and calculating the average error when the correction node is not the first synchronization; and a time compensation module for performing time compensation based on the synchronization time result and the average error to achieve lighting control node time synchronization.
[0008] One or more technical solutions provided in this application have at least the following technical effects or advantages:
[0009] This technical solution achieves time synchronization of lighting control nodes by generating lighting control commands through a landscape lighting control terminal, obtaining information about the nodes to be controlled based on these commands, analyzing the initiating node information to determine the initiating node, traversing other nodes in the information of the nodes to be controlled based on the initiating node, and determining whether the correction node is synchronizing for the first time. If it is synchronizing for the first time, the correction node is synchronized based on the RBS algorithm to obtain the synchronization time result. If it is not synchronizing for the first time, the synchronization time error is saved and the average error is calculated. Time compensation is then performed based on the synchronization time result and the average error, thus achieving time synchronization of lighting control nodes. This optimizes the RBS algorithm for compatibility, applies synchronization time correction to lighting control nodes, ensures that nodes have the same time base, improves time synchronization accuracy, meets the requirements for node time error, and satisfies the limitations of time synchronization consumption, guaranteeing the lighting control effect. Ultimately, this achieves the technical effect of intelligent and remote landscape lighting control. Attached Figure Description
[0010] Figure 1 This is a flowchart illustrating a time synchronization method for lighting control nodes based on the Internet of Things (IoT) according to this application.
[0011] Figure 2 This is a schematic diagram illustrating the process of obtaining information about the node to be controlled in a time synchronization method for lighting control nodes based on the Internet of Things (IoT) of this application.
[0012] Figure 3 This is a schematic diagram of the process for correcting and synchronizing the correction node in a time synchronization method for lighting control nodes based on the Internet of Things in this application;
[0013] Figure 4 This is a schematic diagram of the structure of a time synchronization system for lighting control nodes based on the Internet of Things (IoT) according to this application.
[0014] Explanation of reference numerals in the attached diagram: Instruction generation module 11, node to be controlled acquisition module 12, initiating node determination module 13, synchronization judgment module 14, correction synchronization module 15, error calculation module 16, time compensation module 17. Detailed Implementation
[0015] This application provides a time synchronization method system for lighting control nodes based on the Internet of Things (IoT). It solves the technical problem in existing technologies where different node time bases lead to synchronization time errors, which affect the lighting control effect. The method optimizes the RBS algorithm for adaptability and corrects the synchronization time of the lighting control nodes, so that the nodes have the same time base, improves the time synchronization accuracy, meets the requirements for node time error, and meets the limitations of time synchronization consumption, thus ensuring the lighting control effect and achieving the technical effect of intelligent and remote landscape lighting control.
[0016] Example 1
[0017] like Figure 1 As shown, this application provides a time synchronization method for lighting control nodes based on the Internet of Things, the method comprising:
[0018] Step S100: Generate lighting control instructions through the landscape lighting control terminal;
[0019] Step S200: Obtain the information of the node to be controlled according to the light control command;
[0020] like Figure 2 As shown, furthermore, in obtaining the information of the node to be controlled according to the light control command, step S200 of this application also includes:
[0021] Step S210: The landscape lighting control terminal includes lighting control gateway and lighting control node information;
[0022] Step S220: Establish a wireless sensor network between the lighting control gateway and the lighting control node information;
[0023] Step S230: Obtain the lighting effect file, and generate the lighting control command based on the lighting effect file;
[0024] Step S240: According to the lighting control command, the lighting control gateway sends the lighting effect file to the node to be controlled through the wireless sensor network.
[0025] Specifically, landscape lighting refers to the use of light to decorate the environment. Landscape lighting encompasses various mediums, including urban roads, important buildings, urban gardens, and other public spaces and facilities. Utilizing LED lighting fixtures to integrate light with urban architecture creates a visual feast that blends the socio-cultural level and art of modern cities. In large-scale landscape lighting control systems, a single controller often manages tens of thousands of LED lights, which are distributed throughout the application area. Therefore, ensuring time synchronization between different lighting control nodes is a key technology for achieving coordinated control of lighting effects and timed playback.
[0026] Based on an IoT system framework, lighting control commands are generated through a landscape lighting control terminal. This terminal is used for controlling the playback of landscape lighting lights, supports heterogeneous layouts, facilitates the addition and deletion of nodes, and supports remote control and management, including lighting control gateway and node information. The lighting control gateway can wirelessly communicate with the external network via CAT.1 mobile communication, meaning that node programs can be remotely updated and lighting effect files can be sent to nodes through a client program. Compared with traditional lighting control systems, there is no need to change video playback files on-site, and the system supports remote upgrades, improving system stability and reducing later maintenance costs. The lighting control nodes are integrated with the LED lights, have power conversion functions, are compatible with most lighting fixtures on the market that support the DMX512 protocol, have universal interfaces, each node has wireless communication capabilities, and each lighting control node has a unique identifier for identification. Furthermore, program video files are distributed and stored in the memory of each lighting control node, and the program supports remote updates.
[0027] A wireless sensor network is established between the lighting control gateway and the lighting control node information. This wireless sensor network is a self-organizing network composed of randomly distributed sensor nodes connected wirelessly, enabling data transmission and processing through collaboration among the sensor nodes. Data can be transmitted wirelessly, offering high speed and strong anti-interference capabilities, allowing bidirectional data transmission. This ensures the stability and real-time performance of data transmission, avoids the complex wiring of traditional lighting control systems, improves communication flexibility, and reduces the cost and time of hardware deployment.
[0028] Based on customer requirements and the layout of the LED lights, corresponding lighting effect files are created. Lighting control instructions are then generated from these files. This involves decomposing the created lighting effect files into corresponding terminal nodes, extracting the program files for each terminal node according to its control of the LED lights, and generating corresponding instructions for each designated lighting control node. Based on these instructions, the lighting effect files are first sent to the lighting control gateway via CAT.1. The lighting control gateway then transmits the lighting effect files to the designated nodes to be controlled via the wireless sensor network. This ensures effective lighting control and achieves intelligent and remote landscape lighting control.
[0029] Step S300: Analyze the information of the node to be controlled to determine the initiating node for lighting control;
[0030] Step S400: Based on the light control initiating node, traverse the other nodes in the information of the nodes to be controlled, and determine whether the correction node is synchronizing for the first time;
[0031] Specifically, the initiating node is analyzed in the information of the node to be controlled to determine the lighting control initiating node, that is, the lighting control starting node. Based on the lighting control initiating node, other nodes in the information of the node to be controlled are traversed and accessed, and it is determined whether each correction node in the information of the node to be controlled is the first synchronization.
[0032] Step S500: If the correction node is synchronizing for the first time, perform correction synchronization on the correction node based on the RBS algorithm to obtain the synchronization time result;
[0033] like Figure 3 As shown, further, if the correction node is synchronizing for the first time, the correction node is synchronized based on the RBS algorithm. Step S500 of this application further includes:
[0034] Step S510: Identify each lighting control node in the lighting control node information to obtain the node software address number;
[0035] Step S520: Divide the wireless sensor network into clusters according to the node software address number to obtain a cluster network structure, wherein the cluster network structure includes a cluster set and a cluster head node set;
[0036] Step S530: When the correction node is a cluster head node, perform time synchronization on each cluster head node in the cluster head node set;
[0037] Step S540: When the correction node is not a cluster head node, time synchronization is performed on the cluster nodes in the cluster set based on the RBS algorithm and the time-synchronized cluster head node set.
[0038] Furthermore, the step S530 of this application further includes the following: Time synchronization of each cluster head node in the cluster head node set.
[0039] Step S531: Obtain the synchronization signal initiation time T of the first cluster head node in the cluster head node set. i0 and signal transmission time T i1 ;
[0040] Step S532: Calculate and obtain the synchronization signal initiation time T i0 and the signal transmission time T i1 Time difference ΔT = T i1 -T i0 ;
[0041] Step S533: Based on the time difference, obtain the delay for one data packet transmission.
[0042] Step S534: Obtain the timestamp initiation information of the first cluster head node, wherein the timestamp initiation information includes the data packet transmission time T. i2 and the aforementioned delay t;
[0043] Step S535: Based on the timestamp initiation information, calculate the synchronization time T of the second cluster head node in the cluster head node set. i2 +t.
[0044] Furthermore, the step S540 of this application further includes the following: Time synchronization of nodes within the cluster set.
[0045] Step S541: Obtain time base information;
[0046] Step S542: When the time reference information is reached again, the cluster head node set sends beacon packets via broadcast;
[0047] Step S543: Based on the RBS algorithm and the beacon packets, perform time synchronization of the nodes within the cluster.
[0048] Specifically, if the calibration node is synchronizing for the first time, it is calibrated and synchronized based on the RBS algorithm. This involves identifying each light control node in the light control node information to obtain its software address number. Each node has both sending and receiving capabilities and its own software address. This software address is a unique identifier for the same wireless sensor network node; it cannot be repeated but can be modified. The software address numbers increase sequentially in a single direction to facilitate overall system control.
[0049] When there are many nodes and their coverage area is relatively wide, the wireless sensor network is first divided into clusters according to the node software address numbers to obtain a clustered network structure. This involves dividing the entire sensor network into clusters and assigning a cluster head. The clustered network structure includes a set of clusters and a set of cluster head nodes. For example, every ten software addresses of software nodes form a cluster, and the cluster head is the node with the middle number of software addresses. For instance, software addresses 1 to 10 form one cluster, node 5 is the cluster head, nodes 11 to 20 form another, and node 15 is the cluster head. This achieves a simple clustered network structure.
[0050] After dividing the entire network, the next step is to synchronize the time of each cluster head. When the correction node is a cluster head node, time synchronization is performed on all cluster head nodes in the cluster head node set. Cluster head synchronization uses a point-to-point synchronization method, and then a flood-like time synchronization algorithm is applied sequentially until all cluster heads are synchronized. The algorithm process is illustrated below using the synchronization process of two cluster head nodes. Node i is a cluster head node in network domain A, and node j is a cluster head node in network domain B. First, node i initiates a synchronization signal and records the time at that moment, thus obtaining the synchronization signal initiation time T of the first cluster head node i in the cluster head node set. i0 Then, after receiving this synchronization signal, node j will immediately send it back to node i. Let's assume that node i receives the data at time T. i1 That is, the signal transmission time T i1 The synchronization signal initiation time T is calculated. i0 and the signal transmission time T i1 Time difference ΔT = T i1 -T i0 ΔT is mainly caused by transmission delay, sending delay, and access delay. This error is equivalent to two identical processes, so we can consider the delay of one data packet transmission as ΔT / ΔT. Therefore, the first cluster head node i sends the timestamp information to node j again at this time. The timestamp initiation information includes the local time T when node i sends the data packet. i2 Based on the calculated delay t and the timestamp initiation information, the synchronization time T of the second cluster head node j in the cluster head node set is calculated. i2 +t enables synchronization between two nodes. Similarly, time synchronization is achieved by synchronizing node j with its adjacent cluster head nodes, eventually synchronizing all cluster head nodes.
[0051] When the calibration node is not a cluster head node, time synchronization of nodes within the cluster is performed. This intra-cluster time synchronization can refer to the RBS algorithm. Based on the RBS algorithm and the time-synchronized cluster head node set, time synchronization is performed on the intra-cluster nodes within the cluster set. Specifically, since a cluster belongs to a network domain and is within the communication range of the cluster head node, it is only necessary to implement time calibration in all cluster heads. Then, one node specifies a standard time for intra-cluster time synchronization. When this time reference is reached, all cluster head nodes will send beacon packets via broadcast, ensuring that the time of nodes within the cluster is synchronized. Because all cluster heads send beacon packets at the same time, network-wide time synchronization is achieved.
[0052] After dividing the network into clusters, synchronizing the time of the cluster heads of different clusters, and synchronizing the time within each cluster, the calibration nodes are calibrated and synchronized, and the calibration results are used as the synchronization time results, thus achieving time synchronization of the entire wireless sensor network. By optimizing the RBS algorithm for adaptability and applying synchronization time correction to the lighting control nodes, the nodes have the same time reference, improving time synchronization accuracy and meeting the requirements for node time error while also satisfying the limitations of time synchronization consumption.
[0053] Step S600: When the correction node is not the first synchronization, save the synchronization time error and calculate the average error.
[0054] Step S700: Perform time compensation based on the synchronization time result and the average error to achieve time synchronization of the lighting control nodes.
[0055] Furthermore, the time compensation based on the synchronization time result and the average error, step S700 of this application further includes:
[0056] Step S710: Obtain the unit node error based on the synchronization time result;
[0057] Step S720: Save the synchronization time error, and calculate the average error based on the unit node error;
[0058] Step S730: Obtain the unit node compensation time based on the average error and the synchronization time error Δt.
[0059] Step S740: Perform node time compensation based on the unit node compensation time.
[0060] Furthermore, in obtaining the unit node error, step S710 of this application further includes:
[0061] Step S711: Obtain the timestamp transmission time Tm of the first cluster head node after the transition time Tt;
[0062] Step S712: Based on the timestamp sending time and the synchronization time result, obtain the timestamp receiving time Tm+t of the second cluster head node;
[0063] Step S713: Obtain the local time Tn of the second cluster head node, and based on the local time and the timestamp received time, obtain the time drift |Δt|=|Tn-Tm|;
[0064] Step S714: The ratio of the time drift to the transition time is taken as the unit node error.
[0065] Specifically, when the calibration node is not synchronizing for the first time, i.e., after the system has been running for a long time, due to differences in node hardware and their environment, errors caused by clock skew and clock drift will increase the error between nodes in the network over time. To solve this problem, node time correction is necessary. Time correction is essentially compensating for the local time of the nodes. To compensate for node synchronization, it is necessary to save the synchronization time error and calculate the average error. Specifically, firstly, based on the synchronization time result, the unit node error is calculated. For example, after two nodes achieve synchronization, after a certain period of time (the transition time Tt), the two nodes exchange timestamp information, resulting in a time error σt1. Then, they synchronize again using the time synchronization algorithm, and after another time Tt, the two nodes have a time error σt2. Experiments show that σt1≈σt2. This is because once the nodes of a wireless sensor network are deployed, they do not easily change, and their external environment and hardware can be considered unchanged in a short period of time. Therefore, σt1 = σt2 can be approximated. Based on this, it can be assumed that if two nodes generate an error σt after a period of time Tt, then an error σt will also be generated in the next period of the same time Tt.
[0066] Assuming a time synchronization has already been performed once, and then after a period of time Tt, the first cluster head node i sends a timestamp to node j again at time Tm. Without clock drift, the second cluster head node j receives this timestamp at time Tm+t. However, at this moment, the local time of the second cluster head node j is Tn. Based on the local time and the timestamp reception time, the error between these two times is the time drift |Δt|=|Tn-Tm|. Therefore, this Δt can be used for time compensation. It can be known that the two nodes have incurred a total error of Δt during this period Tt. The ratio of the time drift to the transition time, i.e., the error between the two nodes per unit time, is taken as the unit node error. Therefore, local time compensation or reversal Δ can be applied to node j every unit of time.
[0067] The more precise the time error between the two nodes, the smaller the time error after time correction. Therefore, the time error obtained after each synchronization, i.e., the synchronization time error Δt, is saved. i The average error is calculated based on the unit node error. Based on the average error and the synchronization time error Δt, the compensation or reversal time Δt for the unit node time after n iterations is determined. n for: And based on the unit node compensation time Δ n By performing node time compensation, the time synchronization of lighting control nodes is achieved. The error generated after each synchronization is saved and then averaged to make the calculated error more accurate. This compensation mechanism effectively solves the time error caused by clock skew and clock drift, reducing the overall system time error, ensuring lighting control effect, and ultimately realizing intelligent and remote landscape lighting control.
[0068] In summary, the IoT-based lighting control node time synchronization method and system provided in this application have the following technical effects:
[0069] This technical solution achieves time synchronization of lighting control nodes by generating lighting control commands through a landscape lighting control terminal, obtaining information about the nodes to be controlled based on these commands, analyzing the initiating node information to determine the initiating node, traversing other nodes in the information of the nodes to be controlled based on the initiating node, and determining whether the correction node is synchronizing for the first time. If it is synchronizing for the first time, the correction node is synchronized based on the RBS algorithm to obtain the synchronization time result. If it is not synchronizing for the first time, the synchronization time error is saved and the average error is calculated. Time compensation is then performed based on the synchronization time result and the average error, thus achieving time synchronization of lighting control nodes. This optimizes the RBS algorithm for compatibility, applies synchronization time correction to lighting control nodes, ensures that nodes have the same time base, improves time synchronization accuracy, meets the requirements for node time error, and satisfies the limitations of time synchronization consumption, guaranteeing the lighting control effect. Ultimately, this achieves the technical effect of intelligent and remote landscape lighting control.
[0070] Example 2
[0071] Based on the same inventive concept as the IoT-based lighting control node time synchronization method in the foregoing embodiments, this invention also provides an IoT-based lighting control node time synchronization system, such as... Figure 4 As shown, the system includes:
[0072] Instruction generation module 11 is used to generate lighting control instructions through the landscape lighting control terminal;
[0073] The module 12 for obtaining the node to be controlled is used to obtain the information of the node to be controlled according to the light control command.
[0074] The initiating node determination module 13 is used to analyze the initiating node information of the node to be controlled and determine the lighting control initiating node;
[0075] Synchronization judgment module 14 is used to determine whether the correction node is the first synchronization based on the other nodes in the information of the node to be controlled, according to the light control initiating node;
[0076] The correction synchronization module 15 is used to perform correction synchronization on the correction node based on the RBS algorithm if the correction node is synchronizing for the first time, and obtain the synchronization time result.
[0077] Error calculation module 16 is used to save the synchronization time error and calculate the average error when the correction node is not the first synchronization.
[0078] The time compensation module 17 is used to perform time compensation based on the synchronization time result and the average error value to achieve time synchronization of the lighting control nodes.
[0079] Furthermore, the module for obtaining the node to be controlled also includes:
[0080] A control terminal unit is provided, wherein the landscape lighting control terminal includes a lighting control gateway and lighting control node information;
[0081] A sensor network building unit is used to build a wireless sensor network between the lighting control gateway and the lighting control node information;
[0082] A lighting control instruction generation unit is used to obtain a lighting effect file and generate the lighting control instruction based on the lighting effect file.
[0083] The file sending unit is used to send the lighting effect file to the node to be controlled via the wireless sensor network according to the lighting control command.
[0084] Furthermore, the correction synchronization module also includes:
[0085] The node identification unit is used to identify each lighting control node in the lighting control node information and obtain the node software address number.
[0086] The cluster partitioning unit is used to partition the wireless sensor network into clusters according to the node software address number to obtain a cluster network structure, wherein the cluster network structure includes a cluster set and a cluster head node set.
[0087] The cluster head time synchronization unit is used to synchronize the time of each cluster head node in the cluster head node set when the correction node is a cluster head node.
[0088] The intra-cluster node time synchronization unit is used to synchronize the intra-cluster nodes in the cluster set based on the RBS algorithm and the time-synchronized cluster head node set when the correction node is not a cluster head node.
[0089] Furthermore, the cluster head time synchronization unit also includes:
[0090] The cluster head time acquisition unit is used to obtain the synchronization signal initiation time T of the first cluster head node in the cluster head node set. i0 and signal transmission time T i1 ;
[0091] The time difference calculation unit is used to calculate and obtain the synchronization signal initiation time T. i0 and the signal transmission time T i1 Time difference ΔT = T i1 -T i0 ;
[0092] The transmission delay acquisition unit is used to obtain the delay of one data packet transmission based on the time difference.
[0093] The timestamp initiation information acquisition unit is used to obtain the timestamp initiation information of the first cluster head node, wherein the timestamp initiation information includes the data packet transmission time T. i2 and the aforementioned delay t;
[0094] The synchronization time calculation unit is used to calculate the synchronization time T of the second cluster head node in the cluster head node set based on the timestamp initiation information. i2 +t.
[0095] Furthermore, the intra-cluster node time synchronization unit also includes:
[0096] The time reference acquisition unit is used to acquire time reference information;
[0097] A beacon packet sending unit is used to send beacon packets via broadcast when the cluster head node set arrives again at the time reference information.
[0098] The node time synchronization unit is used to perform time synchronization of nodes within the cluster based on the RBS algorithm and the beacon packets.
[0099] Furthermore, the time compensation module also includes:
[0100] A unit node error acquisition unit is used to obtain the unit node error based on the synchronization time result;
[0101] An error average value acquisition unit is used to store the synchronization time error and calculate the error average value based on the unit node error.
[0102] The unit for obtaining unit node compensation time is used to obtain the unit node compensation time based on the average error and the synchronization time error Δt.
[0103] The node time compensation unit is used to perform node time compensation based on the unit node compensation time.
[0104] Furthermore, the unit node error acquisition unit also includes:
[0105] The timestamp transmission time acquisition unit is used to obtain the timestamp transmission time Tm of the first cluster head node after the transition time Tt.
[0106] The timestamp received time acquisition unit is used to obtain the timestamp received time Tm+t of the second cluster head node based on the timestamp sending time and the synchronization time result;
[0107] The time drift acquisition unit is used to obtain the local time Tn of the second cluster head node, and obtain the time drift |Δt|=|Tn-Tm| based on the local time and the timestamp received time;
[0108] The unit node error determination unit is used to take the ratio of the time drift to the transition time as the unit node error.
[0109] This application provides a time synchronization method for lighting control nodes based on the Internet of Things (IoT). The method includes: generating lighting control commands through a landscape lighting control terminal; obtaining information about nodes to be controlled based on the lighting control commands; analyzing the initiating node information of the nodes to be controlled to determine the lighting control initiating node; traversing other nodes in the information of nodes to be controlled based on the lighting control initiating node, and determining whether the correction node is the first synchronization; if the correction node is the first synchronization, performing correction synchronization on the correction node based on the RBS algorithm to obtain a synchronization time result; when the correction node is not the first synchronization, saving the synchronization time error and calculating the average error; and performing time compensation based on the synchronization time result and the average error to achieve time synchronization of the lighting control nodes. This solves the technical problem in existing technologies where different node time bases lead to synchronization time errors, affecting the lighting control effect. It achieves adaptability optimization of the RBS algorithm, performs synchronization time application correction on lighting control nodes, ensuring that nodes have the same time base, improving time synchronization accuracy, meeting the requirements for node time error while also meeting the limitations of time synchronization consumption, guaranteeing the lighting control effect, and thus realizing the technical effect of intelligent and remote landscape lighting control.
[0110] This specification and accompanying drawings are merely illustrative examples of this application. If any modifications and variations of this invention fall within the scope of this invention and its equivalents, this invention also intends to include such modifications and variations.
Claims
1. A time synchronization method for lighting control nodes based on the Internet of Things, characterized in that, The method includes: Lighting control commands are generated via the landscape lighting control terminal; Based on the lighting control command, obtain the information of the node to be controlled; The initiating node is analyzed based on the information of the node to be controlled to determine the lighting control initiating node; Based on the lighting control initiating node, traverse the other nodes in the information of the nodes to be controlled, and determine whether the correction node is synchronizing for the first time; If the correction node is synchronizing for the first time, the correction node is synchronizing based on the RBS algorithm to obtain the synchronization time result; When the correction node is not the first synchronization, save the synchronization time error and calculate the average error. Time compensation is performed based on the synchronization time result and the average error to achieve time synchronization of the lighting control nodes; The step of obtaining the information of the node to be controlled according to the lighting control command includes: The landscape lighting control terminal includes lighting control gateway and lighting control node information; A wireless sensor network is established between the lighting control gateway and the lighting control node information; Obtain the lighting effect file, and generate the lighting control command based on the lighting effect file; According to the lighting control command, the lighting control gateway sends the lighting effect file to the node to be controlled via the wireless sensor network; If the correction node is synchronizing for the first time, the correction node is synchronized based on the RBS algorithm, including: Each lighting control node in the lighting control node information is identified to obtain the node software address number; The wireless sensor network is divided into clusters according to the node software address number to obtain a cluster network structure, which includes a cluster set and a cluster head node set. When the correction node is a cluster head node, time synchronization is performed on each cluster head node in the cluster head node set. When the correction node is not a cluster head node, time synchronization is performed on the cluster nodes in the cluster set based on the RBS algorithm and the time-synchronized cluster head node set; The time synchronization of intra-cluster nodes in the cluster set includes: Obtain time reference information; When the time reference information is reached again, the cluster head node set sends beacon packets via broadcast. Time synchronization of nodes within the cluster is performed based on the RBS algorithm and the beacon packets.
2. The method as described in claim 1, characterized in that, The time synchronization of each cluster head node in the cluster head node set includes: Obtain the synchronization signal initiation time T of the first cluster head node in the cluster head node set. i0 and signal transmission time T i1 ; The synchronization signal initiation time T is calculated. i0 and the signal transmission time T i1 Time difference ΔT = T i1 -T i0 ; Based on the time difference, the delay for one data packet transmission is obtained as follows: Obtain the timestamp initiation information of the first cluster head node, wherein the timestamp initiation information includes the data packet transmission time T. i2 and the aforementioned delay t; Based on the timestamp initiation information, the synchronization time T of the second cluster head node in the cluster head node set is calculated. i2 +t.
3. The method as described in claim 2, characterized in that, The time compensation based on the synchronization time result and the average error includes: Based on the synchronization time results, the unit node error is obtained; The synchronization time error is saved, and the average error is calculated based on the unit node error. The unit node compensation time is obtained based on the average error and the synchronization time error Δt. Node time compensation is performed based on the unit node compensation time.
4. The method as described in claim 3, characterized in that, The process of obtaining the unit node error includes: Obtain the timestamp transmission time Tm of the first cluster head node after the transition time Tt; Based on the timestamp sending time and the synchronization time result, the timestamp receiving time Tm+t of the second cluster head node is obtained; Obtain the local time Tn of the second cluster head node, and based on the local time and the time the timestamp is received, obtain the time drift |Δt|=|Tn-Tm|; The ratio of the time drift to the transition time is taken as the unit node error.
5. A time synchronization system for lighting control nodes based on the Internet of Things, characterized in that, The system is used to perform the method according to any one of claims 1 to 4, the system comprising: The instruction generation module is used to generate lighting control instructions through the landscape lighting control terminal; The module for obtaining the node to be controlled is used to obtain information about the node to be controlled according to the light control command. The initiating node determination module is used to analyze the initiating node information of the node to be controlled and determine the lighting control initiating node. The synchronization judgment module is used to determine whether the correction node is synchronizing for the first time by traversing other nodes in the information of the node to be controlled based on the light control initiating node. The correction and synchronization module is used to perform correction and synchronization on the correction node based on the RBS algorithm if the correction node is synchronizing for the first time, and to obtain the synchronization time result. The error calculation module is used to save the synchronization time error and calculate the average error when the correction node is not the first synchronization. The time compensation module is used to perform time compensation based on the synchronization time result and the average error value to achieve time synchronization of the lighting control nodes.
Citation Information
Patent Citations
LED lamp time synchronization method
CN107819536A
Wireless sensor network consistency time synchronization method for reducing network traffic
CN107949047A