Background technique
Intelligent road-lamp is called Intelligent road lamp or wisdom street lamp, wisdom illumination, is using Internet of Things and cloud computing skill
Art carries out complete upgrading to city public lighting management system, realizes street lamp centralized management, O&M informationization, illumination intelligent.
The connected internet of Internet of Things, that is, object object, it passes through the communications such as Intellisense, identification technology and general fit calculation perception
Therefore technology is also referred to as the third wave that world information industry develops after computer, internet.With Internet of Things this
The it is proposed of one new concept, therefore, wisdom street lamp are the intelligent products of responsive message era development, it is to promote relaxing for illumination
Suitableization, hommization and intelligence turn to starting point, set LED illumination, information collection, information transmission, information publication, data processing and
A variety of technology of Internet of things such as control execution, by intensive city street lamp equipment, are built into efficient public administration net
Network.
From the point of view of current domestic development status, intelligent road-lamp still has very long stretch to walk, and intelligent road-lamp equipment is in state
It is interior fewer and fewer, and currently used Street lamps control strategy is more single, mainly uses timing controlled road lamp switch, this side
There is very big disadvantage in formula:Street lamp can not dynamically be controlled in real time, this will result in the switch time that cannot dynamically adjust street lamp,
Only not only causes energy waste by single timing controlled, be easy to cause road safety hidden danger.However city public lighting be with
The closely bound up important public infrastructure of urban life, China's city public lighting electricity consumption have accounted for national power generation total amount
5%!So saving electric energy from street lamp has very actual value.
It since current control strategy cannot achieve on-demand illumination, not only results in waste of resources, due illumination is also not achieved
Effect.
Summary of the invention
The purpose of the present invention is overcoming the deficiencies in the prior art, a kind of policy control side of road lamp system is provided
Method can realize the control to street lamp device high efficiency smart relatively inexpensively, realize the requirement illuminated on demand, securely and reliably.
According to technical solution provided by the invention, the policy control method of the road lamp system, including street lamp server with
And several street lamp devices being connect with the street lamp server;The policy control of street lamp server pair and the street lamp device being connect
Include the following steps:
Step 1, street lamp server carry out time calibration to the street lamp device connected, so that street lamp device and street lamp take
Business device time synchronization;
Step 2, street lamp server detect configuration file, and according to configuration file construction strategy name detected;Street lamp clothes
Device be engaged according to configuration file, by the strategy names created and corresponding street lamp device packet associated;
Step 3, street lamp server start configuration timer Timer1 according to configuration file, and in configuration timer Timer1
Start crawler when triggering, crawler obtains sunrise sunset data according to configuration file, and street lamp server is according to the sunrise sunset of acquisition
Data obtain sunrise sunset information, to determine tactful details corresponding with strategy names by sunrise sunset information;
Above-mentioned tactful details addition is associated with corresponding strategy names by step 4, street lamp server, is added by tactful details
When to corresponding strategy names, street lamp server starts tactful timer Timer2, and the strategy timer Timer2 is according to strategy
When the triggering of details, street lamp server can be made to be grouped to corresponding street lamp device and send working state control instruction, so that
All street lamp devices in street lamp device grouping are performed simultaneously corresponding working state control instruction.
The street lamp server is connect by connecting network with street lamp device, and the connection network includes connecting with street lamp device
The NB-IOT connect the and ONE-NET connecting with the street lamp server, the NB-IOT pass through ONE-NET and street lamp server
Communication.
The setting monitoring thread in street lamp server, to detect configuration file using the monitoring thread, when monitoring
When configuration file changes, street lamp server creates a new configuration timer according to configuration file, when new configuration timer
When triggering, street lamp server starts crawler, and crawler obtains required sunrise sunset data, street lamp according to the configuration file after variation
Server strategy according to defined in acquired sunrise sunset data modification configuration file and corresponding tactful details, and road
Modified strategy is associated with the street lamp device specified in configuration file and is grouped by lamp server;
Street lamp server makes tactful timer Timer2 and modified tactful details corresponding unanimously, with can to strategy
All street lamp devices under the street lamp device grouping of management synchronize regulation.
The street lamp server is when detecting configuration file, custom profile if it exists, then street lamp server executes
Custom profile, otherwise, street lamp server execute default configuration file.
Advantages of the present invention:It is integrated under conditions of no light sensation and GPS using existing technology, has merged the time
Synchronization mechanism, multichannel lamp apparatus are grouped, and corresponding strategy names are associated with according to street lamp device grouping, with configuration timer
Timer1 obtains network data to start crawler, is added to tactful details later, with tactful timer Timer2 come implementation strategy
Details, and the function that adjustment is carried out to street lamp device is realized according to modes such as data point reuses, and dynamic modification is matched
It sets, and comes into force, realization is ingenious, and the applicable range of method is wide, can reach and multichannel lamp apparatus can be realized without manually adjusting
Dynamic high-efficiency adjustment.
Specific embodiment
Below with reference to specific drawings and examples, the invention will be further described.
As depicted in figs. 1 and 2:In order to realize the control to street lamp device high efficiency smart relatively inexpensively, realize on-demand
The requirement of illumination, the present invention include street lamp server and several street lamp devices connecting with the street lamp server;Street lamp clothes
Business device pair includes the following steps with the policy control for the street lamp device being connect:
Step 1, street lamp server carry out time calibration to the street lamp device connected, so that street lamp device and street lamp take
Business device time synchronization;
Specifically, policy control is a dynamic adjustable strategies in intelligent road-lamp technology to control the skill of road lamp switch
Art scheme is to be tied street lamp device and internet platform based on computer technology, network communication technology and crawler technology
It closes, the adjustment of street lamp device is removed from so that the switch of street lamp is more effective by carrying out strategy configuration realization on platform
It manually adjusts, greatly reduces the waste of manpower, electric power.
Intelligent control is carried out to long-range street lamp device in order to realize, needs to have phase between street lamp device and street lamp server
Same temporal information needs Time Synchronization Mechanism, street lamp device to street lamp server when requesting in a fixed period
Between information, if street lamp device is different from street lamp server time, use street lamp server time, with ensure from street lamp take
Business device energy and street lamp device between message will not accidentally be handled and street lamp device correctly executes come from street lamp server instruction,
Street lamp server can correctly handle the request from street lamp device.When it is implemented, Time Synchronization Mechanism is with street lamp server
Subject to current time, street lamp device is requested in the fixed period to street lamp server sending time, and street lamp device is with street lamp service
Time of the time message that device is replied as current device.
In addition, the street lamp server is connect by connecting network with street lamp device, the connection network includes and street lamp
The NB-IOT of equipment connection and the ONE-NET connecting with the street lamp server, the NB-IOT pass through ONE-NET and street lamp
Server communication.In the embodiment of the present invention, when forming connection network using NB-IOT, ONE-NET, information biography can be effectively reduced
Defeated power consumption;Certainly, also Internet can be used to realize the connection between street lamp device and street lamp server for connection network, tool
Body, which can according to need, to be selected.
Step 2, street lamp server detect configuration file, and according to configuration file construction strategy name detected;Street lamp clothes
Device be engaged according to configuration file, by the strategy names created and corresponding street lamp device packet associated;
Specifically, in street lamp server memory in configuration file, after time synchronization, the detection of street lamp server initiation is matched
File and load are set, if being operated without custom profile using the configuration file of default, until there is customized match
File generation is set, when there is new custom profile, is then executed according to custom profile.
Information in configuration file includes the period in the corresponding geographical location of street lamp device grouping, crawler triggering, and
The data source to be obtained acquired in crawler (i.e. network address) and the grouping strategy name to be generated.
The grouping of multiple street lamp devices can be customized by the user, but recommend to carry out according to the geographical location of street lamp device
Grouping.Configuration file only one, relevant configuration information is arranged in user in the same configuration file.
Strategy names are that street lamp server is created according to configuration file;It can direct handle by configuration file construction strategy name
The grouping of street lamp device and strategy names are associated, and this corresponding relationship is saved in database, for satisfying the need later
All equipment uses same grouping strategy under the grouping of lamp apparatus.The association binding of grouping strategy is by configuration file
Attribute setting association come what is bound, the strategy names automatically generated are holding time information and corresponding operation, mainly
Comprising opening street lamp device and closing the temporal information of street lamp device, user can be added and be modified with manual editing.
Step 3, street lamp server start configuration timer Timer1 according to configuration file, and in configuration timer Timer1
Start crawler when triggering, crawler obtains sunrise sunset data according to configuration file, and street lamp server is according to the sunrise sunset of acquisition
Data obtain sunrise sunset information, to determine tactful details corresponding with strategy names by sunrise sunset information;
Specifically, it after configuration file comes into force, reads from having in strategy in configuration file with the presence or absence of in configuration file
Specified strategy names, if it is present continuing in next step, strategy names to be added if if it does not exist.It is needed since street lamp device is grouped
It wants associated strategy names to create, strategy names is associated with the grouping of corresponding street lamp device in the database now, i.e.,
It realizes and is associated with the strategy that corresponding street lamp device is grouped, so that street lamp device all under the grouping of corresponding street lamp device will
This strategy is executed, eliminates and identical operation is carried out one by one to multiple street lamp devices, realize while large batch of street lamp is set
It is standby to carry out universal remote control.
Above-mentioned tactful details addition is associated with corresponding strategy names by step 4, street lamp server, is added by tactful details
When to corresponding strategy names, street lamp server starts tactful timer Timer2, and the strategy timer Timer2 is according to strategy
When the triggering of details, street lamp server can be made to be grouped to corresponding street lamp device and send working state control instruction, so that
All street lamp devices in street lamp device grouping are performed simultaneously corresponding working state control instruction.
In the embodiment of the present invention, after street lamp device grouping is associated with strategy names, need to carry out details to strategy names to match
It sets, that is, needs to start a configuration timer Timer1, utilize crawler technology from net after configuration timer Timer1 triggering
The network data of the sunrise sunset information in street lamp device location, countermeasure after street lamp server is analyzed and processed are crawled on network
The slightly corresponding tactful details of name are adjusted, and add tactful details, and start tactful timer Timer2.In tactful timer
When Timer2 is triggered, the corresponding working state control instruction of strategy names is issued to the road under street lamp device is grouped by street lamp server
Lamp apparatus can be realized remotely, uniformly, dynamically manage to the progress of high-volume street lamp device at this time.Work state control instruction packet
It includes to information such as the opening times, shut-in time or operating brightness of street lamp device.
For the equipment of different location, crawler is needed to crawl the corresponding sunrise sunset information network data in equipment location,
The location information for crawler just being needed to crawl can specify manually, so that the strategy of grouping belonging to street lamp device is to street lamp device
Regulation it is more accurate, energy-saving effect is more preferably.
Crawler is a kind of existing technology for obtaining Internet resources;It can according to the sunrise sunset information server that crawler obtains
Dynamically to create and modify tactful details, all street lamp devices are adjusted according to associated strategy names under street lamp device grouping
The effective storage life that equipment can be increased avoids using in vain, and the unnecessary manual operation of waste
Work as prison in addition, monitoring thread is arranged in street lamp server to detect configuration file using the monitoring thread
When the configuration file of survey changes, street lamp server creates a new configuration timer according to configuration file, when new configuration is fixed
When device trigger when, street lamp server start crawler, crawler according to after variation configuration file obtain needed for sunrise sunset data,
Street lamp server strategy according to defined in acquired sunrise sunset data modification configuration file and corresponding tactful details,
And modified strategy is associated with the street lamp device specified in configuration file and is grouped by street lamp server;
Street lamp server makes tactful timer Timer2 and modified tactful details corresponding unanimously, with can to strategy
All street lamp devices under the street lamp device grouping of management synchronize regulation.
The present invention is integrated under conditions of no light sensation and GPS using existing technology, and time synchronization machine has been merged
System, multichannel lamp apparatus is grouped, and corresponding strategy names are associated with according to street lamp device grouping, with configuration timer Timer1
Network data is obtained to start crawler, is added to tactful details later, with tactful timer Timer2 come implementation strategy details, and
The function of carrying out adjustment to street lamp device, and dynamic modification configuration are realized according to modes such as data point reuses, are existed side by side
It comes into force, realization is ingenious, and the applicable range of method is wide, can reach without manually adjusting the dynamic height that multichannel lamp apparatus can be realized
Effect adjustment.