Disclosure of Invention
In order to overcome the defects of the prior art, the invention provides the data visual monitoring analysis control platform based on the tunnel lighting system of the Internet of things, and the invention can realize the integral and real-time visual presentation of all the vehicle passing processes and the tunnel equipment running conditions in the whole tunnel.
The invention is realized by the following technical scheme:
the system comprises a network layer, an application layer and a perception layer, wherein the application layer comprises a front end module and a back end module, the back end module is used for acquiring and processing metadata which is stored in a data warehouse and processed by the network layer, the data are displayed through a display screen, the front end module is used for judging a single-page double-tunnel according to a display data value returned by the back end module, the network layer adopts a Reactor thread model and is used for processing one or more service requests which are transmitted to a service processing program, the service processing program separates the incoming requests in a multiplexing mode and synchronously distributes the incoming requests to related request processing programs, the perception layer comprises a local controller, a single-lamp dimming controller, an illumination sensor, a traffic flow sensor and a gateway which are electrically connected, and the Reactor thread model is connected with the perception layer and is communicated with the application layer through websocket.
The network layer is used for converting the data of the illumination sensor, the traffic flow sensor and the application layer to finish data transmission.
The application layer is used for dimming, switching control and collecting, managing and monitoring the running state data of the single-lamp dimming controller.
The Reactor thread model registers the I/O event to be processed into an I/O multiplexer, the main thread loops through the multiplexer until the I/O event is ready, the multiplexer returns from the blocking position, and the ready I/O event is distributed to the event processor.
The Reactor thread model is used for decoupling the event processing and I/O connection module.
The Reactor thread model comprises a main Reactor group and a sub-Reactor group, and time-consuming business logic is processed through a business thread pool.
The main Reactor group is a Reactor and is used for monitoring the connection event of the equipment, when the connection event is generated, a corresponding equipment connection channel is created and initialized in a corresponding connection event processor, and then a Reactor registration is selected from the Reactor group in a load balancing mode, and the read-write event in the equipment connection channel is monitored.
The secondary Reactor group comprises a plurality of reactors, the reactors in the secondary Reactor group are used for monitoring the read-write events of the equipment, and each Reactor is responsible for monitoring a group of equipment connection.
The Reactor allocates an I/O thread, and the I/O thread is used for acquiring an I/O ready event from the Reactor, executing I/O call to acquire I/O data, and executing service logic processing codes of all processors in the pipeline.
The Reactor refers to event processing.
Websocket in the present invention refers to a protocol that performs full duplex communication over a single TCP connection.
The I/O refers to a computer interface, input/output.
The beneficial effects of the invention are mainly shown in the following aspects:
1. compared with the prior art, the invention adopts the invention conception of the technology of the Internet of things and the data visualization, and the vehicle passing through the tunnel is combined with the vehicle speed data to carry out the visualization processing, so that the whole and real-time visualization presentation of the passing process of all vehicles in the whole tunnel and the running condition of tunnel equipment can be realized.
2. According to the invention, the local controller, the single-lamp dimming controller, the illumination sensor, the traffic flow sensor and the gateway are connected to the network layer, and the real-time monitoring and tracking of the vehicles in the tunnel are realized by collecting the related data of the sensor devices in real time.
3. According to the invention, the real-time performance and reliability of platform monitoring data are greatly improved by applying the Reactor thread model on the network layer, accessing massive sensor equipment in the sensing layer and communicating with the application layer by using websocket.
4. According to the invention, the vehicle in the tunnel is combined with the vehicle speed data to perform visualization processing, so that the whole control platform can display the real-time change condition of the vehicle flow, the vehicle speed and the energy consumption data in the tunnel in a graphical mode.
5. The invention carries out early warning notification on the power failure and the traffic accident of the tunnel based on the real-time data uploaded by the illumination sensor, and can automatically issue control instructions to each single-lamp dimming controller according to the related parameters of the internal environment and the external environment of the tunnel and the preset control plan, thereby finally realizing the illumination linkage control in the tunnel.
6. According to the invention, the data analysis can be carried out on the illumination energy conservation of the tunnel according to the light state data, the traffic flow data and the illumination data uploaded by the illumination sensor, the energy conservation data of the tunnel in the corresponding time is calculated, the illumination intensity and the traffic flow change data curve of the tunnel are counted, and the data support is provided for the manager of the tunnel monitoring center to carry out relevant decisions.
7. The Reactor thread model is used for decoupling the event processing and I/O connection module, greatly improves the request concurrency, fully utilizes the CPU resource of the server side, does not participate in specific business logic, and has good reusability and expansibility.
8. The invention distributes an I/O thread, the I/O thread is used for obtaining I/O ready event from the Reactor, executing I/O call to obtain I/O data, and executing business logic processing codes of each processor in the pipeline.
Detailed Description
Example 1
Referring to fig. 1, the visual monitoring analysis control platform based on the tunnel lighting system data of the internet of things comprises a network layer, an application layer and a perception layer, wherein the application layer comprises a front end module and a back end module, the back end module is used for acquiring and processing metadata processed by the network layer and stored in a data warehouse, the data are displayed through a display screen, the front end module is used for judging a single-double-page tunnel according to a display data value returned by the back end module, the network layer adopts a Reactor thread model for processing one or more service requests which are transmitted to a service processing program in parallel, the service processing program separates the incoming requests in a multiplexing mode and synchronously distributes the separated requests to related request processing programs, and the perception layer comprises a local controller, a single-lamp dimming controller, an illumination sensor, a traffic flow sensor and a gateway which are electrically connected, and the Reactor thread model is connected with the perception layer and communicates with the application layer through websocket.
The embodiment is the most basic implementation mode, adopts the invention conception of the technology of the Internet of things and the data visualization, and performs the visualization processing on the vehicles passing through the tunnel by combining the speed data, so that the whole and real-time visualization presentation of all the vehicle passing processes and the tunnel equipment running conditions in the whole tunnel can be realized.
Example 2
Referring to fig. 1, the visual monitoring analysis control platform based on the tunnel lighting system data of the internet of things comprises a network layer, an application layer and a perception layer, wherein the application layer comprises a front end module and a back end module, the back end module is used for acquiring and processing metadata processed by the network layer and stored in a data warehouse, the data are displayed through a display screen, the front end module is used for judging a single-double-page tunnel according to a display data value returned by the back end module, the network layer adopts a Reactor thread model for processing one or more service requests which are transmitted to a service processing program in parallel, the service processing program separates the incoming requests in a multiplexing mode and synchronously distributes the separated requests to related request processing programs, and the perception layer comprises a local controller, a single-lamp dimming controller, an illumination sensor, a traffic flow sensor and a gateway which are electrically connected, and the Reactor thread model is connected with the perception layer and communicates with the application layer through websocket.
The network layer is used for converting the data of the illumination sensor, the traffic flow sensor and the application layer to finish data transmission.
The application layer is used for dimming, switching control and collecting, managing and monitoring the running state data of the single-lamp dimming controller.
The embodiment is a preferred implementation manner, and the network layer is connected with a local controller, a single-lamp dimming controller, an illumination sensor, a traffic flow sensor and a gateway, so that real-time monitoring and tracking of vehicles in the tunnel are realized by collecting relevant data of the sensor devices in real time.
Example 3
Referring to fig. 1, the visual monitoring analysis control platform based on the tunnel lighting system data of the internet of things comprises a network layer, an application layer and a perception layer, wherein the application layer comprises a front end module and a back end module, the back end module is used for acquiring and processing metadata processed by the network layer and stored in a data warehouse, the data are displayed through a display screen, the front end module is used for judging a single-double-page tunnel according to a display data value returned by the back end module, the network layer adopts a Reactor thread model for processing one or more service requests which are transmitted to a service processing program in parallel, the service processing program separates the incoming requests in a multiplexing mode and synchronously distributes the separated requests to related request processing programs, and the perception layer comprises a local controller, a single-lamp dimming controller, an illumination sensor, a traffic flow sensor and a gateway which are electrically connected, and the Reactor thread model is connected with the perception layer and communicates with the application layer through websocket.
The network layer is used for converting the data of the illumination sensor, the traffic flow sensor and the application layer to finish data transmission.
The application layer is used for dimming, switching control and collecting, managing and monitoring the running state data of the single-lamp dimming controller.
Further, the Reactor thread model registers the I/O event to be processed into an I/O demultiplexer, the main thread loops through the demultiplexer until the I/O event is ready, the demultiplexer returns from the blocking place, and the ready I/O event is distributed to the event processor.
In this embodiment, a Reactor thread model is applied to the network layer, so that massive sensor devices in the sensing layer are accessed, and websocket is used for communication with the application layer, so that the real-time performance and reliability of the platform monitoring data are greatly improved.
Example 4
Referring to fig. 1, the visual monitoring analysis control platform based on the tunnel lighting system data of the internet of things comprises a network layer, an application layer and a perception layer, wherein the application layer comprises a front end module and a back end module, the back end module is used for acquiring and processing metadata processed by the network layer and stored in a data warehouse, the data are displayed through a display screen, the front end module is used for judging a single-double-page tunnel according to a display data value returned by the back end module, the network layer adopts a Reactor thread model for processing one or more service requests which are transmitted to a service processing program in parallel, the service processing program separates the incoming requests in a multiplexing mode and synchronously distributes the separated requests to related request processing programs, and the perception layer comprises a local controller, a single-lamp dimming controller, an illumination sensor, a traffic flow sensor and a gateway which are electrically connected, and the Reactor thread model is connected with the perception layer and communicates with the application layer through websocket.
The network layer is used for converting the data of the illumination sensor, the traffic flow sensor and the application layer to finish data transmission.
The application layer is used for dimming, switching control and collecting, managing and monitoring the running state data of the single-lamp dimming controller.
The Reactor thread model registers the I/O event to be processed into an I/O multiplexer, the main thread loops through the multiplexer until the I/O event is ready, the multiplexer returns from the blocking position, and the ready I/O event is distributed to the event processor.
The Reactor thread model is used for decoupling the event processing and I/O connection module.
The Reactor thread model comprises a main Reactor group and a sub-Reactor group, and time-consuming business logic is processed through a business thread pool.
Further, the main Reactor group is a Reactor, and is used for monitoring a connection event of the device, when the connection event is generated, creating an initializing corresponding device connection channel in a corresponding connection event processor, selecting a Reactor from the Reactor group for registration in a load balancing manner, and monitoring a read-write event in the device connection channel.
In this embodiment, the vehicle passing through the tunnel is combined with the vehicle speed data to perform visualization processing, so that the whole control platform can display the real-time change condition of the vehicle flow, the vehicle speed and the energy consumption data in the tunnel in a graphical form.
Based on the real-time data uploaded by the illumination sensor, the tunnel power failure and tunnel traffic accidents are warned, and control instructions can be automatically issued to each single-lamp dimming controller according to the related parameters of the internal environment and the external environment of the tunnel and the preset control plans, so that the illumination linkage control in the tunnel is finally realized.
Example 5
Referring to fig. 1, the visual monitoring analysis control platform based on the tunnel lighting system data of the internet of things comprises a network layer, an application layer and a perception layer, wherein the application layer comprises a front end module and a back end module, the back end module is used for acquiring and processing metadata processed by the network layer and stored in a data warehouse, the data are displayed through a display screen, the front end module is used for judging a single-double-page tunnel according to a display data value returned by the back end module, the network layer adopts a Reactor thread model for processing one or more service requests which are transmitted to a service processing program in parallel, the service processing program separates the incoming requests in a multiplexing mode and synchronously distributes the separated requests to related request processing programs, and the perception layer comprises a local controller, a single-lamp dimming controller, an illumination sensor, a traffic flow sensor and a gateway which are electrically connected, and the Reactor thread model is connected with the perception layer and communicates with the application layer through websocket.
The network layer is used for converting the data of the illumination sensor, the traffic flow sensor and the application layer to finish data transmission.
The application layer is used for dimming, switching control and collecting, managing and monitoring the running state data of the single-lamp dimming controller.
The Reactor thread model registers the I/O event to be processed into an I/O multiplexer, the main thread loops through the multiplexer until the I/O event is ready, the multiplexer returns from the blocking position, and the ready I/O event is distributed to the event processor.
The Reactor thread model is used for decoupling the event processing and I/O connection module.
The Reactor thread model comprises a main Reactor group and a sub-Reactor group, and time-consuming business logic is processed through a business thread pool.
The main Reactor group is a Reactor and is used for monitoring the connection event of the equipment, when the connection event is generated, a corresponding equipment connection channel is created and initialized in a corresponding connection event processor, and then a Reactor registration is selected from the Reactor group in a load balancing mode, and the read-write event in the equipment connection channel is monitored.
The secondary Reactor group comprises a plurality of reactors, the reactors in the secondary Reactor group are used for monitoring the read-write events of the equipment, and each Reactor is responsible for monitoring a group of equipment connection.
The Reactor allocates an I/O thread, and the I/O thread is used for acquiring an I/O ready event from the Reactor, executing I/O call to acquire I/O data, and executing service logic processing codes of all processors in the pipeline.
The embodiment is an optimal implementation mode, and can perform data analysis on illumination energy conservation of the tunnel according to the light state data, the traffic flow data and the illuminance data uploaded by the illumination sensor, calculate energy conservation data of the tunnel in corresponding time, count illuminance and traffic flow change data curves of the tunnel, and provide data support for relevant decision making of a tunnel monitoring center manager.
The Reactor thread model is used for decoupling event processing and I/O connection modules, greatly improves request concurrency, fully utilizes CPU resources of a server side, does not participate in specific business logic, and has good reusability and expansibility.
The Reactor allocates an I/O thread, the I/O thread is used for acquiring an I/O ready event from the Reactor, executing I/O call to acquire I/O data and executing service logic processing codes of each processor in the pipeline, and the design of lock-free serialization can prevent multiple threads from concurrently executing I/O logic processing on the same connection, prevent thread safety problem, and maximize system throughput.
The principle of the invention is as follows:
in a traditional monitoring and early warning system, most of judgment triggering conditions of events are preset in advance, namely related event triggering conditions are hard coded at a server in advance, and if related data reach the triggering conditions, the related events are judged to be triggered. However, in the environment of the internet of things, the types of sensors of the devices are more, the geographical environment where the devices are located is complex, and whether the related remote sensing data trigger events or not often needs to be dynamically determined by combining various sensor data, the geographical positions and the time where the sensor data are located. For example, in the lighting dimming control system, traffic flow sensor devices arranged in a tunnel upload traffic flow data in real time, so that whether a traffic jam occurs in the current tunnel can be determined by uploading adjacent traffic flow sensor data, and the determination condition is not constant, but closely related to the variable parameters of the current time, the average vehicle speed and the vehicle type. In the conventional monitoring and early warning system, the service is restarted after each trigger condition change, so that the hard coding mode is heavy and inconvenient. The application layer strips the code from the event trigger rule information by using the event rule processor, extracts the event trigger rule information and stores the event trigger rule information into the database, and all subsequent event trigger conditions can configure related information through the imaging interface, so that event trigger condition data can be dynamically managed, and compared with a traditional mode, the event can be processed through the event rule processor more flexibly and conveniently.
The interface sliding tunnel panoramic image of the control platform can jump to the corresponding position of the tunnel, and the implementation process is as follows:
and calculating a proportional value between the tunnel length and the tunnel panorama according to the tunnel length and the tunnel panorama length, and controlling the tunnel sliding distance after calculating the panorama sliding through mouse pressing, moving and putting down events, and assigning a value to a scrollLeft for controlling a rolling event, wherein the scrollLeft refers to the width of a page hidden at the left side of a rolling bar when the page is rolled to the right side by the rolling bar.
The implementation method of the page equipment and the running light off of the running light is as follows:
s1, judging a single-double tunnel of a page according to a value returned by a rear end;
s2, restoring and displaying the equipment on the page according to the size, the number and the type of field equipment, wherein the equipment is respectively arranged at the left side, the right side and the middle of a tunnel, the position of the equipment in the x direction is used for positioning, the position is determined by circulating equipment, the length of the tunnel is determined according to the offset value of the equipment by using offset values returned by data of 30, and the length of the tunnel is determined by adding the offset value of the longest equipment to the distance between an inlet and an outlet of the tunnel;
s3, the types of the equipment are basic, emergency and enhanced, which type of lamp is judged according to the data field, and the wattage of the corresponding equipment and the type of the equipment are displayed on the page;
s4, realizing the position of the vehicle on the page: judging whether a car exists or not through webSocket pushing, pushing a piece of data by each car, processing the car into a plurality of groups of data by the car and the lane related information in which direction the car is, recording the current time of getting off the car in the data by each car, enabling the running of the car on a page through a timer, and enabling the running position of the car to be: firstly, circulating a vehicle, wherein a current time is added when the vehicle circulates, and the current position of the vehicle is the current time of the vehicle minus the speed of the vehicle when the vehicle is added;
s5, realizing lighting of the vehicle: finding out 600 pixels in front of the automobile, lighting the lamp at 200 pixel positions in back of the automobile, and recording the lighted device;
s6, realizing the turning-on and turning-off of the vehicle running light: whether the lamp lighting device is contained in the lamp watching device or not, the lamp is turned on if the lamp is contained in the lamp watching device, and the lamp is turned off if the lamp is not contained in the lamp watching device.
The effect of the vehicle on the page is that the distance of each travel is realized by the timer, when the browser is switched to other pages, the timer can travel very slowly to influence the distance of the vehicle, so that the accuracy of the distance of the vehicle travel can be effectively ensured by adding the current time when the vehicle enters the tunnel and subtracting the speed of the vehicle when the vehicle enters the tunnel from the current time.