A lighting system fault diagnosis method based on data analysis

By deploying multiple sensors and building data analysis models in the intelligent lighting system, the problem of incomplete data collection is solved, accurate assessment of equipment status and intelligent adjustment of energy are achieved, and the reliability of fault diagnosis and energy saving effects are improved.

CN120456394BActive Publication Date: 2025-09-26BWEETECH ELECTRONICS TECH (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510954872.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-11
Publication Date
2025-09-26
Estimated Expiration
2045-07-11

AI Technical Summary

Technical Problem

Existing intelligent lighting systems have incomplete data collection, inaccurate data processing, difficulty in converting and unifying different protocols, lack of effective models for equipment fault diagnosis, and inability to accurately optimize lighting, resulting in insufficient data utilization and energy waste.

Method used

Deploy environmental sensors, lighting equipment sensors and user interaction devices to collect data, convert protocols, clean and unify formats, build lighting demand prediction models and equipment status assessment models, and perform fault diagnosis and optimization adjustments through data analysis.

Benefits of technology

It achieves comprehensive data collection and accurate equipment status assessment, detects potential faults in advance, accurately adjusts lighting equipment, saves energy and avoids waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120456394B_ABST
    Figure CN120456394B_ABST
Patent Text Reader

Abstract

The present invention discloses a lighting system fault diagnosis method based on data analysis, which specifically relates to the field of intelligent lighting, including steps such as data collection, processing, analysis, judgment and feedback. The method first collects data through environmental sensors, lighting equipment sensors and user interaction devices, performs protocol conversion through the edge gateway, and then uses a Python program to clean the data and maps it to a standardized meta-model through a Java program. Then, a linear regression model is used to predict lighting demand, and the equipment status is evaluated through a random forest model to obtain a power prediction value and a health probability prediction value. Then, lighting optimization and fault judgment are performed based on the power prediction value and the health probability prediction value. When the predicted power is lower than the actual power by more than 10%, the lamp is adjusted, and an early warning is triggered when the equipment health probability is ≥0.6. Finally, instructions are sent through the MQTT protocol to automatically adjust the lamp and notify the operation and maintenance personnel to achieve efficient fault diagnosis and energy-saving optimization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent lighting technology, and more particularly, to a lighting system fault diagnosis method based on data analysis. Background Art

[0002] With the continuous development of intelligent lighting technology, lighting systems are increasingly being used in various scenarios. Intelligent lighting networks consist of numerous nodes, requiring the collection, processing, and analysis of large amounts of data to achieve efficient fault diagnosis and lighting optimization. This process involves the deployment of multiple sensors and data collection devices, such as environmental sensors, lighting equipment sensors, and user interaction devices. The collected data also requires protocol conversion, cleaning, and format unification. Furthermore, corresponding models must be built for data analysis and fault diagnosis.

[0003] However, it still has some shortcomings in actual use. For example, in terms of data collection, the existing technology may not be able to fully and accurately obtain various environmental and equipment data, resulting in incomplete data or errors. At the same time, in the data processing process of the existing technology, data of different protocols may be difficult to effectively convert and unify, affecting the analysis and utilization of the data. In addition, for equipment fault diagnosis, the existing technology lacks effective models and methods to accurately evaluate the equipment status, making it difficult to detect potential faults in advance. Finally, in terms of lighting optimization, the existing technology is unable to accurately adjust the power according to actual needs, which may lead to energy waste. Summary of the Invention

[0004] In order to overcome the above-mentioned defects of the prior art, an embodiment of the present invention provides a lighting system fault diagnosis method based on data analysis, which solves the problems raised in the above-mentioned background technology through the following scheme.

[0005] To achieve the above-mentioned object, the present invention provides the following technical solutions: a lighting system fault diagnosis method based on data analysis, comprising: S1: data acquisition: deploying specific sensors and acquisition equipment at each node of the intelligent lighting network to collect lighting system data;

[0006] The sensors and acquisition devices include environmental sensors, lighting equipment sensors and user interaction devices;

[0007] S2: Data processing: Perform protocol conversion on the data collected in step S1, and perform data cleaning and format unification on the converted data;

[0008] S3: Data analysis: Aggregate the processed data and build a lighting demand prediction model and equipment status assessment model to calculate the lighting equipment power prediction value and health probability prediction value;

[0009] S4: Result judgment: Perform lighting optimization judgment and equipment failure judgment based on the lighting equipment power prediction value and health probability prediction value obtained in step S3;

[0010] S5: Result feedback: The instruction generated in step S4 is sent to the intelligent lighting network, which automatically adjusts the lamps according to the instruction and notifies the operation and maintenance personnel to handle it.

[0011] Preferably, the environmental sensor deployment method is as follows: deploy a BH1750 light intensity sensor, connect it to a CC2530 microcontroller equipped with a Zigbee module through an I2C communication interface, the BH1750 sensor collects light intensity data at intervals of 10 seconds, the CC2530 microcontroller packages the data according to the specifications of the Zigbee protocol, and transmits it through a Zigbee wireless communication link, deploy a DHT11 temperature and humidity sensor, communicate with the CC2530 microcontroller using a single bus, collect temperature and humidity data every 30 seconds, and transmit it to subsequent nodes via the Zigbee protocol, deploy an HC-SR501 human infrared sensor, generate a high-level signal when human movement is detected, and the signal is captured by the interrupt processing mechanism built into the CC2530 microcontroller, and after simple logical processing, sends human presence data via the Zigbee protocol.

[0012] Preferably, the lamp equipment sensor deployment method is as follows: in the lamp driving circuit, the ACS712 current sensor and the voltage-dividing resistor voltage sensor are connected to the STM32 microcontroller, and the voltage-dividing resistor voltage sensor obtains the analog signal of the lamp voltage through the resistance voltage division method. The STM32 microcontroller converts the analog signals output by the ACS712 current sensor and the voltage-dividing resistor voltage sensor into digital signals every second, and calculates the lamp power according to the P=UI formula. At the same time, the STM32 microcontroller collects the switch status sensor signal and working time data in real time, packages the current, voltage, power, switch status, and working time data according to the frame format of the Modbus protocol, and transmits them to the edge gateway through the RS485 communication interface.

[0013] Preferably, the user interaction device deployment method is as follows: the intelligent control panel adopts capacitive touch buttons, and the ESP32 microcontroller performs button detection and signal processing. The ESP32 microcontroller integrates Wi-Fi and Bluetooth dual-mode communication functions. When the user operates the capacitive touch button, the electrical signal change generated by the button is detected by the ESP32 microcontroller, and is processed into the corresponding control instruction or preference setting data through the internal algorithm. The data is sent to the network through the Wi-Fi module, and the mobile phone APP establishes a connection with the smart lighting network through Bluetooth low energy. The APP side calls the BLE communication interface provided by the system to transmit the user's operating instructions such as turning on and off the light, adjusting the brightness, etc. on the APP to the control node through the corresponding protocol in real time. All data acquisition devices use the real-time clock module built into the microcontroller to obtain a timestamp accurate to the second, and package it together with the collected data for transmission.

[0014] Preferably, the protocol conversion specifically refers to: using Advantech WISE-4010 industrial-grade edge gateway as a data transfer station, with a built-in protocol conversion program developed based on the Zigbee protocol stack Z-Stack and the Modbus protocol stack libmodbus. When receiving Zigbee protocol data, the protocol conversion program parses the Zigbee data packet according to the Z-Stack protocol stack and extracts the data content therein. For Modbus protocol data, the libmodbus protocol stack is used to parse the data frame according to the Modbus protocol specification to obtain key data. Then, the parsed data is repackaged according to the MQTT protocol format and sent to the server through the Ethernet interface on the gateway.

[0015] Preferably, the data cleaning specifically refers to: cleaning the collected data, writing a data cleaning program in Python, using the NumPy library to calculate the mean and standard deviation of each data type, for numerical data, using NumPy's mean calculation function np.mean() and standard deviation calculation function np.std(), the data that exceeds the range of the mean plus or minus three times the standard deviation is determined as an outlier and eliminated, for missing values, when the missing ratio is less than 20%, for numerical data, use the fillna() function of the Pandas library to fill in the mean as the filling value, for categorical data, mark the missing values ​​as a special state "unknown", when the missing ratio is between 20%-80%, in addition to the above-mentioned filling operation, use the Pandas library to add a new column as a missing value indicator variable to mark the data as missing, when the missing ratio is greater than 80%, only generate a missing value indicator variable, and do not use the original variable.

[0016] Preferably, the format unification specifically refers to: establishing a standardized data meta-model, stipulating that the data format includes device ID, data type, data value, timestamp, and protocol source field, using Java language to write a data mapping program, and strictly mapping the cleaned data to the meta-model.

[0017] Preferably, the method for constructing the lighting demand prediction model is as follows:

[0018] Construct a linear regression model, using historical light intensity data, quantified time data (i.e., values ​​0-23 corresponding to 24 hours a day), and quantified weather data obtained through an external API as independent variables, and the lighting equipment power at the corresponding time as the dependent variable, to establish a linear regression equation. In the Python environment, the LinearRegression model of the Scikit-learn library is used for modeling. First, historical data is read from the database, and the light intensity, time, and weather data are processed accordingly as feature data. The lighting equipment power is used as the target data, and the time data is encoded. Then, the fit() method of the LinearRegression model is used to solve the regression coefficient through the least squares method, and the lighting equipment power is predicted based on the current and predicted independent variable data.

[0019] Preferably, the method for constructing the equipment status assessment model is as follows:

[0020] The lamp voltage, current, power, and working time are taken as the core feature variables. The ambient temperature and humidity are collected at the same time. The original data are standardized and the Z-score normalization formula is used: , where μ is the characteristic mean and σ is the standard deviation, which normalizes the data distribution and improves the convergence speed of the model. For missing values, multiple imputation method is used to iteratively estimate missing data through chain equations;

[0021] When building the random forest model, set the hyperparameters: the number of trees n_estimators=100, the maximum depth max_depth=15, the Gini index as the split feature selection method, and randomly extract sqrt(n_features) features for optimal partitioning at each node split;

[0022] A 5-fold cross-validation approach was used to evaluate the generalization ability of the model. The mean square error and mean absolute error were calculated as performance indicators. Feature importance ranking was introduced to eliminate redundant features by calculating the cumulative contribution of each feature to the reduction of node impurity in all trees:

[0023] Deploy edge computing nodes to collect voltage, current, and power data in real time with a sampling interval of 100ms. The data mean and variance are calculated using a sliding window algorithm with a window size of 5 minutes to enhance data stability.

[0024] After the model outputs the original predicted value, it is constrained by combining the preset normal voltage range [210V, 230V] and normal current range [0.1A, 0.3A]:

[0025] If the predicted value exceeds the normal range, it is directly judged as abnormal;

[0026] If it is within the normal range, use the Sigmoid function: Map the prediction results to the range of 0-1, where x is the weighted value of the distance between the prediction value and the normal range boundary, and optimize the mapping effect by adjusting the weight coefficient;

[0027] Evaluate the device operating status using a fault threshold of 0.6:

[0028] When the health probability is ≥0.6, the equipment is judged to be at risk of failure and the early warning mechanism is triggered. If it is lower than the threshold, it is marked as normal operation and the status change trend is recorded for subsequent analysis.

[0029] The lighting optimization judgment operation is preferably as follows: the predicted power obtained by the lighting demand prediction model is compared with the current actual power. In the control program written in Python on the server side, the predicted power of the lighting demand prediction model and the current actual power data are obtained in real time, and a comparison is made. When the predicted power is lower than the actual power and the difference exceeds 10%, it is determined that there is excessive lighting, and the server-side control program generates an optimization instruction to reduce the brightness of the lamps or turn off some lamps;

[0030] The device fault judgment operation is as follows: the server-side monitoring program regularly obtains the comprehensive status score of the device status assessment model, compares it with the 60-point fault threshold, and generates a fault warning instruction containing the fault device ID and fault type when the score is lower than the threshold.

[0031] Preferably, the instruction is sent to the control node through the MQTT protocol to adjust the working state of the lamp. After receiving the instruction, the control node adjusts the brightness or switch state of the lamp through PWM dimming technology or relay control technology according to the instruction content. At the same time, the fault warning instruction containing the fault device ID and fault type is notified to the operation and maintenance personnel through SMS, email or system pop-up window, and the fault information is stored in the database. In the database, a fault information table is established, which contains fields such as device ID, fault type, fault occurrence time, etc., and the fault information is inserted into the table.

[0032] Technical effects and advantages of the present invention:

[0033] 1. By deploying multiple high-precision sensors, the present invention can comprehensively collect environmental data such as light intensity, temperature, humidity, and human presence, and the collection interval is reasonable, ensuring the timeliness and accuracy of the data. The lighting equipment sensor of the present invention uses an ACS712 current sensor and a voltage divider resistor voltage sensor, combined with an STM32 microcontroller, to accurately measure data such as the current, voltage, and power of the lamp. At the same time, it collects switch status and operating time data in real time, providing comprehensive basic data for equipment status assessment;

[0034] 2. This invention constructs an equipment status assessment model, using lamp voltage, current, power, and operating hours as core feature variables. Combined with ambient temperature and humidity data, it uses Z-score standardization and multiple imputation methods to handle missing values, improving data quality and model convergence speed. Furthermore, it uses a random forest model, sets reasonable hyperparameters, and introduces feature importance ranking to eliminate redundant features, enabling the model to accurately assess equipment status. The model output is constrained within a preset normal range, enabling precise judgment of equipment failure risks and triggering early warning mechanisms, thereby improving the reliability of fault diagnosis.

[0035] 3. The present invention constructs a lighting demand prediction model, takes historical light intensity, quantified time and weather data as independent variables, and lighting equipment power as dependent variable, establishes a linear regression equation, and can accurately predict lighting equipment power based on current and predicted independent variable data. By comparing the predicted power with the current actual power, when the predicted power is lower than the actual power and the difference exceeds 10%, it is determined that there is excessive lighting, and optimization instructions are generated to reduce the brightness of the lamps or turn off some lamps, thereby realizing intelligent energy-saving lighting optimization and effectively avoiding energy waste. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 Schematic diagram of the method of the present invention. DETAILED DESCRIPTION

[0037] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0038] As attached Figure 1 A lighting system fault diagnosis method based on data analysis is shown, comprising:

[0039] S1: Data collection: Deploy specific sensors and collection devices at each node of the intelligent lighting network to collect lighting system data;

[0040] Specifically, the sensors and acquisition devices include environmental sensors, lighting equipment sensors, and user interaction devices;

[0041] The environmental sensor deployment method is as follows: deploying a BH1750 light intensity sensor with high precision and stability, connecting it to a CC2530 microcontroller equipped with a Zigbee module through an I2C communication interface. The CC2530 microcontroller integrates an enhanced 8051 core and has rich peripheral resources, which can efficiently process the BH1750 sensor data. At intervals of 10 seconds, the BH1750 sensor collects light intensity data, and the CC2530 microcontroller packages the data according to the Zigbee protocol specifications and transmits it to the wireless communication terminal through the Zigbee wireless communication terminal. The DHT11 temperature and humidity sensor is deployed to communicate with the CC2530 microcontroller via a single bus, collecting temperature and humidity data every 30 seconds. The digital signal output by the DHT11 sensor can be directly recognized and processed by the CC2530 microcontroller and transmitted to subsequent nodes via the Zigbee protocol. The HC-SR501 human infrared sensor is deployed to generate a high-level signal when human movement is detected. The signal is captured by the interrupt processing mechanism built into the CC2530 microcontroller and, after simple logical processing, sends the human presence data via the Zigbee protocol.

[0042] The lamp device sensor deployment method is as follows: in the lamp driving circuit, the ACS712 current sensor and the voltage-dividing resistor voltage sensor are connected to the STM32 microcontroller. The ACS712 current sensor is based on the linear Hall effect principle and can accurately measure the lamp current and output an analog voltage signal proportional to the current. The voltage-dividing resistor voltage sensor obtains the analog signal of the lamp voltage through the resistance voltage division method. The STM32 microcontroller uses a model with high performance and low power consumption characteristics. It has a built-in 12-bit precision A / D converter, which converts the analog signals output by the ACS712 current sensor and the voltage-dividing resistor voltage sensor into digital signals every second, and calculates the lamp power according to the P=UI formula. At the same time, the STM32 microcontroller collects the switch status sensor signal and working time data in real time, packages the current, voltage, power, switch status, and working time data according to the frame format of the Modbus protocol, and transmits them to the edge gateway through the RS485 communication interface.

[0043] The user interaction device deployment method is as follows: the intelligent control panel uses capacitive touch buttons, and the ESP32 microcontroller performs button detection and signal processing. The ESP32 microcontroller integrates Wi-Fi and Bluetooth dual-mode communication functions, which can flexibly adapt to different communication scenarios. When the user operates the capacitive touch button, the electrical signal change generated by the button is detected by the ESP32 microcontroller, processed by the internal algorithm into the corresponding control command or preference setting data, and the data is sent to the network via the Wi-Fi module. The mobile phone app establishes a connection with the smart lighting network via Bluetooth Low Energy (BLE) or Wi-Fi. The app calls the BLE or Wi-Fi communication interface provided by the system and instantly transmits the user's operation instructions on the app, such as turning on and off the light and adjusting the brightness, to the control node via the corresponding protocol. All data acquisition devices use the microcontroller's built-in real-time clock module (RTC) to obtain a timestamp accurate to the second and package it with the collected data for transmission. For example, in the data frame structure, the timestamp occupies a specific byte position, immediately following the data content, to ensure the chronological order of the data.

[0044] S2: Data processing: Perform protocol conversion on the data collected in step S1, and perform data cleaning and format unification on the converted data;

[0045] The protocol conversion specifically refers to: using Advantech WISE-4010 industrial-grade edge gateway as a data transfer station. The gateway hardware is built on a high-performance processor and has powerful computing and data processing capabilities. It has a built-in protocol conversion program developed based on the Zigbee protocol stack Z-Stack and the Modbus protocol stack libmodbus. When receiving Zigbee protocol data, the protocol conversion program parses the Zigbee data packet according to the Z-Stack protocol stack and extracts the data content, such as device ID, data type, data value and other information. For Modbus protocol data, the libmodbus protocol stack is used to parse the data frame according to the Modbus protocol specification to obtain key data. Then, the parsed data is repackaged according to the MQTT protocol format and sent to the server through the Ethernet interface on the gateway;

[0046] The data cleaning specifically refers to: cleaning the collected data, writing a data cleaning program in Python, using the NumPy library to calculate the mean and standard deviation of each data type, for numerical data, using NumPy's mean calculation function np.mean() and standard deviation calculation function np.std(), data that exceeds the range of the mean plus or minus three times the standard deviation is determined as an outlier and eliminated, for missing values, when the missing ratio is less than 20%, for numerical data, using the fillna() function of the Pandas library, filling with the mean as the filling value; for categorical data, such as switch status, marking the missing values ​​as a special state "unknown", when the missing ratio is between 20%-80%, in addition to the above filling operation, using the Pandas library to add a new column as a missing value indicator variable to mark the data as missing, when the missing ratio is greater than 80%, only the missing value indicator variable is generated, and the original variable is not used.

[0047] The format unification specifically refers to: establishing a standardized data meta-model, stipulating that the data format includes device ID, data type, data value, timestamp, and protocol source fields, and using Java to write a data mapping program to strictly map the cleaned data to the meta-model. For example, for light intensity data, assuming the device ID is "light_sensor_001", the data type is "illuminance", the data value is 500 lux, the timestamp is 1690897200 seconds, and the protocol source is "Zigbee", the program assembles this data into objects in a specific format according to the meta-model format requirements to facilitate subsequent storage and analysis, such as storing it as a JSON format string:

[0048] {"deviceID":"light_sensor_001","dataType":"illuminance","dataValue":500,"timestamp":1690897200,"protocolSource":"Zigbee"}.

[0049] S3: Data analysis: Aggregate the processed data and build a lighting demand prediction model and equipment status assessment model to calculate the lighting equipment power prediction value and health probability prediction value;

[0050] The data aggregation method is as follows: using the time window aggregation method, the processed data is aggregated in a 5-minute time window. On the server side, the aggregation function of the InfluxDB time series database is used to complete the operation. By writing InfluxQL query statements, for numerical data such as light intensity and power, the mean() function is used to calculate the average value of the data in the window. For state-type data such as switch status, the last() function is used to record the last valid state in the window. For example, the aggregation query statement for light intensity data is:

[0051] SELECTmean("illuminance")FROM"lighting_data"WHEREtime>=now()-5mANDtime <now()GROUPBYtime(5m);

[0052] The method for constructing the lighting demand prediction model is as follows:

[0053] Construct a linear regression model using historical light intensity data, quantified time data (a value of 0-23 for 24 hours a day), quantified weather data obtained through an external API (sunny = 3, cloudy = 2, rainy = 1) as independent variables, and the lighting equipment power at the corresponding time as the dependent variable. Build a linear regression equation In the Python environment, the LinearRegression model of the Scikit-learn library is used for modeling. First, historical data is read from the database. The light intensity, time, and weather data are processed accordingly as feature data. The lighting equipment power is used as the target data. The time data is encoded, such as quantizing the 24 hours of a day into values ​​​​from 0 to 23. The weather data is quantized, and different values ​​are assigned to sunny days, cloudy days, rainy days, etc. Then, the fit() method of the LinearRegression model is used to solve the regression coefficient through the least squares method. The lighting equipment power is predicted based on the current and predicted independent variable data.

[0054] The construction method of the equipment status assessment model is as follows:

[0055] The lamp voltage, current, power, and working time are taken as the core feature variables. The ambient temperature and humidity are collected at the same time. The original data are standardized and the Z-score normalization formula is used: , where μ is the characteristic mean and σ is the standard deviation, which normalizes the data distribution and improves the convergence speed of the model. For missing values, the multiple imputation method (MICE) is used to iteratively estimate missing data through chain equations;

[0056] When building the random forest model, set the hyperparameters: the number of trees n_estimators=100, the maximum depth max_depth=15, the Gini index as the split feature selection method, and randomly extract sqrt(n_features) features for optimal partitioning at each node split;

[0057] We use 5-fold cross-validation to evaluate the generalization ability of the model, calculate the mean square error (MSE) and mean absolute error (MAE) as performance indicators, introduce feature importance ranking, calculate the cumulative contribution of each feature to the reduction of node impurity in all trees, eliminate redundant features, improve model efficiency, and conduct real-time monitoring and status assessment:

[0058] Deploy edge computing nodes to collect voltage, current, power, and other data in real time at a sampling interval of 100ms. The data mean and variance are calculated using a sliding window algorithm with a window size of 5 minutes to enhance data stability.

[0059] After the model outputs the original predicted value, it is constrained by combining the preset normal voltage range [210V, 230V] and normal current range [0.1A, 0.3A]:

[0060] If the predicted value exceeds the normal range, it is directly judged as abnormal;

[0061] If it is within the normal range, use the Sigmoid function: The prediction results are mapped to the range of 0-1, where x is the weighted value of the distance between the predicted value and the boundary of the normal range. The mapping effect is optimized by adjusting the weight coefficient.

[0062] Evaluate the device operating status using a fault threshold of 0.6:

[0063] When the health probability is ≥0.6, the equipment is judged to be at risk of failure and the early warning mechanism is triggered. If it is lower than the threshold, it is marked as normal operation and the status change trend is recorded for subsequent analysis.

[0064] S4: Result judgment: Perform lighting optimization judgment and equipment failure judgment based on the lighting equipment power prediction value and health probability prediction value obtained in step S3;

[0065] The lighting optimization judgment operation is as follows: the predicted power obtained by the lighting demand prediction model is compared with the current actual power. In the control program written in Python on the server side, the predicted power of the lighting demand prediction model and the current actual power data are obtained in real time, and a comparison is made. When the predicted power is lower than the actual power and the difference exceeds 10%, it is determined that there is excessive lighting, and the server-side control program generates an optimization instruction to reduce the brightness of the lamps or turn off some lamps;

[0066] The device fault judgment operation is as follows: the server-side monitoring program regularly obtains the comprehensive status score of the device status assessment model, compares it with the 60-point fault threshold, and generates a fault warning instruction containing the fault device ID and fault type when the score is lower than the threshold.

[0067] S5: Result feedback: The instruction generated in step S4 is sent to the intelligent lighting network, which automatically adjusts the lamps according to the instruction and notifies the operation and maintenance personnel to handle it.

[0068] The instructions are sent to the control node via the MQTT protocol to adjust the working state of the lamp. After receiving the instructions, the control node adjusts the brightness or switch state of the lamp through PWM dimming technology or relay control technology according to the content of the instructions. At the same time, the fault warning instructions containing the fault device ID and fault type are notified to the operation and maintenance personnel via SMS, email or system pop-up window, and the fault information is stored in the database. In the database, a fault information table is established, which contains fields such as device ID, fault type, and fault occurrence time, and the fault information is inserted into the table for subsequent analysis and maintenance.

[0069] Secondly: The drawings of the embodiments disclosed in the present invention only involve structures related to the embodiments disclosed in the present invention. Other structures may refer to conventional designs. The same embodiment and different embodiments of the present invention may be combined with each other without conflict.

[0070] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A lighting system fault diagnosis method based on data analysis, characterized in that: include: S1: Data collection: Deploy specific sensors and collection devices at each node of the intelligent lighting network to collect lighting system data; The sensors and acquisition devices include environmental sensors, lighting equipment sensors and user interaction devices; S2: Data processing: Perform protocol conversion on the data collected in step S1, and perform data cleaning and format unification on the converted data; S3: Data analysis: Aggregate the processed data and build a lighting demand prediction model and equipment status assessment model to calculate the lighting equipment power prediction value and health probability prediction value; The data aggregation method is as follows: using the time window aggregation method, the processed data is aggregated with a 5-minute time window, and on the server side, the aggregation function of the InfluxDB time series database is used to complete the operation; The method for constructing the lighting demand prediction model is as follows: Construct a linear regression model, using historical light intensity data, quantified time data (i.e., values ​​0-23 corresponding to 24 hours a day), and quantified weather data obtained through an external API as independent variables, and the lighting equipment power at the corresponding time as the dependent variable, to establish a linear regression equation. In the Python environment, the LinearRegression model of the Scikit-learn library is used for modeling. First, historical data is read from the database. The light intensity, time, and weather data are processed accordingly as feature data, and the lighting equipment power is used as the target data. The time data is encoded. Then, the fit() method of the LinearRegression model is used to solve the regression coefficient through the least squares method. The lighting equipment power is predicted based on the current and predicted independent variable data. The construction method of the equipment status assessment model is as follows: The lamp voltage, current, power, and working time are taken as the core feature variables. The ambient temperature and humidity are collected at the same time. The original data are standardized and the Z-score normalization formula is used: , where μ is the characteristic mean and σ is the standard deviation, which normalizes the data distribution and improves the convergence speed of the model. For missing values, multiple imputation method is used to iteratively estimate missing data through chain equations; When building the random forest model, set the hyperparameters: the number of trees n_estimators=100, the maximum depth max_depth=15, the Gini index as the split feature selection method, and randomly extract sqrt(n_features) features for optimal partitioning at each node split; A 5-fold cross-validation approach was used to evaluate the generalization ability of the model. The mean square error and mean absolute error were calculated as performance indicators. Feature importance ranking was introduced to eliminate redundant features by calculating the cumulative contribution of each feature to the reduction of node impurity in all trees: Deploy edge computing nodes to collect voltage, current, and power data in real time with a sampling interval of 100ms. The data mean and variance are calculated using a sliding window algorithm with a window size of 5 minutes to enhance data stability. After the model outputs the original predicted value, it is constrained by combining the preset normal voltage range [210V, 230V] and normal current range [0.1A, 0.3A]: If the predicted value exceeds the normal range, it is directly judged as abnormal; If it is within the normal range, use the Sigmoid function: Map the prediction results to the range of 0-1, where x is the weighted value of the distance between the prediction value and the normal range boundary, and optimize the mapping effect by adjusting the weight coefficient; Evaluate the device operating status using a fault threshold of 0.6: When the health probability is ≥0.6, the device is judged to be at risk of failure and the early warning mechanism is triggered. If it is lower than the threshold, it is marked as normal operation and the status change trend is recorded. S4: Result judgment: Perform lighting optimization judgment and equipment failure judgment based on the lighting equipment power prediction value and health probability prediction value obtained in step S3; S5: Result feedback: The instruction generated in step S4 is sent to the intelligent lighting network, which automatically adjusts the lamps according to the instruction and notifies the operation and maintenance personnel to handle it.

2. The lighting system fault diagnosis method based on data analysis according to claim 1, characterized in that: The environmental sensor deployment method is as follows: deploy a BH1750 light intensity sensor, connect it to a CC2530 microcontroller equipped with a Zigbee module via an I2C communication interface, collect light intensity data at 10-second intervals, and the CC2530 microcontroller packages the data according to the specifications of the Zigbee protocol and transmits it via a Zigbee wireless communication link; deploy a DHT11 temperature and humidity sensor, communicate with the CC2530 microcontroller via a single bus, collect temperature and humidity data every 30 seconds, and transmit it to subsequent nodes via the Zigbee protocol; deploy an HC-SR501 human infrared sensor, generate a high-level signal when human movement is detected, and the signal is captured by the built-in interrupt processing mechanism of the CC2530 microcontroller. After simple logical processing, human presence data is sent via the Zigbee protocol.

3. The lighting system fault diagnosis method based on data analysis according to claim 1, characterized in that: The lamp device sensor deployment method is as follows: in the lamp driving circuit, the ACS712 current sensor and the voltage-dividing resistor voltage sensor are connected to the STM32 microcontroller. The voltage-dividing resistor voltage sensor obtains the analog signal of the lamp voltage through the resistance voltage division method. The STM32 microcontroller converts the analog signals output by the ACS712 current sensor and the voltage-dividing resistor voltage sensor into digital signals every second, and calculates the lamp power according to the P=UI formula. At the same time, the STM32 microcontroller collects the switch status sensor signal and working time data in real time, packages the current, voltage, power, switch status, and working time data according to the frame format of the Modbus protocol, and transmits them to the edge gateway through the RS485 communication interface.

4. The lighting system fault diagnosis method based on data analysis according to claim 1, characterized in that: The user interaction device deployment method is as follows: the intelligent control panel uses capacitive touch buttons, and the ESP32 microcontroller performs button detection and signal processing. The ESP32 microcontroller integrates Wi-Fi and Bluetooth dual-mode communication functions. When the user operates the capacitive touch button, the electrical signal change generated by the button is detected by the ESP32 microcontroller, and is processed into corresponding control instructions or preference setting data through the internal algorithm. The data is sent to the network through the Wi-Fi module. The mobile phone APP establishes a connection with the smart lighting network through Bluetooth low energy. The APP side calls the BLE communication interface provided by the system to transmit the user's operation instructions on the APP to the control node in real time through the corresponding protocol. All data acquisition devices use the real-time clock module built into the microcontroller to obtain timestamps accurate to seconds, and package them together with the collected data for transmission.

5. The lighting system fault diagnosis method based on data analysis according to claim 1, characterized in that: The protocol conversion specifically refers to: using Advantech's WISE-4010 industrial-grade edge gateway as a data transfer station, with a built-in protocol conversion program developed based on the Zigbee protocol stack Z-Stack and the Modbus protocol stack libmodbus. When receiving Zigbee protocol data, the protocol conversion program parses the Zigbee data packet according to the Z-Stack protocol stack and extracts the data content. For Modbus protocol data, the libmodbus protocol stack is used to parse the data frame according to the Modbus protocol specification to obtain key data. Then, the parsed data is repackaged in the MQTT protocol format and sent to the server through the Ethernet interface on the gateway.

6. The lighting system fault diagnosis method based on data analysis according to claim 1, characterized in that: The data cleaning specifically refers to: cleaning the collected data, writing a data cleaning program in Python, using the NumPy library to calculate the mean and standard deviation of each data type, for numerical data, using NumPy's mean calculation function np.mean() and standard deviation calculation function np.std(), data outside the range of the mean plus or minus three times the standard deviation is determined as an outlier and eliminated, for missing values, when the missing ratio is less than 20%, for numerical data, using the fillna() function of the Pandas library, filling with the mean as the filling value, for categorical data, marking the missing values ​​as a special state "unknown", when the missing ratio is between 20%-80%, in addition to the above filling operation, using the Pandas library to add a new column as a missing value indicator variable to mark the data as missing, when the missing ratio is greater than 80%, only the missing value indicator variable is generated, and the original variable is not used.

7. The lighting system fault diagnosis method based on data analysis according to claim 1, characterized in that: The format unification specifically refers to: establishing a standardized data meta-model, stipulating that the data format includes device ID, data type, data value, timestamp, and protocol source field, and using Java language to write a data mapping program to strictly map the cleaned data to the meta-model.

8. The lighting system fault diagnosis method based on data analysis according to claim 1, characterized in that: The lighting optimization judgment operation is as follows: the predicted power obtained by the lighting demand prediction model is compared with the current actual power. In the control program written in Python on the server side, the predicted power of the lighting demand prediction model and the current actual power data are obtained in real time, and a comparison is made. When the predicted power is lower than the actual power and the difference exceeds 10%, it is determined that there is excessive lighting, and the server-side control program generates an optimization instruction to reduce the brightness of the lamps or turn off some lamps; The device fault judgment operation is as follows: the server-side monitoring program regularly obtains the comprehensive status score of the device status assessment model, compares it with the 60-point fault threshold, and generates a fault warning instruction containing the fault device ID and fault type when the score is lower than the threshold.

Citation Information

Patent Citations

  • LED lighting efficiency optimization method and system

    CN119907158A

  • Internet of Things type box-type substation based on online monitoring

    CN120262698A