Intelligent control method and system for explosion-proof ultraviolet lamp based on serial communication
By collecting environmental data and processing it using various algorithms, accurate and adaptive prediction of UV lamp power was achieved, solving the problems of adjustment lag and inaccuracy in existing technologies and improving the accuracy and stability of UV lamp control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-27
- Publication Date
- 2026-03-31
AI Technical Summary
Existing UV lamp control technology cannot accurately and in real time adjust light intensity in complex environments, and cannot respond to dynamic changes in environmental factors such as temperature and humidity, resulting in lag and inaccuracy in adjustment.
By collecting ambient light intensity, temperature, and humidity data, noise smoothing is performed using the Kalman filter algorithm, environmental state features are extracted using the first-order difference method, the complexity level is identified and the correlation weights are calculated using the support vector machine model, power demand is predicted using the neural network model, and correction is performed using the ridge regression algorithm. Finally, the power of the ultraviolet lamp is adjusted by pulse width modulation.
It achieves accurate and adaptive prediction of UV lamp power, improves control precision and stability, reduces prediction errors, and enhances the system's control precision and energy efficiency in complex environments.
Smart Images

Figure CN121194373B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of serial communication technology, and in particular to an intelligent control method and system for explosion-proof ultraviolet lamps based on serial communication. Background Technology
[0002] Currently, ultraviolet lamp control technology is widely used in industrial, medical, and environmental protection fields. Particularly in explosion-proof disinfection or material handling scenarios, it requires precise and real-time adjustment of light intensity based on complex environmental conditions to ensure safe and stable equipment operation and optimized energy efficiency. These environments often involve the interplay of multiple factors such as ambient light intensity, temperature, and humidity, necessitating a comprehensive response capability to dynamic changes in multiple parameters within the control system.
[0003] In one existing technology, an ambient light intensity sensor monitors the ambient light level in real time and transmits the value to a control unit. The control unit stores a lookup table showing the correspondence between light intensity and UV lamp power. When the real-time light intensity falls within a preset range, the system directly uses this lookup table to drive the power output circuit, adjusting the UV lamp's brightness to a corresponding fixed value. Data from temperature and humidity sensors is sent to a separate monitoring module. This module performs safety boundary checks; it only sends a switching signal to the main control system to execute an emergency shutdown of the UV lamp when the temperature or humidity reading exceeds its respective set safety threshold. This technical solution relies on a single light intensity parameter and uses fixed rules for adjustment, making it unable to respond to the complex influence of dynamic changes in environmental factors such as temperature and humidity on light intensity requirements, resulting in adjustment lag and inaccuracies.
[0004] In improved existing technologies, such as CN117939756A, data on light intensity, ultraviolet radiation level, temperature, humidity, and human activity status are collected to assess the status of ultraviolet lamps. The ultraviolet radiation intensity is controlled based on the assessment results. However, it only makes adjustments when the status index is below the threshold, which is not precise enough. Moreover, the assessment formula is fixed and singular, and cannot adapt to the needs of dynamic and complex environments.
[0005] Therefore, existing technologies cannot improve the control precision and stability of ultraviolet lamps in complex environments. Summary of the Invention
[0006] This invention provides a method and system for intelligent control of explosion-proof ultraviolet lamps based on serial communication, so as to improve the control accuracy and stability of ultraviolet lamps in complex environments.
[0007] Firstly, to address the aforementioned technical problems, this invention provides an intelligent control method for explosion-proof ultraviolet lamps based on serial communication, comprising:
[0008] Collect ambient light intensity, temperature, and humidity data to obtain the raw dataset;
[0009] Based on the original dataset, noise filtering and feature extraction are performed to obtain environmental state features;
[0010] Based on the environmental state characteristics, environmental complexity level identification and environmental correlation analysis are performed to obtain environmental correlation weights;
[0011] Based on the environmental correlation weights and environmental state characteristics, the data are input into a pre-built power demand prediction model to predict the power adjustment demand of ultraviolet lamps and obtain the predicted power demand.
[0012] Based on the predicted power demand and the pre-stored historical demand database, power demand correction is performed to obtain optimized power demand;
[0013] Based on the optimized power requirements, adjust the UV lamp power, perform stability verification, and output the final power.
[0014] In one optional implementation, the step of performing noise filtering and feature extraction based on the original dataset to obtain environmental state features includes:
[0015] Based on the original dataset, noise smoothing is performed using the Kalman filter algorithm to obtain the filtered dataset;
[0016] Based on the filtered dataset, the rate of change of light intensity and the standard deviation of temperature are calculated by the first-order difference method, and the range of humidity fluctuation is determined by the range calculation method to obtain the environmental state characteristics.
[0017] In one optional implementation, the step of identifying the environmental complexity level and performing environmental correlation analysis based on the environmental state characteristics to obtain environmental correlation weights includes:
[0018] Based on the environmental state characteristics, the environmental complexity is analyzed using a pre-built support vector machine model to obtain the environmental complexity level;
[0019] When the environmental complexity level exceeds a preset complexity level threshold, an environmental factor correlation analysis is performed based on the environmental state characteristics by calculating the Pearson correlation coefficient to obtain a correlation strength matrix.
[0020] Based on the correlation strength matrix, principal component analysis algorithm is used to perform data dimensionality reduction and principal component extraction to obtain the principal component dataset.
[0021] Based on the principal component dataset, the weights of each principal component are quantified by calculating the variance contribution rate to obtain the environmental association weights.
[0022] When the environmental complexity level is less than or equal to a preset complexity level threshold, environmental association weights are generated based on the environmental state characteristics by calculating the proportion of each parameter in the total parameters.
[0023] In one optional implementation, the process of constructing the power demand prediction model includes:
[0024] Obtain historical environmental correlation weights, historical environmental state characteristics, and historical power requirements;
[0025] The historical environment association weights and the historical environment state features are input into the input layer of the initially constructed neural network model for training, and the predicted demand power output by the output layer of the neural network model is obtained.
[0026] Substitute the predicted power demand and the historical power demand into the loss function to calculate the loss value;
[0027] The gradient of the output layer of the neural network model is calculated based on the loss value, and the gradient is passed forward layer by layer through the chain rule to calculate the gradient of the parameters of each layer and obtain the gradient data.
[0028] Based on the gradient data and the preset learning rate, the parameters of each layer of the neural network model are updated using the gradient descent method.
[0029] The parameters of each layer are iteratively updated until the number of training iterations of the neural network model is greater than a preset number of iterations, or the loss value of the neural network model is less than a preset loss threshold. At this point, the training is considered complete, and a trained power demand prediction model is obtained.
[0030] In one optional implementation, the step of correcting the power demand based on the predicted power demand and a pre-stored historical demand database to obtain an optimized power demand includes:
[0031] Based on the pre-stored historical demand database, the historical demand characteristics are obtained by segmenting the data and extracting statistical features using the sliding window algorithm.
[0032] Based on the historical demand characteristics and the predicted power demand, the correlation strength analysis is performed by calculating the Pearson correlation coefficient to obtain the historical correlation coefficient;
[0033] Based on the historical correlation coefficient and the predicted power demand, power correction is performed using the ridge regression algorithm to obtain the optimized power demand.
[0034] In one optional implementation, adjusting the UV lamp power according to the optimized power requirement, performing stability verification, and outputting the final power includes:
[0035] Based on the optimized power requirements, the output power of the ultraviolet lamp is adjusted using a pulse width modulation method;
[0036] Based on the optimized power requirements and the environmental state characteristics, the response stability delay is calculated using the least squares method to obtain the response stability delay;
[0037] When the response stabilization delay exceeds a preset delay threshold, the optimized power requirement is adjusted using a multivariate adaptive regression spline algorithm until the response stabilization delay is lower than or equal to the preset delay threshold, and the final power is output.
[0038] Secondly, the present invention provides an intelligent control system for explosion-proof ultraviolet lamps based on serial communication, comprising:
[0039] The data acquisition module is used to collect ambient light intensity, temperature, and humidity data to obtain the raw dataset;
[0040] The environmental feature extraction module is used to perform noise filtering and feature extraction based on the original dataset to obtain environmental state features;
[0041] The environmental correlation analysis module is used to identify the environmental complexity level and perform environmental correlation analysis based on the environmental state characteristics to obtain the environmental correlation weight.
[0042] The power prediction module is used to input the environmental correlation weights and environmental state characteristics into a pre-built power demand prediction model to predict the ultraviolet lamp power adjustment demand and obtain the predicted power demand.
[0043] The power optimization module is used to perform power demand correction based on the predicted power demand and the pre-stored historical demand database to obtain optimized power demand.
[0044] The output module is used to adjust the UV lamp power according to the optimized power requirements, perform stability verification, and output the final power.
[0045] Thirdly, the present invention also provides an electronic device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the intelligent control method for explosion-proof ultraviolet lamps based on serial communication as described in any one of the above.
[0046] Fourthly, the present invention also provides a computer-readable storage medium comprising a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute the intelligent control method for explosion-proof ultraviolet lamps based on serial communication as described above.
[0047] Compared with the prior art, the present invention has the following beneficial effects:
[0048] (1) This invention collects ambient light intensity, temperature and humidity data, uses the Kalman filter algorithm for noise smoothing, and combines the first-order difference method to calculate the light intensity change rate, temperature standard deviation and humidity fluctuation range, thereby achieving high-precision extraction of environmental state characteristics and improving the accuracy and reliability of data processing.
[0049] (2) This invention uses a support vector machine model to identify the level of environmental complexity, and adaptively selects Pearson correlation coefficient analysis or parameter proportion calculation according to the level of environmental complexity. It combines principal component analysis to perform data dimensionality reduction and weight quantification to obtain environmental correlation weights, thereby realizing the dynamic capture of the correlation of complex environmental factors. This provides input parameters that can accurately reflect the dynamic differences in the importance of environmental factors for subsequent power prediction, and enhances the situational awareness and adaptive decision-making ability of the control system.
[0050] (3) Based on historical environmental correlation weights and environmental state characteristics, this invention uses a neural network model to predict power demand, which realizes accurate and adaptive prediction of ultraviolet lamp power adjustment demand. It is more refined and closer to actual production, and can adapt to the needs of dynamic and complex environments. At the same time, this invention uses the gradient descent method to optimize model parameters, realize accurate prediction of ultraviolet lamp power adjustment demand, avoid adjustment lag or inaccuracy, and improve energy efficiency and response speed.
[0051] (4) This invention extracts historical demand features through the sliding window algorithm, performs correlation strength analysis by combining the Pearson correlation coefficient, and uses the ridge regression algorithm to correct the predicted power demand, thereby obtaining optimized power demand, reducing the random fluctuations and abnormal deviations that may be generated by a single prediction model, thus obtaining more stable and reliable optimized power demand, improving the accuracy of system output power and robustness in actual operation, effectively reducing prediction errors, and enhancing the system's adjustment accuracy in complex environments. Attached Figure Description
[0052] Figure 1 This is a schematic flowchart of the intelligent control method for explosion-proof ultraviolet lamps based on serial communication provided in the first embodiment of the present invention;
[0053] Figure 2 This is a schematic diagram of the intelligent control system for explosion-proof ultraviolet lamps based on serial communication provided in the second embodiment of the present invention. Detailed Implementation
[0054] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0055] Reference Figure 1 The first embodiment of the present invention provides an intelligent control method for explosion-proof ultraviolet lamps based on serial communication, including the following steps:
[0056] S11: Collect ambient light intensity, temperature, and humidity data to obtain the raw dataset;
[0057] S12, Based on the original dataset, noise filtering and feature extraction are performed to obtain environmental state features;
[0058] S13, Based on the environmental state characteristics, perform environmental complexity level identification and environmental correlation analysis to obtain environmental correlation weights;
[0059] S14. Based on the environmental correlation weights and environmental state characteristics, input them into the pre-built power demand prediction model to predict the ultraviolet lamp power adjustment demand and obtain the predicted power demand.
[0060] S15, Based on the predicted power demand and the pre-stored historical demand database, power demand correction is performed to obtain optimized power demand;
[0061] S16. Based on the optimized power requirements, adjust the UV lamp power, perform stability verification, and output the final power.
[0062] In step S11, ambient light intensity, temperature, and humidity data are collected to obtain the raw dataset.
[0063] Specifically, ambient light intensity data is acquired through a light intensity sensor, ambient temperature data through a temperature sensor, and ambient humidity data through a humidity sensor. These sensors monitor the ambient light intensity, air temperature, and relative humidity in real time, converting analog signals into digital signals and transmitting them to the control unit via a serial communication protocol. The control unit receives sensor data at fixed time intervals and stores the light intensity, temperature, and humidity values in a time series, forming a raw dataset. This raw dataset serves as the basis for subsequent environmental state feature extraction, providing multi-dimensional environmental parameter inputs for intelligent UV lamp control, ensuring the system can comprehensively perceive environmental changes, thereby supporting precise power adjustment decisions.
[0064] In step S12, noise filtering and feature extraction are performed based on the original dataset to obtain environmental state features.
[0065] In one specific implementation, the step of performing noise filtering and feature extraction based on the original dataset to obtain environmental state features includes:
[0066] Based on the original dataset, noise smoothing is performed using the Kalman filter algorithm to obtain the filtered dataset;
[0067] Based on the filtered dataset, the rate of change of light intensity and the standard deviation of temperature are calculated by the first-order difference method, and the range of humidity fluctuation is determined by the range calculation method to obtain the environmental state characteristics.
[0068] Specifically, noise is first filtered out from the original dataset. The original dataset contains raw light intensity values, raw temperature values, and raw humidity values collected in a time series. A Kalman filter algorithm is used to smooth the dataset from noise. The Kalman filter algorithm iterates through two core steps: state prediction and measurement update. In the state prediction step, the current state is predicted based on the state estimate of the system at the previous moment, and the uncertainty of this prediction is calculated. In the measurement update step, the raw light intensity, raw temperature, and raw humidity values collected by the sensors at the current moment are used as observed values and weighted averaged with the predicted values. The weights are determined by the prediction uncertainty and the observation noise covariance. The process noise covariance and observation noise covariance are fixed parameters preset through statistical analysis of historical sensor data, which can be set based on sensor accuracy, for example, 0.5 lux² for light intensity sensors, 0.1°C² for temperature sensors, and 0.2%² for humidity sensors. After recursive calculation by the algorithm, a filtered dataset containing filtered light intensity values, filtered temperature values, and filtered humidity values is output, effectively suppressing random fluctuation noise in the original data.
[0069] Subsequently, feature extraction was performed based on the filtered dataset. For the filtered light intensity value sequence, the first-order difference method was used to calculate the rate of change of light intensity. This calculation involves subtracting the filtered light intensity value from the previous time step from the current time step, and then dividing by the time interval between the two time steps to obtain the rate of change of light intensity, which characterizes the instantaneous trend of light intensity change. For the filtered temperature value sequence, the standard deviation of temperature within a sliding time window was calculated (the sliding window size is 30 sampling points, the time interval is 1 second, the typical value of the rate of change of light intensity is -50 to 50 lux / s, the typical value of the standard deviation of temperature is 0.5-5°C, and the typical value of the humidity fluctuation range is 5%-15%). This standard deviation reflects the degree of fluctuation of ambient temperature within this time period. For the filtered humidity value sequence, the range calculation method was used to determine the humidity fluctuation range. This calculation involves finding the difference between the maximum and minimum filtered humidity values within the same sliding time window; this difference is the humidity fluctuation range, which characterizes the magnitude of humidity change. Finally, the rate of change of light intensity, the standard deviation of temperature, and the humidity fluctuation range together constitute the environmental state features.
[0070] This step, by filtering out noise and extracting dynamic features with clear physical meaning, provides a high-quality and reliable data foundation for subsequent environmental complexity level identification and power prediction, directly improving the accuracy of the system's description of environmental conditions.
[0071] In step S13, based on the environmental state characteristics, environmental complexity level identification and environmental correlation analysis are performed to obtain environmental correlation weights.
[0072] In one specific implementation, the step of identifying the environmental complexity level and performing environmental correlation analysis based on the environmental state characteristics to obtain environmental correlation weights includes:
[0073] Based on the environmental state characteristics, the environmental complexity is analyzed using a pre-built support vector machine model to obtain the environmental complexity level;
[0074] When the environmental complexity level exceeds a preset complexity level threshold, an environmental factor correlation analysis is performed based on the environmental state characteristics by calculating the Pearson correlation coefficient to obtain a correlation strength matrix.
[0075] Based on the correlation strength matrix, principal component analysis algorithm is used to perform data dimensionality reduction and principal component extraction to obtain the principal component dataset.
[0076] Based on the principal component dataset, the weights of each principal component are quantified by calculating the variance contribution rate to obtain the environmental association weights.
[0077] When the environmental complexity level is less than or equal to a preset complexity level threshold, environmental association weights are generated by calculating the proportion of each parameter in the total parameters based on the environmental state characteristics.
[0078] Specifically, firstly, three feature parameters—the rate of change of light intensity, the standard deviation of temperature, and the range of humidity fluctuations—are input into a pre-trained support vector machine (SVM) model. The training process of this SVM model is as follows: historical environmental state feature data containing the rate of change of light intensity, the standard deviation of temperature, and the range of humidity fluctuations are used as training samples. Each sample corresponds to an environmental complexity level label assigned by domain experts based on historical environmental conditions (e.g., classifying environmental complexity into levels 1 to 5). During training, the model solves a convex quadratic programming problem to find a hyperplane that optimally separates samples of different complexity levels, and handles the nonlinear classification problem using a kernel function. After training, the model can output a quantified environmental complexity level value based on the input new environmental state features.
[0079] It should be noted that during the training of the support vector machine model, the radial basis function (RBF) is preferred as the kernel function. The penalty parameter C and the kernel parameter γ are optimized by grid search combined with k-fold cross-validation. The search range is set to C∈[0.1,10] and γ∈[0.01,1] to minimize the classification error. The training data should contain at least 1000 sets of historical environmental state feature samples, and each sample is labeled with a level 1-5 environmental complexity label to ensure the generalization ability of the model.
[0080] The system presets a complexity level threshold, which is determined by statistical analysis of all environmental complexity level values in historical operational data. For example, the 85th percentile of historical environmental complexity level values is calculated and set as the complexity level threshold. The environmental complexity level output by the model is compared with this threshold, and different weight calculation paths are selected based on the comparison results.
[0081] When the environmental complexity level exceeds a preset threshold, it indicates a significant interaction between environmental factors. At this point, Pearson correlation coefficients are calculated based on multiple sets of environmental state characteristics (including light intensity change rate, temperature standard deviation, and humidity fluctuation range) collected at the current time and in adjacent time periods. Specifically, the correlation coefficients between light intensity change rate and temperature standard deviation, light intensity change rate and humidity fluctuation range, and temperature standard deviation and humidity fluctuation range are calculated to obtain a correlation strength matrix describing the degree of linear correlation between the three environmental characteristic parameters.
[0082] It should be noted that the typical Pearson correlation coefficient between the rate of change of light intensity and the standard deviation of temperature is -0.8 to 0.8, and the typical variance contribution rate is 0.7-0.9 for the first principal component.
[0083] Next, principal component analysis (PCA) is applied to this correlation strength matrix. This algorithm uses a linear transformation to convert the correlated original feature parameters (light intensity change rate, temperature standard deviation, humidity fluctuation range) into a set of new, uncorrelated variables, i.e., principal components. These principal components are sorted according to their variance, with the component with the largest variance containing the most significant changes in the original data. The algorithm outputs a principal component dataset containing the scores of these principal components.
[0084] Then, the variance contribution rate of each principal component is calculated based on the principal component dataset. The variance contribution rate refers to the proportion of each principal component's variance in the total variance of all principal components. Based on the magnitude of each principal component's variance contribution rate, they are weighted; that is, principal components with larger variance contribution rates are assigned higher weights. Finally, these weights are mapped back to the contribution of the original feature parameters to form the final environmental correlation weights. This weight set reflects the relative importance of various environmental factors to system decision-making in complex environments.
[0085] When the environmental complexity level is less than or equal to a preset complexity level threshold, it indicates that the environmental state is relatively stable and the correlation between factors is weak. In this case, a simplified weighting strategy is adopted: the proportion of the light intensity change rate, temperature standard deviation, and humidity fluctuation range in the sum of their absolute values is calculated separately. This method directly generates environmental correlation weights.
[0086] This step, by identifying the complexity of the environment and adaptively selecting different weighting analysis strategies, enables the system to accurately capture the deep correlations between factors in complex environments while operating efficiently in simple environments. This provides input parameters that accurately reflect the dynamic differences in the importance of environmental factors for subsequent power prediction, enhancing the situational awareness and adaptive decision-making capabilities of the control system.
[0087] In step S14, the environmental correlation weights and environmental state characteristics are input into a pre-built power demand prediction model to predict the ultraviolet lamp power adjustment demand and obtain the predicted power demand.
[0088] In one specific implementation, the process of constructing the power demand prediction model includes:
[0089] Obtain historical environmental correlation weights, historical environmental state characteristics, and historical power requirements;
[0090] The historical environment association weights and the historical environment state features are input into the input layer of the initially constructed neural network model for training, and the predicted demand power output by the output layer of the neural network model is obtained.
[0091] Substitute the predicted power demand and the historical power demand into the loss function to calculate the loss value;
[0092] The gradient of the output layer of the neural network model is calculated based on the loss value, and the gradient is passed forward layer by layer through the chain rule to calculate the gradient of the parameters of each layer and obtain the gradient data.
[0093] Based on the gradient data and the preset learning rate, the parameters of each layer of the neural network model are updated using the gradient descent method.
[0094] The parameters of each layer are iteratively updated until the number of training iterations of the neural network model is greater than a preset number of iterations, or the loss value of the neural network model is less than a preset loss threshold. At this point, the training is considered complete, and a trained power demand prediction model is obtained.
[0095] Specifically, the power demand prediction model is a pre-trained neural network model. The model is constructed as follows: First, a historical dataset is acquired, containing historical environmental association weights, historical environmental state features, and corresponding historical power demand values determined by actual operation records or expert systems within a historical time period. This historical data serves as the training samples for the model.
[0096] Historical environment association weights and historical environment state features are used as input features and fed into the input layer of a pre-constructed neural network model (all input features should be normalized, for example, using Z-score normalization to make the mean 0 and the standard deviation 1). This neural network model contains one input layer, at least one hidden layer, and one output layer. The number of neurons in the input layer is the same as the dimension of the input features. The hidden layer contains multiple neurons, and the output layer contains one neuron, which outputs a continuous predicted demand power value. Data propagates forward within the model, sequentially passing through weighted summations and nonlinear activation function transformations of neurons in each layer, finally yielding the predicted demand power at the output layer.
[0097] In one implementation, the neural network model employs a fully connected structure. The number of neurons in the input layer matches the dimension of the input features (e.g., 4 dimensions in total for environmental association weights and environmental state features). There are two hidden layers: a first hidden layer with 64 neurons and a second hidden layer with 32 neurons, both using the ReLU activation function. The output layer has one neuron using a linear activation function. The loss function is mean squared error, the optimizer is Adam, and the learning rate is preset to 0.001.
[0098] Subsequently, the predicted power demand output by the model and the actual historical power demand values are substituted into the loss function for calculation. This loss function is used to quantify the degree of difference between the predicted power demand and the historical power demand values.
[0099] Based on the calculated loss value, the gradient of the output layer of the neural network model is calculated using the backpropagation algorithm. Specifically, this involves calculating the partial derivative of the loss function with respect to the output layer. Then, using the chain rule, this gradient is propagated layer by layer forward from the output layer, calculating the gradient of the loss function with respect to parameters such as the connection weights and biases of each neuron in the hidden and input layers, thereby obtaining gradient data containing gradient information for all parameters.
[0100] Based on the obtained gradient data and a manually preset learning rate, the parameters of each layer of the neural network model are updated using gradient descent. The learning rate is a hyperparameter that controls the step size of parameter updates; its specific value is determined through multiple training experiments and observation of the model's convergence performance. Gradient descent iteratively reduces the loss value by subtracting the product of the learning rate and the corresponding gradient from each parameter.
[0101] The above parameter update process is repeated iteratively. The training termination condition is set as follows: when the number of training iterations of the neural network model is greater than a preset number (e.g., 10,000 times), or when the loss value of the neural network model decreases during the iteration process and is less than a preset loss threshold (e.g., 1.0, corresponding to a root mean square error of approximately 1W for power prediction), the model is considered to have completed training, the iteration stops, and a trained power demand prediction model with fixed parameters is obtained; where the power demand unit is watts (W), with a typical range of 50-500W.
[0102] During the model's training and use, the current environment association weights and current environment state features, collected in real time and processed through the aforementioned steps, are used as input to the trained power demand prediction model. The model performs a complete forward propagation calculation: the input data is first multiplied by the connection weights from the input layer to the first hidden layer and a bias term is added. The result is then non-linearly transformed using an activation function (such as the Sigmoid or ReLU function). The transformed result serves as the input to the next hidden layer, and the process of weighted summation and activation function transformation is repeated until the data reaches the output layer. The output layer neurons ultimately output a specific, quantified predicted power demand value. This process is a unidirectional, non-iterative deterministic computation and does not involve updating model parameters.
[0103] This step leverages the powerful nonlinear fitting capabilities of neural networks to learn the complex mapping relationship between environmental factors and power demand, enabling accurate and adaptive prediction of UV lamp power adjustment needs. This overcomes the lag and inaccuracy problems of traditional methods based on fixed rules or lookup tables.
[0104] In step S15, power demand is corrected based on the predicted power demand and the pre-stored historical demand database to obtain optimized power demand.
[0105] In one specific implementation, the step of performing power demand correction based on the predicted power demand and a pre-stored historical demand database to obtain optimized power demand includes:
[0106] Based on the pre-stored historical demand database, the historical demand characteristics are obtained by segmenting the data and extracting statistical features using the sliding window algorithm.
[0107] Based on the historical demand characteristics and the predicted power demand, the correlation strength analysis is performed by calculating the Pearson correlation coefficient to obtain the historical correlation coefficient;
[0108] Based on the historical correlation coefficient and the predicted power demand, power correction is performed using the ridge regression algorithm to obtain the optimized power demand.
[0109] Specifically, the input to this step is the predicted power demand output from step S14, and a pre-stored historical demand database. This historical demand database records environmental state characteristics, environmental correlation weights, and their corresponding actual power demand data over historical time series.
[0110] First, a sliding window algorithm is applied to the historical demand database for data segmentation. This algorithm uses a fixed time period (e.g., the most recent 30 sampling periods) as the window size and slides the window sequentially by a fixed step size (e.g., one sampling period), dividing the continuous historical data into multiple overlapping data segments. For each data segment, statistical features of all historical power demand data within it are extracted. These features include at least the average, standard deviation, maximum, and minimum historical power demand within that window period. These statistical features extracted from each window are then combined to form the historical demand features.
[0111] Next, a correlation strength analysis is performed between the obtained historical demand characteristics and the predicted power demand output in the current step S14. Specifically, the Pearson correlation coefficient is calculated between each statistic (mean, standard deviation, maximum, and minimum) in the historical demand characteristics and the current predicted power demand. This coefficient is calculated based on the numerical series of both over multiple consecutive time windows, and by measuring the degree of linear correlation between them, a set of historical correlation coefficients is output, including the mean correlation coefficient, standard deviation correlation coefficient, maximum correlation coefficient, and minimum correlation coefficient.
[0112] Then, the historical correlation coefficients obtained above and the current predicted power demand are input into the ridge regression algorithm for power correction. In this algorithm, historical correlation coefficients (mean correlation coefficient, standard deviation correlation coefficient, maximum correlation coefficient, and minimum correlation coefficient) are used as independent variables, and the current predicted power demand is used as the target variable for regression analysis. The ridge regression algorithm solves for the regression coefficients by adding an L2 regularization term to the loss function of standard linear regression. The parameter λ (lambda) of this regularization term is a regularization strength coefficient pre-determined on the historical dataset through cross-validation methods (e.g., 10-fold cross-validation, typically with a value of 0.5-2.0). Its purpose is to prevent model overfitting caused by possible multicollinearity among historical correlation coefficients. The algorithm finally outputs a corrected power value, i.e., the optimized power demand.
[0113] This step combines the statistical patterns of recent historical power demand with the instantaneous prediction of the current model, and uses the ridge regression algorithm to smooth and correct the prediction results based on historical experience. This reduces the random fluctuations and abnormal biases that may be generated by a single prediction model, thereby obtaining a more stable and reliable optimized power demand, and improving the accuracy of the system output power and its robustness in actual operation.
[0114] In step S16, the power of the ultraviolet lamp is adjusted according to the optimized power requirement, and a stability check is performed to output the final power.
[0115] In one specific implementation, adjusting the UV lamp power according to the optimized power requirement, performing stability verification, and outputting the final power includes:
[0116] Based on the optimized power requirements, the output power of the ultraviolet lamp is adjusted using a pulse width modulation method;
[0117] Based on the optimized power requirements and the environmental state characteristics, the response stability delay is calculated using the least squares method to obtain the response stability delay;
[0118] When the response stabilization delay exceeds a preset delay threshold, the optimized power requirement is adjusted using a multivariate adaptive regression spline algorithm until the response stabilization delay is lower than or equal to the preset delay threshold, and the final power is output.
[0119] Specifically, firstly, based on the optimized power requirement, the output power of the UV lamp is adjusted using pulse width modulation (PWM). The control unit generates a square wave signal with a fixed frequency. By changing the proportion of the high-level duration of this square wave signal within one cycle to the entire cycle time (i.e., the duty cycle), the average voltage and current supplied to the UV lamp are adjusted. The optimized power requirement is converted into a specific target duty cycle through a pre-established mapping relationship. The power regulation circuit drives the UV lamp according to this target duty cycle, stabilizing its output power at the level required by the optimized power requirement.
[0120] Next, based on the optimized power requirements and environmental characteristics, the response stabilization delay is calculated using the least squares method. The system collects a sequence of monitoring data on the actual output power of the UV lamps over a subsequent period, starting from the moment the power adjustment is initiated. Using time as the independent variable and the measured value of the actual output power as the dependent variable, the power change curve is fitted with a straight line or a simple curve using the least squares method. The response stabilization delay is defined as the time elapsed from the start of the adjustment until the slope of the fitted curve first enters and remains within a stable range close to zero (this range is determined statistically based on historical stable state data). This calculation yields a quantified response stabilization delay value.
[0121] The system presets a latency threshold, which is determined by statistically analyzing stable latency data from a large number of historical successful control records and taking the 90th percentile. The calculated stable response latency is then compared with this latency threshold.
[0122] When the response stabilization delay exceeds a preset delay threshold, it indicates that the system response is too slow or there are oscillations, and the control process is not stable enough. At this time, the optimized power demand obtained in step S15 is adjusted using a multivariate adaptive regression spline algorithm. This algorithm uses the current environmental characteristics (light intensity change rate, temperature standard deviation, humidity fluctuation range) and the current optimized power demand as input variables, and uses case data of stable control (i.e., stabilization delay below the threshold) in the historical database as the training basis. It constructs a nonlinear regression model through a linear combination of piecewise basis functions. This model outputs a correction amount for the current optimized power demand, generating a new, adjusted power demand value. The system then re-executes the above power adjustment and stabilization delay calculation process based on the new power demand value.
[0123] It should be noted that the multivariate adaptive regression spline algorithm has a maximum number of interaction terms of 2, a basis function limit of 20, a smoothing parameter selected through 10-fold cross-validation, and a loss function of mean squared error. The training data uses cases from the historical database with stable response latency below the threshold, including environmental state characteristics and optimized power requirements, to ensure that the adjusted power requirements meet stability requirements.
[0124] This iterative adjustment process will continue until the calculated stable response delay is lower than or equal to a preset delay threshold. At this point, the system will lock the last power demand value used for adjustment and use it as the final power output, while controlling the UV lamp to operate stably at this power level.
[0125] This step, by combining precise actuator control with data-driven stability closed-loop verification, ensures that the system is not only accurate at the static setpoint, but also fast and stable during dynamic adjustment, ultimately outputting a final power that meets optimization requirements and guarantees operational stability, thereby improving the actual control performance of the UV lamp in complex environments.
[0126] It is worth noting that the complexity level threshold and the latency threshold need to be dynamically updated based on real-time historical data. The complexity level threshold is recalculated every 30 days, using the environmental complexity level data within the sliding window to calculate the 85th percentile; the latency threshold is updated every 15 days, using the stable latency of the most recent 100 control records to calculate the 90th percentile; if the data volume is insufficient, the default thresholds are used (complexity level threshold 3.0, latency threshold 1.0 second, where the latency threshold is set according to the system's dynamic response, with a typical value of 0.1-1.0 seconds); the update cycle can be adjusted according to environmental stability, for example, in a rapidly changing environment, the update cycle is shortened to 7 days.
[0127] Reference Figure 2 The second embodiment of the present invention provides an intelligent control system for explosion-proof ultraviolet lamps based on serial communication, comprising:
[0128] The data acquisition module is used to collect ambient light intensity, temperature, and humidity data to obtain the raw dataset;
[0129] The environmental feature extraction module is used to perform noise filtering and feature extraction based on the original dataset to obtain environmental state features;
[0130] The environmental correlation analysis module is used to identify the environmental complexity level and perform environmental correlation analysis based on the environmental state characteristics to obtain the environmental correlation weight.
[0131] The power prediction module is used to input the environmental correlation weights and environmental state characteristics into a pre-built power demand prediction model to predict the ultraviolet lamp power adjustment demand and obtain the predicted power demand.
[0132] The power optimization module is used to perform power demand correction based on the predicted power demand and the pre-stored historical demand database to obtain optimized power demand.
[0133] The output module is used to adjust the UV lamp power according to the optimized power requirements, perform stability verification, and output the final power.
[0134] It should be noted that the intelligent control system for explosion-proof ultraviolet lamps based on serial communication provided in this embodiment of the invention is used to execute all the process steps of the intelligent control method for explosion-proof ultraviolet lamps based on serial communication in the above embodiment. The working principles and beneficial effects of the two are one-to-one, so they will not be described again.
[0135] In summary, this invention discloses an intelligent control method and system for explosion-proof ultraviolet lamps based on serial communication. By collecting ambient light intensity, temperature, and humidity data, and using the Kalman filter algorithm for noise smoothing, combined with the first-order difference method to calculate the rate of change of light intensity, the standard deviation of temperature, and the range of humidity fluctuations, high-precision extraction of environmental state characteristics is achieved, improving the accuracy and reliability of data processing.
[0136] This invention also provides an electronic device. The electronic device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, such as a serial communication-based intelligent control program for explosion-proof ultraviolet lamps. When the processor executes the computer program, it implements the steps described in the various embodiments of the serial communication-based intelligent control method for explosion-proof ultraviolet lamps, for example... Figure 1 Step S11 is shown. Alternatively, when the processor executes the computer program, it implements the functions of each module / unit in the above system embodiments, such as an intelligent control module for explosion-proof ultraviolet lamps based on serial communication.
[0137] For example, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the electronic device.
[0138] The electronic device may be a desktop computer, laptop, handheld computer, or smart tablet, etc. The electronic device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that the above components are merely examples of electronic devices and do not constitute a limitation on the electronic device. It may include more or fewer components than described above, or combine certain components, or different components. For example, the electronic device may also include input / output devices, network access devices, buses, etc.
[0139] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the electronic device, connecting various parts of the electronic device through various interfaces and lines.
[0140] The memory can be used to store the computer programs and / or modules. The processor implements various functions of the electronic device by running or executing the computer programs and / or modules stored in the memory and by calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital card (SD card), flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0141] If the modules / units integrated in the electronic device are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0142] It should be noted that the system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the system embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.
[0143] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.
Claims
1. An intelligent control method for an explosion-proof ultraviolet lamp based on serial communication, characterized in that, The method comprises the following steps: Collecting ambient light intensity, temperature and humidity data to obtain an original data set; According to the original data set, noise filtering and feature extraction are performed to obtain environmental state features; According to the environmental state features, environmental complexity level identification and environmental correlation analysis are performed to obtain environmental correlation weights; According to the environmental correlation weights and the environmental state features, input into a pre-constructed power demand prediction model to predict the power adjustment demand of the ultraviolet lamp, and obtain the predicted power demand; According to the predicted power demand and the pre-stored historical demand database, the power demand is corrected to obtain the optimized power demand; According to the optimized power demand, the power of the ultraviolet lamp is adjusted, and the stability is checked to output the final power; Wherein, according to the environmental state features, environmental complexity level identification and environmental correlation analysis are performed to obtain environmental correlation weights, which comprises: According to the environmental state features, the environmental complexity is analyzed by a pre-constructed support vector machine model to obtain the environmental complexity level; When the environmental complexity level exceeds the preset complexity level threshold, the environmental factor correlation analysis is performed by calculating the Pearson correlation coefficient according to the environmental state features to obtain the correlation strength matrix; According to the correlation strength matrix, data dimension reduction and main component extraction are performed by principal component analysis algorithm to obtain the principal component data set; According to the principal component data set, the main component weight is quantified by calculating the variance contribution rate to obtain the environmental correlation weight; When the environmental complexity level is less than or equal to the preset complexity level threshold, the environmental correlation weight is generated by calculating the proportion of each parameter in the total parameter according to the environmental state features; The training process of the support vector machine model comprises: Using historical environmental state feature data containing light intensity variation rate, temperature standard deviation and humidity fluctuation range as training samples, each sample corresponds to an environmental complexity level label annotated by domain experts according to historical environmental working condition evaluation; In the training process, the model solves a convex quadratic programming problem to find a hyperplane that can optimally separate different complexity level samples, and handles nonlinear classification problems through kernel function; The trained model can output a quantified environmental complexity level value according to the input new environmental state features; When the environmental complexity level exceeds the preset complexity level threshold, the correlation coefficients between the light intensity variation rate and the temperature standard deviation, the light intensity variation rate and the humidity fluctuation range, and the temperature standard deviation and the humidity fluctuation range are calculated to obtain a correlation strength matrix describing the linear correlation degree between the three environmental feature parameters; The weight quantification of each principal component by calculating the variance contribution rate comprises: according to the variance contribution rate of each principal component, the weight quantification is performed, that is, the principal component with larger variance contribution rate is given higher weight; Map these weights back to the contribution of the original feature parameters to form the final environmental correlation weight; When the environment complexity level is less than or equal to a preset complexity level threshold, proportions of the three parameter values, i.e., the light intensity change rate, the temperature standard deviation and the humidity fluctuation range, in the sum of their absolute values are calculated respectively, and the environment correlation weight is directly generated.
2. The intelligent control method for the explosion-proof ultraviolet lamp based on serial communication according to claim 1, characterized in that, The noise filtering and feature extraction are performed according to the original data set to obtain the environment state feature, including: The noise smoothing processing is performed on the original data set by using the Kalman filtering algorithm to obtain a filtered data set; The light intensity change rate and the temperature standard deviation are calculated by using the first-order difference method, and the humidity fluctuation range is determined by using the range calculation method, to obtain the environment state feature. 3.The intelligent control method of the explosion-proof ultraviolet lamp based on serial communication according to claim 1, characterized in that, The construction process of the power demand prediction model includes: obtaining historical environment correlation weights, historical environment state features and historical power demands; the historical environment correlation weights and the historical environment state features are input into the input layer of the initially constructed neural network model for training, and the predicted demand power output by the output layer of the neural network model is obtained; the predicted demand power and the historical power demand are substituted into a loss function to calculate a loss value; the gradient of the output layer output by the neural network model is calculated according to the loss value, and the gradient is transmitted forward layer by layer by using the chain rule to calculate the gradient of each layer parameter, and the gradient data are obtained; the parameters of each layer of the neural network model are updated by using the gradient descent method according to the gradient data and a preset learning rate; each layer parameter is repeatedly updated until the training of the neural network model is completed when the number of training times of the neural network model is greater than a preset number of times, or when the loss value of the neural network model is less than a preset loss threshold, and the trained power demand prediction model is obtained.
4. The intelligent control method for the explosion-proof ultraviolet lamp based on serial communication according to claim 1, characterized in that, The power demand correction is performed according to the predicted power demand and a pre-stored historical demand database to obtain an optimized power demand, including: the historical demand features are obtained by using the sliding window algorithm to segment and extract statistical features from the pre-stored historical demand database; the historical correlation coefficient is obtained by analyzing the correlation strength by calculating the Pearson correlation coefficient according to the historical demand features and the predicted power demand; the optimized power demand is obtained by performing power correction by using the ridge regression algorithm according to the historical correlation coefficient and the predicted power demand.
5. The intelligent control method of the explosion-proof ultraviolet lamp based on serial communication according to claim 1, characterized in that, The ultraviolet lamp power is adjusted according to the optimized power demand, and the stability is verified to output the final power, including: the output power of the ultraviolet lamp is adjusted by using the pulse width modulation method according to the optimized power demand; the response stability delay is calculated by using the least square method according to the optimized power demand and the environment state feature to obtain the response stability delay; when the response stability delay exceeds a preset delay threshold, the optimized power demand is adjusted by using the multivariate adaptive regression spline algorithm until the response stability delay is less than or equal to the preset delay threshold, and the final power is output.
6. An intelligent control system for an explosion-proof ultraviolet lamp based on serial communication, used to implement the intelligent control method for an explosion-proof ultraviolet lamp based on serial communication according to any one of claims 1-5, characterized in that, including: a data acquisition module for acquiring environment light intensity, temperature and humidity data to obtain an original data set; an environment feature extraction module for performing noise filtering and feature extraction according to the original data set to obtain an environment state feature; An environment correlation analysis module is configured to perform environment complexity level identification and environment correlation analysis according to the environment state characteristics, and obtain an environment correlation weight; A power prediction module is configured to input the environment correlation weight and the environment state characteristics into a pre-constructed power demand prediction model, perform ultraviolet lamp power adjustment demand prediction, and obtain a predicted power demand; A power optimization module is configured to perform power demand correction according to the predicted power demand and a pre-stored historical demand database, and obtain an optimized power demand; An output module is configured to adjust the ultraviolet lamp power according to the optimized power demand, perform stability verification, and output a final power.
Citation Information
Patent Citations
Ultraviolet lamp intensity adjustment control system adaptive to environment perception
CN117939756A
Agricultural planting intelligent management method and system based on Internet of Things
CN120069480A