Clock guarantee method and system for intelligent lighting system

文档序号:716598 发布日期:2021-04-16 浏览:32次 中文

阅读说明:本技术 一种用于智慧照明系统的时钟保障方法及系统 (Clock guarantee method and system for intelligent lighting system ) 是由 秦龙 于 2020-12-29 设计创作,主要内容包括:本发明提供一种用于智慧照明系统的时钟保障方法及系统,包括获取物联网平台的初始时钟并根据初始时钟对路灯集中控制器的时钟和回路控制器的时钟进行初始化;检测路灯运行时是否接收到物联网平台发送的心跳包;其中,心跳包包括时钟更新数据;若路灯运行时接收到物联网平台发送的心跳包,则分析时钟更新数据与集中控制器的当前时钟的第一误差是否大于第一阈值;若第一误差大于第一阈值,则校正集中控制器的时钟;若路灯运行时未接收到物联网平台发送的心跳包,则分析当前时钟与集中控制器最近一次更新的时钟的第二误差是否大于第二阈值;若第二误差大于第二阈值,则重启路灯并根据物联网平台的时钟重设路灯集中控制器的时钟和回路控制器的时钟。(The invention provides a clock guarantee method and a system for an intelligent lighting system, which comprises the steps of obtaining an initial clock of an Internet of things platform, and initializing a clock of a street lamp integrated controller and a clock of a loop controller according to the initial clock; detecting whether a heartbeat packet sent by an Internet of things platform is received or not when the street lamp runs; wherein the heartbeat packet includes clock update data; if the street lamp receives a heartbeat packet sent by the Internet of things platform during operation, whether a first error between clock updating data and a current clock of the centralized controller is larger than a first threshold value or not is analyzed; if the first error is larger than a first threshold value, correcting the clock of the centralized controller; if the heartbeat packet sent by the Internet of things platform is not received when the street lamp runs, whether a second error between the current clock and the clock updated last time by the centralized controller is larger than a second threshold value or not is analyzed; and if the second error is larger than a second threshold value, restarting the street lamp and resetting the clock of the street lamp centralized controller and the clock of the loop controller according to the clock of the Internet of things platform.)

1. A clock assurance method for an intelligent lighting system, comprising:

acquiring an initial clock of an Internet of things platform, and initializing a clock of a street lamp integrated controller and a clock of a loop controller according to the initial clock;

detecting whether a first heartbeat packet sent by the Internet of things platform is received or not when the street lamp runs; wherein the first heartbeat packet includes first clock update data;

if the street lamp receives a first heartbeat packet sent by the Internet of things platform during operation, whether a first error between the clock updating data and a current clock of the centralized controller is larger than a first threshold value or not is analyzed; if the first error is larger than a first threshold value, correcting the clock of the centralized controller according to the clock updating data;

if the street lamp does not receive the first heartbeat packet sent by the Internet of things platform during operation, analyzing whether a second error between the current clock and a clock updated by the centralized controller last time is greater than a second threshold value; and if the second error is larger than a second threshold value, restarting the street lamp and resetting the clock of the centralized controller and the clock of the loop controller according to the clock of the Internet of things platform.

2. The method of claim 1, further comprising:

after the clock initialization of the loop controller is completed, detecting whether a second heartbeat packet sent by the centralized controller is received; wherein the second heartbeat packet includes second clock update data;

and if the loop controller receives the second heartbeat packet, updating the clock of the loop controller according to the second clock updating data.

3. The method of claim 2, further comprising:

and if the loop controller does not receive the second heartbeat packet, reconnecting the centralized controller, and updating the clock of the loop controller according to the acquired clock data.

4. The method of claim 3, further comprising:

analyzing whether the loop controller is successfully connected with the centralized controller within a preset time period or not; and if the loop controller is not successfully connected with the integrated controller within a preset time period, resetting the loop controller.

5. The method of claim 2, wherein the second heartbeat packet is transmitted once in 5-10 minutes.

6. The method of claim 1, further comprising:

after the clock initialization of the loop controller is completed, timing is carried out through a set clock chip; and simultaneously, the loop controller updates the clock according to the clock data of the clock chip.

7. The method of claim 1, wherein the first heartbeat packet is transmitted once in 1-2 minutes.

8. A clock support system for an intelligent lighting system is characterized by comprising an Internet of things platform and a plurality of street lamps connected with the Internet of things platform; the street lamp comprises an integrated controller and a loop controller; the integrated controller is used for acquiring an initial clock of the Internet of things platform and initializing the clock of the integrated controller and the clock of the loop controller according to the initial clock;

the centralized controller is also used for detecting whether a first heartbeat packet sent by the Internet of things platform is received or not when the street lamp runs; wherein the first heartbeat packet includes first clock update data; if the street lamp receives a first heartbeat packet sent by the Internet of things platform during operation, whether a first error between the clock updating data and a current clock of the centralized controller is larger than a first threshold value or not is analyzed; if the first error is larger than a first threshold value, correcting the clock of the centralized controller according to the clock updating data;

the centralized controller is further configured to analyze whether a second error between the current clock and a clock updated by the centralized controller last time is greater than a second threshold value if a first heartbeat packet sent by the internet of things platform is not received; and if the second error is larger than a second threshold value, restarting the street lamp and resetting the clock of the centralized controller and the clock of the loop controller according to the clock of the Internet of things platform.

9. The clock assurance system of claim 8, further comprising a clock chip disposed within the loop controller; the clock chip is used for timing after the clock of the loop controller is initialized.

Technical Field

The invention relates to the technical field of intelligent illumination, in particular to a clock guarantee method and system for an intelligent illumination system.

Background

In wisdom lighting system, centralized control ware and loop controller need have the correct clock just can ensure correct street lamp switch, otherwise can appear the unusual switch condition of street lamp, turn on the light in daytime or turn off the light condition at night promptly. In actual operation, abnormal lamp turning on and off often occurs. The main reasons are as follows: 1) the clock of the integrated controller or the loop controller changes suddenly, if the 12 noon hour is changed into 0 pm hour, the lamp is turned on abnormally under the condition that the time is not corrected in time; 2) the integrated controller cannot be calibrated with the Internet of things platform for a long time when being offline, so that the integrated controller or the loop controller is in a clock error state to perform abnormal lamp switching; 3) the chip used at present is based on an ARM core, the chip is provided with an RTC circuit, and the RTC circuit can generate errors of sudden change of clock, for example, an STM32F4 series chip of ST company can generate the situation of sudden change of the RTC clock, and an AM335X series chip of TI company can also generate the situation of sudden change of the RTC clock. It is desirable to provide a solution to the problem of clock errors in the centralized controller and the loop controller.

Disclosure of Invention

The invention aims to provide a clock guarantee method and a clock guarantee system for an intelligent lighting system, which are used for achieving the technical effect of solving the problem of clock errors of an integrated controller and a loop controller.

In a first aspect, an embodiment of the present invention provides a clock guarantee method for an intelligent lighting system, including obtaining an initial clock of an internet of things platform, and initializing a clock of a centralized street lamp controller and a clock of a loop controller according to the initial clock;

detecting whether a first heartbeat packet sent by the Internet of things platform is received or not when the street lamp runs; wherein the first heartbeat packet includes first clock update data;

if the street lamp receives a first heartbeat packet sent by the Internet of things platform during operation, whether a first error between the clock updating data and a current clock of the centralized controller is larger than a first threshold value or not is analyzed; if the first error is larger than a first threshold value, correcting the clock of the centralized controller according to the clock updating data;

if the street lamp does not receive the first heartbeat packet sent by the Internet of things platform during operation, analyzing whether a second error between the current clock and a clock updated by the centralized controller last time is greater than a second threshold value; and if the second error is larger than a second threshold value, restarting the street lamp and resetting the clock of the centralized controller and the clock of the loop controller according to the clock of the Internet of things platform.

Further, the method further comprises: after the clock initialization of the loop controller is completed, detecting whether a second heartbeat packet sent by the centralized controller is received; wherein the second heartbeat packet includes second clock update data; and if the loop controller receives the second heartbeat packet, updating the clock of the loop controller according to the second clock updating data.

Further, the method further comprises: and if the loop controller does not receive the second heartbeat packet, reconnecting the centralized controller, and updating the clock of the loop controller according to the acquired clock data.

Further, the method further comprises: analyzing whether the loop controller is successfully connected with the centralized controller within a preset time period or not; and if the loop controller is not successfully connected with the integrated controller within a preset time period, resetting the loop controller.

Further, the second heartbeat packet is sent once in 5-10 minutes.

Further, the method further comprises: after the clock initialization of the loop controller is completed, timing is carried out through a set clock chip; and simultaneously, the loop controller updates the clock according to the clock data of the clock chip.

Further, the first heartbeat packet is sent once in 1-2 minutes.

In a second aspect, an embodiment of the present invention provides a clock support system for an intelligent lighting system, including an internet of things platform, an integrated controller, and a loop controller; the integrated controller is used for acquiring an initial clock of the Internet of things platform and initializing the clock of the integrated controller and the clock of the loop controller according to the initial clock;

the centralized controller is also used for detecting whether a first heartbeat packet sent by the Internet of things platform is received or not when the street lamp runs; wherein the first heartbeat packet includes first clock update data; if the street lamp receives a first heartbeat packet sent by the Internet of things platform during operation, whether a first error between the clock updating data and a current clock of the centralized controller is larger than a first threshold value or not is analyzed; if the first error is larger than a first threshold value, correcting the clock of the centralized controller according to the clock updating data;

the centralized controller is further configured to analyze whether a second error between the current clock and a clock updated by the centralized controller last time is greater than a second threshold value if a first heartbeat packet sent by the internet of things platform is not received; and if the second error is larger than a second threshold value, restarting the street lamp and resetting the clock of the centralized controller and the clock of the loop controller according to the clock of the Internet of things platform.

Furthermore, the clock guarantee system also comprises a clock chip arranged in the loop controller; the clock chip is used for timing after the clock of the loop controller is initialized.

The beneficial effects that the invention can realize are as follows: the clock guarantee method of the intelligent lighting system provided by the invention can calibrate the clock in time under the condition that the clock of the integrated controller and the loop controller suddenly changes, thereby solving the problem of clock error.

Drawings

In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments of the present invention will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.

Fig. 1 is a schematic flowchart of a clock support method for an intelligent lighting system according to an embodiment of the present invention;

fig. 2 is a schematic diagram of a clock support system topology for an intelligent lighting system according to an embodiment of the present invention.

Icon: 10-a clock support system; 100-an internet of things platform; 200-street lamps; 210-a centralized controller; 220-Loop controller.

Detailed Description

The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.

It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present invention, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.

Referring to fig. 1, fig. 1 is a schematic flow chart illustrating a clock securing method for an intelligent lighting system according to an embodiment of the present invention.

In wisdom lighting system, centralized control ware and loop controller need have the correct clock just can ensure correct street lamp switch, otherwise can appear the unusual switch condition of street lamp, turn on the light in daytime or turn off the light condition at night promptly. However, in actual operation, abnormal lamp switching often occurs, and the main reason is caused by the clock error problem of the centralized controller or the loop controller. Therefore, in order to solve the clock error problem, embodiments of the present invention provide a clock support method for an intelligent lighting system, which is described in the following.

Step S101, obtaining an initial clock of the platform of the Internet of things and initializing a clock of the integrated street lamp controller and a clock of the loop controller according to the initial clock.

In an embodiment, after the street lamp is built, the centralized controller in the street lamp can acquire an initial clock from the platform of the internet of things, and then the clock initializes the clock of the centralized controller and the clock of the loop controller.

Step S102, detecting whether a first heartbeat packet sent by the Internet of things platform is received or not when the street lamp runs; wherein the first heartbeat packet includes first clock update data.

In an embodiment, the clock of the centralized controller is initialized and then the heartbeat packet sent by the platform of the internet of things can be detected, and the heartbeat packet contains clock data of the platform of the internet of things. Illustratively, the heartbeat packet of the internet of things platform can be sent once in 1-2 minutes, and in this embodiment, once in 2 minutes is recommended.

Step S103, if a first heartbeat packet sent by the Internet of things platform is received when the street lamp runs, whether a first error between the clock updating data and a current clock of the centralized controller is larger than a first threshold value or not is analyzed; and if the first error is larger than a first threshold value, correcting the clock of the centralized controller according to the clock updating data.

In an embodiment, if the centralized controller receives a heartbeat packet sent by the internet of things platform when the street lamp operates, whether a first error between clock update data in the heartbeat packet and a current clock of the centralized controller is greater than a first threshold value or not is further analyzed, and if the first error is greater than the first threshold value, the clock of the centralized controller is corrected according to the clock update data.

For example, the value of the first threshold may be set to 1 minute. When the first error between the clock updating data in the heartbeat packet and the current clock of the centralized controller is more than 1 minute, the centralized controller corrects the clock of the centralized controller according to the clock updating data.

In an embodiment, after the clock initialization of the loop controller is completed, the loop controller may also detect whether a second heartbeat packet sent by the centralized controller is received; wherein the second heartbeat packet includes second clock update data; and if the loop controller receives the second heartbeat packet, updating the clock of the loop controller according to the second clock updating data. And if the loop controller does not receive the second heartbeat packet, the loop controller is reconnected with the centralized controller, and the clock of the loop controller is updated according to the acquired clock data.

Illustratively, the second heartbeat packet may be sent once in 5-10 minutes, with the present invention implementation choice set to be sent once in 10 minutes.

Further, the method further comprises: whether the loop controller is successfully connected with the integrated controller within a preset time period is analyzed; and if the loop controller is not successfully connected with the integrated controller within the preset time period, resetting the loop controller.

In the implementation process, if the loop controller is not successfully connected with the centralized controller within a preset time period, the loop controller resets to enable the clock of the loop controller to be recovered to the initial state.

104, if the first heartbeat packet sent by the internet of things platform is not received when the street lamp runs, analyzing whether a second error between the current clock and a clock updated by the centralized controller last time is greater than a second threshold value; and if the second error is larger than a second threshold value, restarting the street lamp and resetting the clock of the centralized controller and the clock of the loop controller according to the clock of the Internet of things platform.

In one embodiment, if the centralized controller does not receive the heartbeat packet sent by the internet of things platform when the street lamp operates, whether a second error between the current clock and a clock updated by the centralized controller last time is greater than a second threshold value is further analyzed; if the second error is larger than a second threshold value, restarting the street lamp by the centralized controller; and then clock data are acquired from the platform of the Internet of things again, and the clock of the centralized controller and the clock of the loop controller are reset according to the clock data.

For example, the value of the second threshold may be set to 1 hour. And if the second error between the current clock and the clock updated by the centralized controller last time is more than 1 hour, restarting the street lamp by the centralized controller, then acquiring clock data from the Internet of things platform again, and resetting the clock of the centralized controller and the clock of the loop controller according to the clock data.

In one embodiment, after the clock initialization of the loop controller is completed, whether a second heartbeat packet sent by the centralized controller is received is detected; wherein the second heartbeat packet includes second clock update data; and if the loop controller receives the second heartbeat packet, updating the clock of the loop controller according to the second clock updating data.

In one embodiment, the method further comprises: after the clock initialization of the loop controller is completed, timing is carried out through a set clock chip; and simultaneously, the loop controller updates the clock according to the clock data of the clock chip.

In the implementation process, after the clock initialization of the loop controller is completed, a clock chip can be arranged in the loop controller for timing, and if the loop controller is not connected with the centralized controller, the street lamp can be controlled to normally execute the illumination task according to the clock data in the clock chip; the normal work of street lamp also can be guaranteed under the condition that the centralized controller is off-line for a long time.

Referring to fig. 2, fig. 2 is a schematic diagram of a topology structure of a clock support system for an intelligent lighting system according to an embodiment of the present invention.

In an embodiment, the embodiment of the present invention further provides a clock support system 10 for an intelligent lighting system, including an internet of things platform 100, a centralized controller 210, and a loop controller 220; the centralized controller 210 is configured to obtain an initial clock of the internet of things platform 100 and initialize the clock of the centralized controller 210 and the clock of the loop controller 220 according to the initial clock;

the centralized controller 210 is further configured to detect whether a first heartbeat packet sent by the internet of things platform 100 is received when the street lamp runs; wherein the first heartbeat packet includes first clock update data; if the street lamp 200 receives a first heartbeat packet sent by the internet of things platform 100 during operation, analyzing whether a first error between clock update data and a current clock of the centralized controller 210 is greater than a first threshold value; if the first error is greater than the first threshold, the clock of the centralized controller 210 is corrected according to the clock update data.

For example, the value of the first threshold may be set to 1 minute. When the first error between the clock update data in the heartbeat packet and the current clock of the centralized controller 210 is greater than 1 minute, the centralized controller 210 corrects its own clock according to the clock update data.

The centralized controller 210 is further configured to, if a first heartbeat packet sent by the internet of things platform 100 is not received, analyze whether a second error between the current clock and a clock updated by the centralized controller 210 last time is greater than a second threshold; if the second error is greater than the second threshold, the street lamp 200 is restarted, and the clock of the centralized controller 210 and the clock of the loop controller 220 are reset according to the clock of the internet of things platform 100.

For example, the value of the second threshold may be set to 1 hour. If the second error between the current clock and the clock updated by the centralized controller 210 last time is greater than 1 hour, the centralized controller 210 restarts the street lamp 200, and then acquires the clock data from the internet of things platform 100 again, and resets the clock of the centralized controller 210 and the clock of the loop controller 220 according to the clock data.

Further, the clock support system 10 further includes a clock chip disposed in the loop controller 220; the clock chip is used for timing after the clock of the loop controller 220 is initialized.

In summary, the embodiment of the invention provides a clock guarantee method and system for an intelligent lighting system, including acquiring an initial clock of an internet of things platform, and initializing a clock of a centralized street lamp controller and a clock of a loop controller according to the initial clock; detecting whether a heartbeat packet sent by an Internet of things platform is received or not when the street lamp runs; wherein the heartbeat packet includes clock update data; if the street lamp receives a heartbeat packet sent by the Internet of things platform during operation, whether a first error between clock updating data and a current clock of the centralized controller is larger than a first threshold value or not is analyzed; if the first error is larger than a first threshold value, correcting the clock of the centralized controller; if the heartbeat packet sent by the Internet of things platform is not received when the street lamp runs, whether a second error between the current clock and the clock updated last time by the centralized controller is larger than a second threshold value or not is analyzed; if the second error is larger than a second threshold value, restarting the street lamp and resetting a clock of the street lamp integrated controller and a clock of the loop controller according to a clock of the Internet of things platform; the clock can be calibrated in time under the condition that the clock of the integrated controller and the loop controller suddenly changes, and the problem of clock errors is solved.

The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

9页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:时间修正方法、终端设备、电子设备及存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类