Monitoring method, device, computer equipment and storage medium for lighting street lamps
By configuring the sensor array and Kafka Connect/Kafka Streams processing platform, the problem of heterogeneous data integration and real-time energy optimization in the lighting street light monitoring system is solved, efficient data management and real-time brightness adjustment are achieved, and the energy efficiency and publicity of the system are improved. Security.
Patent Information
- Application Number
- CN202410734436.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-06-07
AI Technical Summary
Existing lighting street light monitoring systems have difficulties in processing large amounts of heterogeneous data and real-time energy optimization, especially the challenges of data management integration and real-time data processing.
Configure a sensor array to collect light intensity and traffic flow data, perform format unification and verification processing through Kafka Connect, send it to the Apache Kafka stream processing platform, use Kafka Streams for offload processing and real-time analysis, generate real-time instructions for adjusting street light brightness, and pass Kafka Connect feeds back to street lights.
It achieves efficient integration and real-time processing of large amounts of heterogeneous data, optimizes energy use, improves the system's response speed and energy efficiency, and ensures public safety.
Smart Images

Figure CN118317494B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a monitoring method, device, computer equipment and storage medium for lighting street lamps. Background Art
[0002] Lighting street lamp monitoring and analysis is usually part of a city's intelligent lighting system, which uses sensors, control systems, and communication networks to monitor and control street lamps. Intelligent lighting systems can automatically adjust brightness and optimize according to weather conditions, time of day, or changes in traffic flow. These systems help city managers optimize energy use, reduce maintenance costs, and improve public safety by collecting and analyzing data.
[0003] There are some significant deficiencies in the monitoring and analysis technology of lighting street lamps, which mainly involve problems in data management integration and energy optimization. First, since the monitoring system involves a large amount of heterogeneous data, including energy consumption, status and environmental data, these data sources are diverse and the format is not uniform. With the increase in monitoring equipment, the amount of data has increased dramatically, and how to efficiently process and analyze these big data in real time has become a major technical challenge. Secondly, in terms of energy optimization, it is necessary to dynamically adjust the brightness of street lamps according to different time periods, weather conditions and traffic flow to ensure that sufficient lighting is provided while achieving maximum energy savings, which is difficult in technical implementation. Summary of the invention
[0004] The main purpose of the present invention is to provide a monitoring method, device, computer equipment and storage medium for lighting street lamps to solve the difficulties in integrating and managing a large amount of heterogeneous data in existing lighting street lamp monitoring systems, as well as the difficulties in optimizing energy in real time according to environmental and traffic changes.
[0005] To achieve the above-mentioned purpose, the present invention provides a monitoring method for lighting street lamps, the monitoring method comprising: configuring a sensor array for the lighting street lamp, and collecting data for the lighting street lamp based on the sensor array, and sending the collected initial data to Kafka Connect; receiving the initial data sent by the sensor array of each lighting street lamp through Kafka Connect, and performing format unification and verification processing on the initial data to obtain target data, and transmitting the target data to the Apache Kafka stream processing platform in the form of a real-time stream; performing shunt processing on each of the target data through Kafka Streams in the Apache Kafka stream processing platform, and obtaining at least first shunt data for real-time analysis; determining the lighting street lamp corresponding to the first shunt data by using the Kafka Streams, and determining the preset analysis strategy corresponding to the lighting street lamp, and performing data analysis on the first shunt data by using the preset analysis strategy to obtain a real-time instruction for adjusting the brightness of the lighting street lamp; sending the real-time instruction to the lighting street lamp through the Kafka Connect, so that the lighting street lamp adjusts the lighting brightness in response to the real-time instruction.
[0006] Optionally, the sensor array includes multiple sensors, the multiple sensors include at least photosensors and geomagnetic sensors, and the initial data includes at least light intensity data and traffic flow data; the sensor array is configured for the lighting street lamp, and data is collected for the lighting street lamp based on the sensor array, and the collected initial data is sent to Kafka Connect, including: configuring photosensors and geomagnetic sensors on the corresponding areas of the lighting street lamp; collecting the light brightness of the surrounding environment of the lighting street lamp in real time through the photosensor to obtain the light intensity data of the lighting street lamp; collecting the traffic flow in the corresponding area of the lighting street lamp in real time through the geomagnetic sensor to obtain the traffic flow data of the lighting street lamp; respectively encapsulating the light intensity data and the traffic flow data into data packets in a standard format, wherein the data packets in the standard format include: a timestamp and a lighting street lamp identifier; and using a wireless module to send the initial data to the Kafka Connect.
[0007] Optionally, initial data sent by the sensor array of each lighting street lamp is received through Kafka Connect, and the initial data is formatted and verified to obtain target data, and the target data is transmitted to the Apache Kafka stream processing platform in the form of a real-time stream, including: receiving the data packets sent by the sensor array through multiple Kafka Connects, wherein data packets of the same type of sensor are received by the same Kafka Connect, and the configuration file of the KafkaConnect defines the data type and data source received by the Kafka Connect; converting the received data packet into JSON format through a converter configured in the Kafka Connect; and verifying the integrity and accuracy of the received data packet through a verifier configured in the KafkaConnect; using the Kafka Connect to determine that the data packet after format unification and verification is the target data packet, and sending the target data packet as the target data to the Apache Kafka stream processing platform in the form of a real-time data stream.
[0008] Optionally, each of the target data is diverted through Kafka Streams in the Apache Kafka stream processing platform to obtain first diverted data for real-time analysis, including: using the KafkaStreams to receive the target data packet sent by the Kafka Connect, performing Boolean diversion processing on the target data packet to obtain at least the first diverted data, wherein the first diverted data includes: light intensity data and vehicle flow data.
[0009] Optionally, determine a preset analysis strategy corresponding to the lighting street lamp, use the preset analysis strategy to perform data analysis on the first diversion data, and obtain real-time instructions for adjusting the brightness of the lighting street lamp, including: based on the lighting street lamp corresponding to the first diversion data, call the preset stream processing function built into the Kafka Streams, and the preset stream processing function is configured one-to-one with the lighting street lamp; use the preset stream processing function as the preset analysis strategy for the first diversion data, perform real-time calculation on the first diversion data, and obtain the light intensity value after weight assignment and the traffic flow value after weight assignment; based on the light intensity value after weight assignment and the traffic flow value after weight assignment, combined with the preset basic brightness value of the street lamp, obtain the target brightness value of the street lamp; based on the target brightness value of the street lamp, generate a real-time instruction for adjusting the brightness of the lighting street lamp.
[0010] Optionally, the initial data also includes: street lamp energy consumption data of the lighting street lamp, as well as temperature and humidity data and air pressure data. Each of the target data is diverted through Kafka Streams in the Apache Kafka stream processing platform to obtain at least first diverted data for real-time analysis, and also includes: obtaining second diverted data for in-depth analysis, wherein the second diverted data includes: light intensity data, vehicle flow data, street lamp energy consumption data, temperature and humidity data and air pressure data.
[0011] Furthermore, after obtaining the second diversion data, the monitoring method also includes: sending the preset analysis strategy and the second diversion data of each lighting street lamp to the Hadoop distributed data processing platform for storage through the KafkaConnect; retrieving the stored second diversion data and preset analysis strategy of each lighting street lamp for analysis at preset time intervals through the Hadoop distributed data processing platform, and using the second diversion data to adjust the preset analysis strategy to obtain a target analysis strategy for each lighting street lamp; receiving the target analysis strategy of each lighting street lamp sent by the Hadoop distributed data processing platform through the Kafka Connect, and using the target analysis strategy to update the preset analysis strategy corresponding to each lighting street lamp stored in the Kafka Streams, wherein the target analysis strategy enables the energy consumption data of the lighting street lamp in the future time period to meet preset conditions.
[0012] Optionally, the preset analysis strategy and the second diversion data of each lighting street lamp are sent to the Hadoop distributed data processing platform for storage through the Kafka Connect, including: converting the preset analysis strategy and the second diversion data into Parquet format through the Kafka Streams; and using Apache Flume to transmit the preset analysis strategy and the second diversion data to the Hadoop distributed data processing platform for storage.
[0013] Optionally, the preset analysis strategy is adjusted using the second diversion data to obtain a target analysis strategy for each lighting street lamp, including: deploying Apache Spark on the Hadoop distributed data processing platform, and building a random forest regression prediction model in the Apache Spark; inputting the second diversion data and the preset analysis strategy of each lighting street lamp into the random forest regression prediction model for analysis, and obtaining an output target analysis strategy for each lighting street lamp.
[0014] The present invention also provides a monitoring device for a lighting street lamp, the monitoring device comprising: a collection unit, used to configure a sensor array for the lighting street lamp, and based on the sensor array, perform data collection on the lighting street lamp, and send the collected initial data to Kafka Connect; a transmission unit, used to receive the initial data sent by the sensor array of each lighting street lamp through Kafka Connect, and perform format unification and verification processing on the initial data to obtain target data, and transmit the target data to the Apache Kafka stream processing platform in the form of a real-time stream; a shunt unit, used to perform shunt processing on each of the target data through Kafka Streams in the Apache Kafka stream processing platform, and at least obtain first shunt data for real-time analysis; an analysis unit, used to determine the lighting street lamp corresponding to the first shunt data by using the Kafka Streams, and determine the preset analysis strategy corresponding to the lighting street lamp, and perform data analysis on the first shunt data by using the preset analysis strategy to obtain a real-time instruction for adjusting the brightness of the lighting street lamp; a sending unit, used to send the real-time instruction to the lighting street lamp through the Kafka Connect, so that the lighting street lamp adjusts the lighting brightness in response to the real-time instruction.
[0015] The present invention also provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.
[0016] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned methods are implemented.
[0017] The monitoring method, device, computer equipment and storage medium of lighting street lamps provided by the present invention collect key environmental data such as light intensity and traffic flow in real time by configuring sensors on lighting street lamps, and send them to the Apache Kafka stream processing platform through Kafka Connect. On the platform, the data is processed by Kafka Streams and divided into at least two data streams, wherein the first diversion data is used for real-time analysis to generate instructions for adjusting the brightness of the street lamps. These instructions are fed back to the street lamps through KafkaConnect to achieve real-time adjustment of the brightness. The present invention can process a large number of data streams in real time through the Kafka architecture, optimize energy use and improve system response speed, and effectively solve the problem of heterogeneous data integration and real-time data processing challenges. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 1 is a schematic diagram of steps of a method for monitoring a lighting street lamp in one embodiment of the present invention;
[0019] Figure 2 It is a structural framework diagram of a monitoring device for lighting street lamps in one embodiment of the present invention;
[0020] Figure 3 It is a schematic block diagram of the structure of a computer device according to an embodiment of the present invention.
[0021] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0023] Reference Figure 1 , an embodiment of the voltage compensation method of the inverter in the embodiment of the present application includes:
[0024] S1, configuring a sensor array for a street lamp, collecting data from the street lamp based on the sensor array, and sending the collected initial data to Kafka Connect.
[0025] It should be noted that Kafka Connect is a component of Apache Kafka, which is specifically used to efficiently import and export data between different systems and databases and supports large-scale distributed data integration.
[0026] Specifically, the first task of the lighting street lamp monitoring method is to configure a set of multifunctional sensors for each street lamp. These sensors are responsible for collecting various data about the street lamp and its surrounding environment, including but not limited to light intensity and traffic flow. The configured sensors may include photosensitive sensors for measuring light intensity; traffic monitors, such as geomagnetic or infrared sensors, for counting the number of vehicles passing through the street lamp area. The data collected by these sensors are initial data, which will be sent to the back-end data processing platform via a wireless network in real time. In this step, the data is first collected by the configured sensors. Once the data is collected, they will be sent to Kafka Connect, which is an extensible tool for importing data streams from multiple sources into Apache Kafka. In Kafka Connect, the data is first formatted and preliminarily verified to ensure that the data transmitted to the Kafka stream processing platform is accurate and consistent.
[0027] S2, receiving the initial data sent by the sensor array of each lighting street lamp through Kafka Connect, and performing format unification and verification processing on the initial data to obtain target data, and transmitting the target data to the Apache Kafka stream processing platform in the form of real-time stream.
[0028] It should be noted that Apache Kafka is a distributed stream processing platform that can efficiently process large amounts of data streams and support real-time processing and analysis of data.
[0029] Specifically, this step is a key stage of data processing in the lighting street lamp monitoring method, which is responsible for receiving and preprocessing the initial data from each street lamp sensor. In this step, the initial data sent by the sensor array of each street lamp is first received through Kafka Connect as the middleware. The received data must first be formatted (for example: JSON format) and validated. Format unification ensures that the data collected from different sensors and different locations follow the same data format, which is convenient for subsequent data processing and analysis. Validation processing is to check the integrity and accuracy of the data and filter out possible errors or invalid data. After completing these processes, the target data is transmitted to the Apache Kafka stream processing platform in the form of a real-time stream.
[0030] In other words, by unifying the format, Kafka Connect ensures that data from different sources has the same format before entering the stream processing platform. This is crucial for processing data in large-scale distributed systems because it simplifies subsequent data processing and analysis steps. The data verification link can effectively identify and eliminate errors and noise that may occur during data transmission, such as abnormal data generated by sensor failure. This ensures that the data entering the analysis process is accurate and reliable, and improves the accuracy of decision-making. Using Kafka Connect to transmit data to the processing platform in the form of real-time streams greatly reduces the delay in data processing. Real-time performance is crucial in smart lighting systems because it is directly related to the system's response speed to environmental changes. Kafka Connect supports collecting data from multiple data sources and can flexibly expand to handle more data inputs. This facilitates future upgrades of the system, making it easier to add new sensors or expand system functions.
[0031] S3, performing stream processing on each of the target data through Kafka Streams in the Apache Kafka stream processing platform to obtain at least first stream data for real-time analysis.
[0032] It should be noted that Kafka Streams is a library of Apache Kafka that enables Kafka to directly process data streams and realize real-time analysis and processing of data.
[0033] Specifically, Kafka Streams is used to divert the target data received from Kafka Connect, which can be divided into at least two categories: one is data for real-time analysis (first diversion data), which usually includes data that is more sensitive to immediate response, such as light intensity and traffic flow; the other is data that may need in-depth analysis or storage (second diversion data), which includes more comprehensive data types, such as energy consumption data, environmental and meteorological conditions, etc. This step is a key link in achieving data processing automation and real-time response. First, using Kafka Streams for diversion processing enables more refined management of data flow, and can optimize processing according to the nature and purpose of different data, which helps to improve processing efficiency and reduce unnecessary resource consumption. Second, real-time analysis of streaming data enables the system to quickly respond to changes in the external environment. For example, when traffic density increases or light intensity decreases, the system can quickly respond to adjust the brightness of street lights, which improves the efficiency of energy use and the adaptability of the street light system. Finally, by accurately controlling the data flow, Kafka Streams supports highly customized data processing strategies, provides reliable data support for subsequent data decisions and applications, and enhances the intelligence level of the entire lighting system.
[0034] S4, using the Kafka Streams to determine the lighting street lamp corresponding to the first diversion data, and determine a preset analysis strategy corresponding to the lighting street lamp, using the preset analysis strategy to perform data analysis on the first diversion data, and obtain real-time instructions for adjusting the brightness of the lighting street lamp.
[0035] This step is the core analysis phase of the lighting streetlight monitoring method, and it is performed using the Kafka Streams component of Apache Kafka. In this step, the first diversion data obtained from S3, containing key real-time environmental parameters such as light intensity and traffic flow, is used to directly affect the brightness adjustment of streetlights. First, Kafka Streams determines the specific lighting streetlights corresponding to these data, and sets preset analysis strategies based on the location and environment of each lighting streetlight. These strategies are based on data-driven decision models. By analyzing light and traffic data, the system can intelligently decide whether the brightness of the streetlight needs to be adjusted and to what extent.
[0036] The design of this step brings significant advantages to the lighting system, mainly in three aspects: By processing and analyzing environmental data in real time, the system can quickly respond to changes in external conditions, such as increasing brightness when it gets dark or increasing brightness during peak traffic hours, to ensure the efficiency of the street light system and public safety. The integrated intelligent analysis strategy enables the system to consider energy efficiency and reduce energy consumption while ensuring optimal lighting. This optimization is dynamic and adjusted according to actual conditions, rather than a fixed preset value. The control strategy of each street light can be customized according to its specific location and specific needs, providing extremely high flexibility. For example, the lighting level around the school is higher and a higher brightness lighting brightness is required.
[0037] S5, sending the real-time instruction to the street lamp through the Kafka Connect, so that the street lamp adjusts the lighting brightness in response to the real-time instruction.
[0038] In this step, through the rapid transmission and execution of real-time instructions, street lamps can respond immediately to environmental changes, such as quickly adjusting the brightness when the light suddenly decreases or the traffic volume increases. This not only improves the response speed of the street lamp system, but also improves the safety of the road. Real-time brightness adjustment helps to ensure that energy conservation is maximized while providing necessary lighting. This fine-grained regulation can significantly reduce energy consumption and energy waste. The use of KafkaConnect ensures high reliability of data transmission and overall stability of the system, reduces the possibility of communication failures, and ensures that each instruction can be accurately executed.
[0039] In summary, the lighting street lamp monitoring method of the present invention provides an innovative solution to the difficulties of heterogeneous data integration and management in existing systems and the challenges of real-time energy optimization. By configuring multiple sensors on lighting street lamps, the method can collect key environmental data such as light intensity and traffic flow in real time, which are sent through KafkaConnect to ensure timely transmission and preliminary processing of data. Utilizing the efficient data stream processing capabilities of Apache Kafka, the system can not only process large amounts of data streams in real time, but also ensure the speed and accuracy of data processing through its low latency and high throughput characteristics.
[0040] After the data is formatted and verified in Kafka Connect, it is sent to the Apache Kafka stream processing platform, where it is further diverted and processed through Kafka Streams. During this process, the system divides the data into at least two streams based on the type and urgency of the data, where the first diverted data is used for instant analysis to generate real-time instructions for adjusting the brightness of street lights. These instructions are then returned to the corresponding lighting street lights through Kafka Connect to achieve automatic adjustment of the light brightness. This move not only responds to instant changes in the environment and traffic, but also greatly improves the efficiency of energy use.
[0041] In summary, the present invention effectively solves the integration problem of heterogeneous data and the challenge of real-time data processing by integrating advanced data processing and stream processing technologies, ensures the intelligence and automation of the lighting system, and greatly improves the energy efficiency and public safety of the system. This technical solution provides a reliable, efficient and easily scalable monitoring solution for urban lighting systems, showing excellent technical effects and application prospects.
[0042] It should be noted that Apache Kafka is used to efficiently process large amounts of data streams and can provide high-throughput and low-latency data transmission services, making it suitable for real-time data stream processing applications.
[0043] In one example, the sensor array includes multiple sensors, the multiple sensors include at least photosensors and geomagnetic sensors, and the initial data includes at least light intensity data and traffic flow data; the sensor array is configured for the lighting street lamp, and data is collected for the lighting street lamp based on the sensor array, and the collected initial data is sent to Kafka Connect, including: configuring photosensors and geomagnetic sensors on the corresponding areas of the lighting street lamp; collecting the light brightness of the surrounding environment of the lighting street lamp in real time through the photosensor to obtain the light intensity data of the lighting street lamp; collecting the traffic flow in the corresponding area of the lighting street lamp in real time through the geomagnetic sensor to obtain the traffic flow data of the lighting street lamp; respectively encapsulating the light intensity data and the traffic flow data into data packets in a standard format, wherein the data packets in the standard format include: a timestamp and a lighting street lamp identifier; and using a wireless module to send the initial data to the Kafka Connect.
[0044] This technical solution realizes real-time monitoring of light intensity and traffic flow by configuring light-sensitive sensors and geomagnetic sensors for lighting street lamps. The collected data is encapsulated into a standard format data packet containing a timestamp and lighting street lamp identification, and transmitted to Kafka Connect through a wireless module. This configuration allows the system to unify the format and verify the data immediately after collection, and then perform efficient stream processing through Apache Kafka. Such processing not only improves the efficiency of data management, but also optimizes lighting control based on real-time environmental changes, such as adjusting the brightness of street lamps according to weather changes and traffic flow, thereby improving energy efficiency and enhancing public safety.
[0045] In one example, initial data sent by a sensor array of each lighting street lamp is received through Kafka Connect, and the initial data is formatted and verified to obtain target data, and the target data is transmitted to an Apache Kafka stream processing platform in the form of a real-time stream, including: receiving the data packets sent by the sensor array through multiple Kafka Connects, wherein data packets of the same type of sensor are received by the same Kafka Connect, and the configuration file of the Kafka Connect defines the data type and data source received by the Kafka Connect; converting the received data packet into JSON format through a converter configured in the Kafka Connect; and verifying the integrity and accuracy of the received data packet through a verifier configured in the Kafka Connect; using the Kafka Connect to determine that the data packet after formatting and verification is a target data packet, and sending the target data packet as the target data to the Apache Kafka stream processing platform in the form of a real-time data stream.
[0046] This example technical solution optimizes the data processing flow of the lighting street lamp monitoring system through Kafka Connect, and improves the efficiency of data integration and management. In this solution, Kafka Connect undertakes the task of receiving data packets from different sensors, where each Kafka Connect instance processes specific types of sensor data, which are pre-defined in the configuration file. The received data packets are converted to JSON format by the configured converter, and the integrity and accuracy of the data are ensured by the verifier. The data packets that have been formatted and verified form the target data and are sent to the Apache Kafka stream processing platform in the form of real-time data streams for further processing. This technical effect not only improves the degree of automation of data processing, but also ensures high efficiency and low latency of data transmission, effectively supports lighting adjustment and energy optimization strategies based on real-time data, thereby improving the intelligence and energy efficiency of the entire lighting system.
[0047] In one example, each of the target data is diverted through Kafka Streams in the Apache Kafka stream processing platform to obtain first diverted data for real-time analysis, including: using the KafkaStreams to receive the target data packet sent by the Kafka Connect, performing Boolean diversion processing on the target data packet to obtain at least the first diverted data, and the first diverted data includes: light intensity data and vehicle flow data.
[0048] This example technical solution uses the Kafka Streams component of Apache Kafka to perform data diversion processing, optimizing the response of the lighting street lamp monitoring system to environmental changes. Target data received through Kafka Connect, such as light intensity and vehicle flow data, is diverted and processed in real time by Kafka Streams. This Boolean diversion method allows the system to instantly separate key data such as light intensity and vehicle flow to form the first diversion data for immediate analysis and response.
[0049] This processing strategy greatly improves the flexibility and response speed of data processing. By analyzing light and traffic data in real time, the lighting system can quickly adjust the brightness of street lights to more accurately match actual needs, optimize energy use and improve road safety. In addition, the solution uses Kafka's high throughput and low latency characteristics to ensure efficient data processing, handle a large number of concurrent data streams, and support real-time intelligent adjustment of the lighting system. This not only solves the challenge of heterogeneous data integration, but also improves the energy efficiency and operational effectiveness of the entire system.
[0050] In one example, a preset analysis strategy corresponding to the lighting street lamp is determined, and the preset analysis strategy is used to perform data analysis on the first diversion data to obtain a real-time instruction for adjusting the brightness of the lighting street lamp, including: based on the lighting street lamp corresponding to the first diversion data, calling the preset stream processing function built into the Kafka Streams, and the preset stream processing function is configured one-to-one with the lighting street lamp; using the preset stream processing function as the preset analysis strategy for the first diversion data, performing real-time calculation on the first diversion data to obtain a light intensity value after weight assignment and a traffic flow value after weight assignment; based on the light intensity value after weight assignment and the traffic flow value after weight assignment, combined with a preset basic brightness value of the street lamp, obtaining a target brightness value of the street lamp; based on the target brightness value of the street lamp, generating a real-time instruction for adjusting the brightness of the lighting street lamp.
[0051] This technical solution implements a highly customized lighting control strategy through Kafka Streams, enabling the lighting street lamp monitoring system to respond efficiently to environmental changes. Kafka Streams uses its built-in preset stream processing functions to configure according to the specific needs of each lighting street lamp, ensuring that the data processing strategy closely corresponds to the actual situation of the street lamp. By analyzing the first diversion data, such as light intensity and vehicle flow, in real time, the system can quickly generate real-time instructions for adjusting the lighting brightness. The technical effect of this method is reflected in its fast response capability and high degree of customization. The application of Kafka Streams makes the data processing process not only fast but also accurate, allowing the system to make instant adjustments to the lighting brightness when necessary to adapt to the changing external environment.
[0052] In one example, the initial data also includes: street lamp energy consumption data of the lighting street lamp, as well as temperature and humidity data and air pressure value data. Each of the target data is diverted and processed through Kafka Streams in the Apache Kafka stream processing platform to obtain at least first diverted data for real-time analysis, and also includes: obtaining second diverted data for in-depth analysis, wherein the second diverted data includes: light intensity data, vehicle flow data, street lamp energy consumption data, temperature and humidity data and air pressure value data.
[0053] Furthermore, after obtaining the second diversion data, the monitoring method also includes: sending the preset analysis strategy and the second diversion data of each lighting street lamp to the Hadoop distributed data processing platform for storage through the KafkaConnect; retrieving the stored second diversion data and preset analysis strategy of each lighting street lamp for analysis at preset time intervals through the Hadoop distributed data processing platform, and using the second diversion data to adjust the preset analysis strategy to obtain a target analysis strategy for each lighting street lamp; receiving the target analysis strategy of each lighting street lamp sent by the Hadoop distributed data processing platform through the Kafka Connect, and using the target analysis strategy to update the preset analysis strategy corresponding to each lighting street lamp stored in the Kafka Streams, wherein the target analysis strategy enables the energy consumption data of the lighting street lamp in the future time period to meet preset conditions.
[0054] This technical solution combines Apache Kafka and Hadoop platforms to conduct advanced monitoring and data analysis of lighting street lamp systems, achieving effective data management and energy optimization. Kafka Streams is used to perform real-time and in-depth diversion processing on the collected multi-source data (including light intensity, vehicle flow, energy consumption, temperature, humidity and air pressure values, etc.), where the first diversion data is used for immediate analysis, and the second diversion data is sent to the Hadoop distributed data processing platform for in-depth analysis and storage.
[0055] On the Hadoop platform, data and preset analysis strategies are regularly evaluated and adjusted to ensure the optimization of lighting strategies, and dynamically updated according to actual energy consumption performance and environmental changes. This regular strategy adjustment is fed back to KafkaStreams to update the corresponding lighting streetlight strategy to ensure that lighting efficiency is maximized and the preset energy consumption conditions are met.
[0056] It should be noted that Hadoop combined with Apache Kafka provides powerful support for big data processing and real-time data analysis. Kafka and Hadoop have their own advantages in real-time data processing and large-scale data storage and analysis, respectively. The combination can effectively solve different business needs. Specifically, Kafka can be used as a data pipeline to collect real-time data streams from different sources and reliably transmit these data to the Hadoop system. In this case, Kafka plays the role of an efficient and scalable message queue to ensure fast data delivery and buffering. Hadoop is designed to process large amounts of data, and its core is the Hadoop Distributed File System (HDFS), which supports the storage and processing of large data sets. This makes Hadoop very suitable for tasks that require processing and analyzing large amounts of data, such as data collected in lighting street lamp systems.
[0057] In one example, the preset analysis strategy and the second diversion data of each lighting street lamp are sent to the Hadoop distributed data processing platform for storage through the Kafka Connect, including: converting the preset analysis strategy and the second diversion data into Parquet format through the KafkaStreams; and using Apache Flume to transmit the preset analysis strategy and the second diversion data to the Hadoop distributed data processing platform for storage.
[0058] In this example, through Kafka Streams, the preset analysis strategy and the second diversion data (including information such as light intensity, vehicle flow, energy consumption, etc.) are converted into Parquet format, which is an efficient columnar storage format that is particularly suitable for optimizing the read performance of big data analysis. Then, using Apache Flume, these converted data are transmitted to the Hadoop distributed data processing platform for storage. The role of Apache Flume here is to serve as a data transmission pipeline to ensure that data is safely transmitted from the source (here is Kafka Streams) to the destination (here is the Hadoop distributed data processing platform, i.e.: HDFS). The main advantages of storing data in HDFS include its high scalability and fault tolerance, and it can store large amounts of data in a distributed manner on a physical server cluster. In addition, HDFS allows the system to provide high-throughput data access when processing large-scale data sets, which is very suitable for subsequent big data analysis and processing tasks.
[0059] The entire process not only ensures data integration and unified formatting, but also strengthens data transmission and storage capabilities through the combined use of Flume and HDFS, providing a solid foundation for subsequent data analysis and decision support. This system architecture is conducive to continuous monitoring and optimization of the lighting system, ensuring that the lighting strategy can meet actual needs and use energy efficiently.
[0060] In one example, the preset analysis strategy is adjusted using the second diversion data to obtain a target analysis strategy for each lighting street lamp, including: deploying Apache Spark on the Hadoop distributed data processing platform, and building a random forest regression prediction model in the Apache Spark; inputting the second diversion data and the preset analysis strategy of each lighting street lamp into the random forest regression prediction model for analysis, and obtaining an output target analysis strategy for each lighting street lamp.
[0061] In this example, Apache Spark and the random forest regression prediction model are used to optimize the monitoring and control strategy of lighting street lamps. This process involves deploying Apache Spark on the Hadoop distributed data processing platform, which is particularly suitable for implementing complex data analysis and machine learning tasks. Random forest is an ensemble learning technology built on multiple decision trees. It is efficient and accurate in solving regression and classification problems. In this system, the random forest model is used to analyze the second diversion data, which includes key indicators such as the light intensity, vehicle flow, energy consumption data of each lighting street lamp, and the current preset analysis strategy corresponding to it. By inputting this data into the random forest model, the model analyzes the effect of the existing strategy and predicts a better lighting control strategy. These optimized target analysis strategies will directly affect the brightness adjustment of the street lamp, making it more accurately adapt to the actual environmental conditions.
[0062] Reference Figure 2 , an embodiment of the voltage compensation device of the inverter in the embodiment of the present application includes:
[0063] A collection unit 1 is used to configure a sensor array for the lighting street lamp, collect data from the lighting street lamp based on the sensor array, and send the collected initial data to Kafka Connect;
[0064] Transmission unit 2 is used to receive the initial data sent by the sensor array of each lighting street lamp through Kafka Connect, unify the format and verify the initial data to obtain target data, and transmit the target data to the Apache Kafka stream processing platform in the form of real-time stream;
[0065] A shunting unit 3, configured to perform shunting processing on each target data through Kafka Streams in the Apache Kafka stream processing platform, to obtain at least first shunted data for real-time analysis;
[0066] An analysis unit 4 is used to determine the lighting street lamp corresponding to the first shunt data by using the Kafka Streams, and determine a preset analysis strategy corresponding to the lighting street lamp, and perform data analysis on the first shunt data by using the preset analysis strategy to obtain a real-time instruction for adjusting the brightness of the lighting street lamp;
[0067] The sending unit 5 is used to send the real-time instruction to the street lamp through the Kafka Connect, so that the street lamp adjusts the lighting brightness in response to the real-time instruction.
[0068] In this embodiment, for the specific implementation of each unit in the above device embodiment, please refer to the above method embodiment, which will not be repeated here.
[0069] Reference Figure 3 In an embodiment of the present invention, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, a display screen, an input device, a network interface and a database connected through a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the corresponding data in this embodiment. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the above method is implemented.
[0070] Those skilled in the art will understand that Figure 3 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied.
[0071] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the above method is implemented. It can be understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.
[0072] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided by the present invention and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double-speed data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM.
[0073] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.
[0074] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for monitoring a lighting street lamp, characterized in that: The monitoring method comprises: Configuring a sensor array for the lighting street lamp, collecting data for the lighting street lamp based on the sensor array, and sending the collected initial data to Kafka Connect; Receive the initial data sent by the sensor array of each lighting street lamp through Kafka Connect, unify the format and verify the initial data to obtain the target data, and transmit the target data to the Apache Kafka stream processing platform in the form of real-time stream; Performing stream processing on each of the target data by using Kafka Streams in the Apache Kafka stream processing platform to obtain at least first stream data for real-time analysis; Using the Kafka Streams to determine the lighting street lamp corresponding to the first shunt data, and determining a preset analysis strategy corresponding to the lighting street lamp, using the preset analysis strategy to perform data analysis on the first shunt data, and obtaining a real-time instruction for adjusting the brightness of the lighting street lamp; The real-time instruction is sent to the street lamp through the Kafka Connect, so that the street lamp adjusts the lighting brightness in response to the real-time instruction.
2. The monitoring method according to claim 1, characterized in that: The sensor array includes a plurality of sensors, the plurality of sensors include at least a photosensitive sensor and a geomagnetic sensor, and the initial data includes at least light intensity data and traffic flow data; configuring a sensor array for a lighting street lamp, and collecting data for the lighting street lamp based on the sensor array, and sending the collected initial data to Kafka Connect, including: Configuring a photosensitive sensor and a geomagnetic sensor on a corresponding area of the lighting street lamp; The light intensity data of the street lamp is obtained by collecting the light intensity of the surrounding environment of the street lamp in real time through the photosensitive sensor; The traffic flow of the area corresponding to the street lamp is collected in real time by the geomagnetic sensor to obtain the traffic flow data of the street lamp; Encapsulating the illumination intensity data and the traffic flow data into data packets in a standard format respectively, wherein the data packets in the standard format include: a timestamp and a lighting street lamp identification; The initial data is sent to the Kafka Connect using a wireless module.
3. The monitoring method according to claim 2, characterized in that: The initial data sent by the sensor array of each lighting street lamp is received through Kafka Connect, and the initial data is formatted and verified to obtain the target data, and the target data is transmitted to the Apache Kafka stream processing platform in the form of a real-time stream, including: Receive the data packets sent by the sensor array through the multiple Kafka Connects, wherein data packets of the same type of sensors are received by the same Kafka Connect, and the data type and data source received by the Kafka Connect are defined in the configuration file of the Kafka Connect; Converting the received data packet into JSON format through the converter configured in the Kafka Connect; and verifying the integrity and accuracy of the received data packet through the verifier configured in the Kafka Connect; The Kafka Connect is used to determine that the data packet after format unification and verification processing is the target data packet, and the target data packet is sent to the Apache Kafka stream processing platform as the target data in the form of a real-time data stream.
4. The monitoring method according to claim 3, characterized in that: Each of the target data is subjected to stream processing by Kafka Streams in the Apache Kafka stream processing platform to obtain first stream data for real-time analysis, including: The Kafka Streams is used to receive the target data packet sent by the Kafka Connect, and the target data packet is subjected to Boolean diversion processing to obtain at least the first diversion data, wherein the first diversion data includes: light intensity data and vehicle flow data.
5. The monitoring method according to claim 1, characterized in that: Determining a preset analysis strategy corresponding to the lighting street lamp, using the preset analysis strategy to perform data analysis on the first diversion data, and obtaining a real-time instruction for adjusting the brightness of the lighting street lamp, including: Based on the lighting street lamp corresponding to the first diversion data, calling the preset stream processing function built into the Kafka Streams, wherein the preset stream processing function is configured in a one-to-one correspondence with the lighting street lamp; The preset flow processing function is used as the preset analysis strategy for the first diversion data, and the first diversion data is calculated in real time to obtain a light intensity value after weight assignment and a traffic flow value after weight assignment; Based on the light intensity value after weight assignment and the traffic flow value after weight assignment, combined with the preset basic brightness value of the street lamp, a target brightness value of the street lamp is obtained; Based on the street lamp target brightness value, a real-time instruction for adjusting the brightness of the lighting street lamp is generated.
6. The monitoring method according to claim 2, characterized in that: The initial data also includes: street lamp energy consumption data, temperature and humidity data and air pressure data, By using Kafka Streams in the Apache Kafka stream processing platform, each of the target data is subjected to stream processing to obtain at least first stream data for real-time analysis, and further comprising: obtaining second stream data for in-depth analysis, wherein the second stream data includes: light intensity data, vehicle flow data, street lamp energy consumption data, temperature and humidity data, and air pressure value data; After obtaining the second shunt data, the monitoring method further includes: sending the preset analysis strategy and the second shunt data of each lighting street lamp to the Hadoop distributed data processing platform for storage through the Kafka Connect; The Hadoop distributed data processing platform retrieves the stored second shunt data and the preset analysis strategy of each lighting street lamp at every preset time interval for analysis, and uses the second shunt data to adjust the preset analysis strategy to obtain a target analysis strategy for each lighting street lamp; The target analysis strategy for each lighting street lamp sent by the Hadoop distributed data processing platform is received through the Kafka Connect, and the preset analysis strategy corresponding to each lighting street lamp stored in the Kafka Streams is updated using the target analysis strategy, wherein the target analysis strategy enables the energy consumption data of the lighting street lamp in a future time period to meet preset conditions.
7. The monitoring method according to claim 6, characterized in that: The preset analysis strategy and the second shunt data of each lighting street lamp are sent to the Hadoop distributed data processing platform for storage through the Kafka Connect, including: converting the preset analysis strategy and the second shunt data into Parquet format through the Kafka Streams; using Apache Flume to transmit the preset analysis strategy and the second shunt data to the Hadoop distributed data processing platform for storage; and / or, The preset analysis strategy is adjusted using the second diversion data to obtain a target analysis strategy for each lighting street lamp, including: deploying Apache Spark on the Hadoop distributed data processing platform, and building a random forest regression prediction model in the Apache Spark; inputting the second diversion data and the preset analysis strategy of each lighting street lamp into the random forest regression prediction model for analysis, and obtaining an output target analysis strategy for each lighting street lamp.
8. A monitoring device for lighting street lamps, characterized in that: The monitoring device comprises: A collection unit, configured to configure a sensor array for the lighting street lamp, collect data for the lighting street lamp based on the sensor array, and send the collected initial data to Kafka Connect; A transmission unit, used to receive the initial data sent by the sensor array of each lighting street lamp through Kafka Connect, unify the format and verify the initial data to obtain target data, and transmit the target data to the Apache Kafka stream processing platform in the form of real-time stream; A shunting unit, configured to perform shunting processing on each target data through Kafka Streams in the Apache Kafka stream processing platform, to obtain at least first shunted data for real-time analysis; an analysis unit, configured to use the Kafka Streams to determine the lighting street lamp corresponding to the first shunt data, and determine a preset analysis strategy corresponding to the lighting street lamp, and use the preset analysis strategy to perform data analysis on the first shunt data to obtain a real-time instruction for adjusting the brightness of the lighting street lamp; A sending unit is used to send the real-time instruction to the lighting street lamp through the Kafka Connect, so that the lighting street lamp adjusts the lighting brightness in response to the real-time instruction.
9. A computer device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
