A warehouse environment adaptive regulation method and system based on edge computing
Patent Information
- Application Number
- CN202611036632.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-13
- Publication Date
- 2026-10-27
AI Technical Summary
1.本发明通过超前预判、边缘自主决策与轻量化算法部署,有效提升了系统的响应实时性与鲁棒性。具体为,本发明采用加权最小二乘线性回归对滑动窗口内的历史环境参数进行拟合,计算变化斜率并预测达到安全阈值的剩余时间,相较于现有技术中仅依赖固定阈值报警的被动响应方式,本发明能够基于环境变化趋势进行超前预判,在参数超标前即启动调控措施,有效避免因响应滞后而造成的损耗,从事后补救转变为事前预防。同时,本发明将趋势预测、分级决策与调控逻辑集成于微控制器端,在边缘侧完成实时闭环控制,无需依赖云端下发调控指令,相较于现有端-云”架构,本发明在网络中断时仍可独立运行并自主执行分级调控,有效解决了因网络波动导致系统失效的问题,提升了系统在复杂网络条件下的鲁棒性和可靠性。
Smart Images

Figure CN122984353A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of IoT intelligent control technology, specifically relating to an adaptive control method and system for warehouse environment based on edge computing. Background Technology
[0002] Real-time monitoring and proactive control of the storage environment are key technologies for ensuring the safety of stored goods and reducing losses. With the rapid development of IoT technology, intelligent warehouse management systems based on sensor networks and environmental control equipment are gradually replacing traditional manual inspection methods, improving the level of automation in warehouse management.
[0003] Currently, intelligent warehouse management systems mainly adopt an "edge-cloud" architecture. In this architecture, the cloud acts as a data processing and decision-making center, receiving environmental data uploaded by edge gateways and performing centralized analysis. Control commands are issued from the cloud to on-site execution equipment, realizing unified collection, storage, and visual monitoring of warehouse environment data. This has replaced the traditional manual inspection mode to a certain extent, reducing labor costs.
[0004] However, existing warehousing environment control technologies still have certain shortcomings in practical applications. First, existing systems generally use fixed threshold alarms, triggering alarms or executing control actions only when environmental parameters exceed limits, failing to prevent material losses due to slow environmental degradation. Second, the existing "edge-cloud" architecture of warehouse environment monitoring systems functions normally when the network is available, but once the network is interrupted, the edge devices lack autonomous decision-making capabilities, rendering the entire control system ineffective, especially in remote warehouses, underground warehouses, and other scenarios with poor network coverage. Furthermore, existing systems use fixed-capacity or first-in-first-out (FIFO) data caching strategies. In the event of a network outage, they cannot differentiate the urgency and priority of data based on predictive analysis results. When storage resources are limited, critical abnormal data may be overwritten or lost, and after network recovery, a complete environmental change trajectory cannot be provided to the cloud, affecting historical backtracking and strategy optimization. Finally, existing warehouse environment control systems often use relays or ordinary diodes for primary / backup power switching. This method may experience voltage drops or fluctuations during switching, easily causing low-cost microcontroller units (MCUs) to reset or malfunction, resulting in control interruptions or loss of equipment status, reducing system reliability in power outage scenarios.
[0005] In addition, due to the rapid development of deep learning technology in recent years, some solutions have attempted to introduce time-series prediction algorithms to improve response foresight. However, such high-precision algorithms have a large number of parameters and intensive inference calculations, making them difficult to deploy and run on MCUs commonly used in warehousing scenarios.
[0006] In summary, existing intelligent warehouse management systems have certain shortcomings in terms of response mechanisms, network dependence, algorithm deployment, caching strategies, and power stability. Therefore, how to balance prediction accuracy and deployment feasibility on resource-constrained edge devices, while ensuring reliable data storage and the system's autonomous control capabilities in network outage scenarios, and improving power switching stability, has become an urgent technical challenge. Summary of the Invention
[0007] The purpose of this invention is to provide an adaptive control method and system for warehouse environment based on edge computing. This method can effectively solve the problems of poor real-time performance and network outage failure caused by the reliance on cloud decision-making in existing warehouse management systems. It can also effectively overcome the contradiction that it is difficult to deploy high-precision prediction algorithms under the condition of limited computing power of edge devices. At the same time, it can improve the reliability of data caching and the stability of power switching in network outage scenarios, and realize highly reliable autonomous control of the warehouse environment.
[0008] To achieve the above objectives, the technical solution adopted by this invention is: an adaptive control method for a warehouse environment based on edge computing, comprising the following steps: S1. Collect warehouse environment parameters at the first sampling frequency and store the collected environmental parameters in a local circular storage queue. S2. Weighted least squares linear regression is used to fit the historical data points within the sliding window, the slope of change of environmental parameters is calculated, and the remaining time for environmental parameters to reach the preset safety threshold is predicted based on the slope of change. S3. Real-time monitoring of network connection status, main power supply voltage, and backup battery power; S4. Perform graded control based on the remaining time, network connection status, main power supply voltage, and backup battery power.
[0009] Furthermore, the graded regulation described in step S4 specifically includes: When the remaining time is less than the first threshold, the sampling frequency is adjusted from the first sampling frequency to the second sampling frequency, and the environmental control execution device is activated. When the network connection is interrupted, a corresponding caching strategy is selected based on the remaining time and the backup battery power. When the main power supply fails, the system switches to backup battery power through a MOSFET ideal diode circuit based on a voltage comparator, dynamically adjusts the sampling frequency based on the comparison between the remaining time and the estimated battery life, and selectively shuts down unnecessary peripherals based on the current battery power range. Once the main power and network are restored, data acquisition resumes at the first sampling frequency, all peripherals are turned on, and data is retransmitted to the cloud in timestamp order from the local circular storage queue. When the remaining time is less than the second threshold and the main power supply voltage has ripple, a predictive pre-switching is performed, raising the gate voltage of the backup battery-side MOSFET to the turn-on threshold in advance but not fully turning it on, so that the backup battery-side MOSFET is in a critical turn-on state.
[0010] Furthermore, the caching strategy includes regular caching, dual backup caching, and emergency caching.
[0011] Furthermore, during the network connection interruption, the actual measured values of environmental parameters are obtained, the actual measured values are compared with the predicted values obtained in step S2, the prediction error is calculated, and the model parameters in the weighted least squares linear regression are dynamically adjusted according to the prediction error.
[0012] An edge computing-based adaptive control system for warehouse environment includes: The sensor module is used to collect warehouse environmental parameters at a sampling frequency set by the sampling timer; The microcontroller includes a data storage unit, a trend prediction unit, a comparator network, a power monitoring unit, a hardware state machine, and a sampling timer, and is used to perform weighted least squares linear regression prediction, hierarchical decision-making and control, power state monitoring, and self-optimization operations. The control drive module is used to drive the execution device according to the peripheral action control signal output by the hardware state machine; The communication module has an internal cache management unit, which is used to cache data in a hierarchical manner when the network is interrupted and retransmit it after the network is restored. The cloud is used to receive data uploaded from the edge devices, train a global model, and send optimization parameters to the edge devices. The dual power supply module uses a MOSFET ideal diode circuit to switch to the backup battery when the main power supply fails.
[0013] Furthermore, the cache management unit adopts a dual-pointer circular queue, and the write pointer stops moving in emergency cache mode.
[0014] Furthermore, the data storage unit is an on-chip flash memory circular queue, with a queue depth configured to store at least 24 hours of historical data. Each data point is stored in the form of a structure, containing a timestamp and the corresponding environmental parameter value. When the queue write pointer reaches the end of the queue, it automatically returns to the beginning of the queue to achieve circular storage. The trend prediction unit includes a hardware multiplier, accumulator, and shifter, used to perform weighted least squares linear regression operations to predict the remaining time for environmental parameters to reach a preset safety threshold. The comparator network is used to compare the remaining time output by the trend prediction unit with a preset threshold, and output the comparison result to the hardware state machine; The power monitoring unit includes dual voltage comparators for real-time monitoring of the main power supply voltage and the backup battery voltage, and outputs the main power supply status and the backup battery power range to the hardware state machine. The sampling timer is used to control the sampling frequency of the sensor module, receive the overload value output by the hardware state machine, and periodically trigger sensor data acquisition based on the overload value. The hardware state machine consists of combinational logic and registers. Its inputs are the remaining time comparison result output by the comparator network, the main power status and backup battery power range output by the power monitoring unit, and the network connection status provided by the communication module. Based on the truth table embedded in the hardware logic, it outputs a sampling frequency control signal to the sampling timer, a cache mode control signal to the cache management unit, a peripheral action control signal to the control drive module, and a pre-switching signal to the gate drive circuit of the dual power supply module.
[0015] Furthermore, the sensor module includes a temperature sensor, a humidity sensor, a light sensor, a flame sensor, and a human infrared sensor, which are used to collect temperature, humidity, light intensity, flame signal, and human presence signal in the storage environment, respectively; the raw data collected by each sensor are filtered and amplified before being sent to the microcontroller.
[0016] Furthermore, the dual power supply module includes two N-channel MOSFETs, a dual voltage comparator, and a gate drive circuit; The dual voltage comparator is used to monitor the main power supply voltage and the backup battery voltage in real time. When the main power supply voltage is greater than the backup battery voltage plus 0.1V, the main power MOSFET is turned on; when the main power supply voltage drops below the backup battery voltage, the main power MOSFET is turned off and the backup battery MOSFET is turned on. The pre-switching signal output by the hardware state machine is connected to the gate drive circuit. When the remaining time is less than the second threshold and the main power supply voltage has ripple, the hardware state machine raises the gate voltage of the backup battery side MOSFET to the turn-on threshold in advance but does not fully turn it on, so that the backup battery side MOSFET is in a critical turn-on state. When the main power supply voltage continues to drop below the backup battery voltage, the backup battery side MOSFET is instantly fully turned on, realizing predictive pre-switching.
[0017] The beneficial effects of the above technical solution are as follows: 1. This invention effectively improves the real-time response and robustness of the system through proactive prediction, autonomous edge decision-making, and lightweight algorithm deployment. Specifically, this invention uses weighted least squares linear regression to fit historical environmental parameters within a sliding window, calculates the slope of change, and predicts the remaining time to reach a safe threshold. Compared to the passive response method in existing technologies that rely solely on fixed threshold alarms, this invention can make proactive predictions based on environmental change trends and initiate control measures before parameters exceed limits, effectively avoiding losses caused by response lag and shifting from post-event remediation to pre-event prevention. Simultaneously, this invention integrates trend prediction, hierarchical decision-making, and control logic at the microcontroller end, completing real-time closed-loop control at the edge without relying on cloud-based control commands. Compared to existing edge-cloud architectures, this invention can still operate independently and autonomously execute hierarchical control even during network interruptions, effectively solving the problem of system failure due to network fluctuations and improving the system's robustness and reliability under complex network conditions.
[0018] 2. This invention achieves rapid and smooth power switching through a predictive power switching strategy, effectively improving reliability in power outage scenarios. Specifically, this invention uses a MOSFET ideal diode circuit based on a voltage comparator to switch between the main power supply and the backup battery. When the main power supply voltage is greater than the backup battery voltage plus 0.1V, the main power supply MOSFET is turned on. When the main power supply voltage drops below the backup battery voltage, the switching is completed. Simultaneously, when the remaining time is less than a second threshold and the main power supply voltage exhibits ripple, the hardware state machine raises the gate voltage of the backup battery-side MOSFET to the turn-on threshold in advance, but does not fully turn it on, keeping the backup battery-side MOSFET in a critical conduction state. When the main power supply voltage continues to drop below the backup battery voltage, it instantly turns on completely, shortening the switching delay to sub-microsecond levels. Compared to existing switching schemes using relays or simple diodes, this invention eliminates mechanical contact jitter and diode voltage drop losses, effectively avoiding voltage drops and jitters during switching, and eliminating the risk of MCU reset or program crashes.
[0019] 3. This invention effectively ensures the integrity of data and prediction accuracy during network outages through hierarchical caching and adaptive parameter tuning. Specifically, this invention sets up three hierarchical caching strategies: a regular caching mode, a dual-backup caching mode, and an emergency caching mode. The corresponding caching mode is dynamically selected based on the remaining time and battery power. In the emergency caching mode, existing data is not overwritten; only new data is written to the reserved emergency storage area. Simultaneously, the data storage unit uses an on-chip flash memory circular queue to store historical data. The queue depth is configured to store at least 24 hours of historical data. When the queue write pointer reaches the end, it automatically wraps back to the beginning to achieve circular storage. Furthermore, the model parameters are dynamically adjusted based on the error between the actual measurement values and the predicted values during the network outage. Compared to existing technologies, this invention can prioritize ensuring that critical abnormal data is not overwritten under limited storage resources. After network recovery, it can provide a complete environmental change trajectory to the cloud, providing reliable data support for historical backtracking and strategy optimization. Simultaneously, it enables the prediction model to continuously adapt to the changing characteristics of the storage environment, maintaining long-term prediction accuracy. Attached Figure Description
[0020] Figure 1 This is a block diagram of the overall structure of the system of the present invention; Figure 2 This is a flowchart illustrating the method of the present invention. Detailed Implementation
[0021] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.
[0022] It should be noted that, unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.
[0023] This invention designs an adaptive control system for warehouse environment based on edge computing, the structure of which is as follows: Figure 1 As shown, it includes a sensor module, a microcontroller, a control drive module, a communication module, a cloud platform, and a dual power supply module.
[0024] The sensor module is used to collect warehouse environment parameters, including temperature sensors, humidity sensors, light sensors, flame sensors, and human infrared sensors, which are used to collect temperature, humidity, light intensity, flame signals, and human presence signals in the warehouse environment, respectively. Each sensor collects data according to the sampling frequency set by the sampling timer in the microcontroller. The collected raw data is filtered and amplified before being sent to the microcontroller for further processing.
[0025] The microcontroller serves as the core of edge computing, performing weighted least squares linear regression prediction, hierarchical decision-making and coordinated control, power status monitoring, and self-optimization calculations. Internally, the microcontroller integrates a data storage unit, a trend prediction unit, a comparator network, a power monitoring unit, a hardware state machine, and a sampling timer.
[0026] The data storage unit is used to store the collected environmental parameters. In this embodiment, the data storage unit is implemented using an on-chip flash memory circular queue. The queue depth is configured to store at least 24 hours of historical data. Each data point is stored in the form of a structure, which includes a timestamp and the corresponding environmental parameter value. When the queue write pointer reaches the end of the queue, it automatically returns to the beginning of the queue to achieve circular storage.
[0027] The trend prediction unit includes hardware multipliers, accumulators, and shifters, used to perform weighted least squares linear regression operations to predict the remaining time T before environmental parameters reach a preset safety threshold. remain The trend prediction unit calculates five weighted sums using hardware multipliers, accumulators, and shifters, and obtains T by fitting a linear model. remain The specific calculation method is explained in detail in step S2.
[0028] The comparator network is used to input the remaining time T from the trend prediction unit output. remain The comparison is performed against a preset threshold. In this embodiment, the preset thresholds include a high threshold of 30 minutes, a medium threshold of 10 minutes, and a low threshold of 0 minutes. The comparison result output by the comparator network includes four states: greater than the high threshold, between the high threshold and the medium threshold, between the medium threshold and the low threshold, and less than the low threshold, which are used by the hardware state machine for decision-making.
[0029] The power monitoring unit includes dual voltage comparators for real-time monitoring of the main power supply voltage V. main and backup battery voltage V bat .
[0030] The power monitoring unit outputs a main power status P and a backup battery power range Q. The main power status P is 1 under normal power supply and 0 under power failure. The backup battery power range Q is obtained by comparing the current power level of the backup battery with its total power level. Specifically: when the current power level of the backup battery is greater than 50% of its total power level, it is in the high power range; when the current power level is between 30% and 50% of its total power level, it is in the medium power range; and when the current power level is less than or equal to 30% of its total power level, it is in the low power range.
[0031] The hardware state machine consists of combinational logic and registers, and its input is the T output of the comparator network. remainThe comparison results are compared with the power status P output by the power monitoring unit, the backup battery power range Q, and the network connection status N provided by the communication module. The hardware state machine, based on the truth table embedded in the hardware logic, outputs a sampling frequency control signal to the sampling timer, a buffer mode control signal to the buffer management unit of the communication module, a peripheral action control signal to the control drive module, and a pre-switching signal to the gate drive circuit of the dual power supply module. The truth table is shown in Table 1.
[0032] A sampling timer is used to control the sampling frequency of the sensor module. The sampling timer receives a reload value output from the hardware state machine and periodically triggers sensor data acquisition based on this reload value. In this embodiment, the sampling timer supports four sampling frequencies: a first sampling frequency f1 = 10 seconds / time, a second sampling frequency f2 = 5 seconds / time, a third sampling frequency f3 = 5 seconds / time, and a fourth sampling frequency f4 = 30 seconds / time. Among these, f2 and f3 have the same sampling period, but the subsequent control actions they trigger are different. f2 corresponds to a warning state, activating a low-speed fan for gentle intervention; f3 corresponds to an emergency state, activating a full-speed fan and an audible and visual alarm for emergency intervention.
[0033] The control and drive module is used to drive the execution devices, which include exhaust fans, audible and visual alarms, LED indicator lights, buzzers, dehumidifiers, and blackout curtains. The control and drive module receives peripheral action control signals from the hardware state machine and turns the corresponding execution devices on or off according to the signals.
[0034] The communication module includes an internal cache management unit for hierarchical data caching during network outages and retransmission upon network recovery. The module supports communication methods including WiFi and 4G, and can select the appropriate method to establish a connection with the cloud based on network coverage in the warehouse environment. The cache management unit employs a dual-pointer circular queue to manage the on-chip Flash cache, including read and write pointers.
[0035] The cloud is used to receive all data uploaded from the edge, periodically train the global model, and send optimization parameters to the edge.
[0036] The dual power supply module employs a MOSFET ideal diode circuit, comprising two N-channel MOSFETs (model AO4404), a dual voltage comparator (model LM393), and a gate drive circuit, used to switch to the backup battery when the main power supply fails. Specifically, the dual voltage comparator monitors the main power supply voltage V in real time. main With backup battery voltage V bat When V main Greater than V bat When 0.1V is applied, the main power MOSFET is turned on; when V... main Drop below V batWithin 1 microsecond, the main power MOSFET is turned off and the backup battery MOSFET is turned on. Simultaneously, the pre-switching signal output from the hardware state machine is connected to the gate drive circuit. When T... remain If the main power supply voltage ripples within 5 minutes, the hardware state machine raises the gate voltage of the battery-side MOSFET to the turn-on threshold but does not fully turn it on, keeping the backup battery-side MOSFET in a critical turn-on state; when the main power supply voltage continues to drop below V... bat At that time, the MOSFET on the backup battery side is instantly fully turned on, reducing the switching delay to sub-microsecond level and realizing the predictive pre-switching function.
[0037] Based on the above system, this invention proposes an adaptive control method for the warehousing environment based on edge computing, the flowchart of which is as follows: Figure 2 As shown, the specific steps include: S1. Data Acquisition and Storage The storage environment parameters are collected at a first sampling frequency and stored in a local circular storage queue. Specifically, a sampling timer triggers a collection every 10 seconds. After analog-to-digital conversion, the collected environmental parameters are stored in the on-chip Flash circular queue of the data storage unit in the form of timestamp-value pairs. The circular queue is configured to store at least 24 hours of historical data. When the write pointer reaches the end of the queue, it automatically returns to the beginning position, and new data overwrites old data, thus achieving circular storage.
[0038] S2, Weighted Linear Regression Prediction and Remaining Time Calculation Weighted least squares linear regression is used to fit historical data points within the sliding window, calculate the slope of environmental parameter changes, and predict the remaining time to reach a preset safety threshold; specifically, the trend prediction unit is based on the most recent L historical data points (t) within the sliding window. i ,S i The linear model S = k·t + b is fitted using the exponentially decaying weighted least squares method, where t i S represents the time of the i-th data point. i For t i The corresponding environmental parameter values, k is the slope, and b is the intercept. Weight w i =exp[-α·(Li)], where L is the sliding window length and α is the attenuation coefficient.
[0039] The trend prediction unit calculates the following five weighted sums using an accumulator: S ww =Σw i S wt =Σw i ·t i SwS =Σw i ·S i S wtS =Σw i ·t i ·S i S wt 2 =Σw i ·t i 2 In the formula, S ww S is the sum of the weights. wt S is the weighted sum of weights and time. wS S is the weighted sum of the weights and environmental parameter values. wtS S is a weighted sum of weights and time and environmental parameter values. wt 2 It is a weighted sum of the weights and the square of the time.
[0040] The formula for calculating the slope k is: k=(S ww ·S wtS -S wt ·S wS ) / (S ww ·S wt 2 -S wt 2 ) By solving the equation k·t th +b=S threshold The predicted time of exceeding the standard, t, can be obtained. th Remaining time T remain =t th -t current , among which, S threshold To preset the safety threshold, t current This represents the current time. When k ≤ 0, it indicates that the environmental parameters are not showing an upward trend, the predicted time of exceeding the standard is infinite, and no warning is required.
[0041] Experiments show that the algorithm requires only about 80 multiply-accumulate operations when the window length L=10, and the actual time taken on the ESP32-S3 is less than 100 microseconds.
[0042] S3, Multi-source status monitoring Real-time monitoring of network connection status, main power supply voltage, and backup battery level; the power monitoring unit's dual voltage comparators monitor the main power supply voltage V in real time. main and backup battery voltage V batThe system outputs the main power status P and battery level range Q; the communication module monitors the network connection status N in real time. When the network is online, N=1; when the network is offline, N=0. If the communication module does not receive a response confirmation from the cloud within a preset time, it determines that the network connection is interrupted.
[0043] S4. Hierarchical decision-making and coordinated regulation Based on the remaining time T remain The network connection status N, main power status P, and backup battery power Q are subject to tiered control; specifically, the comparator network will control the remaining time T. remain The comparison result is input into the hardware state machine after being compared with a preset threshold. The hardware state machine simultaneously receives P and Q outputs from the power monitoring unit and N output from the communication module. The hardware state machine makes decisions according to the truth table embedded in the hardware logic, and outputs sampling frequency control signals, buffer mode selection signals, and peripheral action control signals.
[0044] Table 1 Truth Table of Hardware State Machine
[0045] When the remaining time is less than the first threshold (high threshold), the sampling frequency is adjusted from the first sampling frequency to the second sampling frequency, and the environmental control execution device is activated.
[0046] When the network connection is interrupted, a corresponding caching strategy is selected based on the remaining time and the backup battery power. The caching strategy includes three modes: normal caching, dual backup caching, and emergency caching. Specifically, in normal caching mode, the write pointer normally circulates and overwrites old data; in dual backup caching mode, critical data is written to the redundant backup area; in emergency caching mode, the write pointer stops moving and overwriting existing data is prohibited.
[0047] When the main power supply fails, the system switches to backup battery power via a MOSFET ideal diode circuit based on a voltage comparator, dynamically adjusts the sampling frequency based on the comparison between the remaining time and the estimated battery life, and selectively shuts down unnecessary peripherals based on the current battery power range.
[0048] Once the main power and network are restored, the hardware state machine automatically resumes data acquisition at the first sampling frequency and activates all peripherals. The communication module, starting from the read pointer of the cache management unit, retransmits data to the cloud in timestamp order via direct memory access. Simultaneously, the microcontroller analyzes the error between the actual and predicted data during the network outage, dynamically adjusting the attenuation coefficient α and the preset safety threshold in the weighted linear regression to achieve self-optimization.
[0049] When the remaining time is less than the second threshold (5 minutes) and the main power supply voltage has ripple, a predictive pre-switching is performed, raising the gate voltage of the backup battery side MOSFET to the turn-on threshold in advance but not fully turning it on, so that the backup battery side MOSFET is in a critical turn-on state.
[0050] To verify the effectiveness of this invention, three specific scenarios will be described in detail below.
[0051] Scene 1 In this scenario, the upper limit of the safe temperature threshold is set to 28°C, the sampling frequency is f1 = 10 seconds / time, the sliding window is L = 10, and the weight decay factor is α = 0.3.
[0052] Given a measured temperature of 23°C, a weighted linear regression analysis yielded a slope k = 0.098°C / 10 seconds and an intercept b = 22.5°C. Based on this, the predicted time of exceeding the limit, t, can be determined. th =(28-22.5) / 0.098×10≈561 seconds, remaining time T remain ≈8.5 minutes.
[0053] At this point, the hardware state machine switched the sampling frequency to f2 = 5 seconds / time, simultaneously activated a low-speed fan for active cooling, and sent an early warning message to the cloud. Subsequent temperature measurement data showed that the system successfully cooled down after reaching 26°C, verifying the effectiveness of the predictive model and the graded response mechanism.
[0054] Scene 2 Under normal mains power supply conditions, the comparator outputs a high level, controlling the mains power path MOSFET to remain on while simultaneously turning off the backup battery path MOSFET, achieving unidirectional power supply. The hardware state machine monitors the remaining safe time T in real time. remain .
[0055] Upon detecting the current T remain At 4 minutes, the main power supply voltage experienced a momentary fluctuation of about 1%. At this time, the hardware state machine issued a pre-switching trigger signal, which raised the gate drive voltage of the battery-side MOSFET to the turn-on threshold but did not fully turn it on.
[0056] Subsequently, when the main power supply suddenly fails, the comparator completes the logic flip within about 0.8 microseconds, and the battery-side MOSFET is instantly fully turned on based on the pre-biased condition.
[0057] The total delay of the entire switching process was less than 1 microsecond in actual testing. The microcontroller did not detect any voltage drop, and the system continued to run without any reset or restart, demonstrating the high reliability of the invention in power interruption scenarios.
[0058] Scene 3 This scenario simulates the extreme condition of simultaneous network interruption and mains power failure. At the instant of mains power failure, the MOSFET ideal diode circuit switches to backup battery power, and the hardware state machine's sampling frequency is adjusted to f4 = 30 seconds / time. In T remain The system operated normally for 12 minutes when the backup battery was at 60% charge.
[0059] As the battery continues to discharge, the reserve capacity drops to 25% and T remain When the outage lasted longer than 10 minutes, the hardware state machine actively shut down the light sensor and the flame sensor. After the main power was restored, the system automatically switched back to the main power supply and retransmitted 210 historical data entries stored during the network outage from the local cache, which took about 28 seconds. The data was complete and without loss.
[0060] In addition, the system made an online correction to the sliding window weight decay factor, adjusting α from 0.30 to 0.28.
[0061] Finally, it should be noted that any parts of this invention not described in detail are prior art. Those skilled in the art will understand that the above descriptions are merely preferred embodiments of the invention and are not intended to limit the invention. Although the invention has been described in detail with reference to the foregoing examples, those skilled in the art can still modify the technical solutions described in the foregoing examples or make equivalent substitutions for some of the technical features. All modifications and equivalent substitutions made within the spirit and principles of the invention should be included within the scope of protection of the invention.
Claims
1. A method for adaptive control of a warehouse environment based on edge computing, characterized in that, Includes the following steps: S1. Collect warehouse environment parameters at the first sampling frequency and store the collected environmental parameters in a local circular storage queue. S2. Weighted least squares linear regression is used to fit the historical data points within the sliding window, the slope of change of environmental parameters is calculated, and the remaining time for environmental parameters to reach the preset safety threshold is predicted based on the slope of change. S3. Real-time monitoring of network connection status, main power supply voltage, and backup battery power; S4. Perform graded control based on the remaining time, network connection status, main power supply voltage, and backup battery power.
2. The adaptive control method for warehouse environment based on edge computing according to claim 1, characterized in that, The graded regulation described in step S4 specifically includes: When the remaining time is less than the first threshold, the sampling frequency is adjusted from the first sampling frequency to the second sampling frequency, and the environmental control execution device is activated. When the network connection is interrupted, a corresponding caching strategy is selected based on the remaining time and the backup battery power. When the main power supply fails, the system switches to backup battery power through a MOSFET ideal diode circuit based on a voltage comparator, dynamically adjusts the sampling frequency based on the comparison between the remaining time and the estimated battery life, and selectively shuts down unnecessary peripherals based on the current battery power range. Once the main power and network are restored, data acquisition resumes at the first sampling frequency, all peripherals are turned on, and data is retransmitted to the cloud in timestamp order from the local circular storage queue. When the remaining time is less than the second threshold and the main power supply voltage has ripple, a predictive pre-switching is performed, raising the gate voltage of the backup battery-side MOSFET to the turn-on threshold in advance but not fully turning it on, so that the backup battery-side MOSFET is in a critical turn-on state.
3. The adaptive control method for warehouse environment based on edge computing according to claim 1, characterized in that, The caching strategies include regular caching, dual backup caching, and emergency caching.
4. The adaptive control method for warehouse environment based on edge computing according to claim 1, characterized in that, During the network connection interruption, the actual measured values of environmental parameters are obtained, the actual measured values are compared with the predicted values obtained in step S2, the prediction error is calculated, and the model parameters in the weighted least squares linear regression are dynamically adjusted according to the prediction error.
5. A warehouse environment adaptive control system based on edge computing for implementing the method of any one of claims 1-4, characterized in that, include: The sensor module is used to collect warehouse environmental parameters at a sampling frequency set by the sampling timer; The microcontroller includes a data storage unit, a trend prediction unit, a comparator network, a power monitoring unit, a hardware state machine, and a sampling timer, and is used to perform weighted least squares linear regression prediction, hierarchical decision-making and control, power state monitoring, and self-optimization operations. The control drive module is used to drive the execution device according to the peripheral action control signal output by the hardware state machine; The communication module has an internal cache management unit, which is used to cache data in a hierarchical manner when the network is interrupted and retransmit it after the network is restored. The cloud is used to receive data uploaded from the edge devices, train a global model, and send optimization parameters to the edge devices. The dual power supply module uses a MOSFET ideal diode circuit to switch to the backup battery when the main power supply fails.
6. The warehouse environment adaptive control system based on edge computing according to claim 5, characterized in that: The cache management unit uses a dual-pointer circular queue, and the write pointer stops moving in emergency cache mode.
7. The warehouse environment adaptive control system based on edge computing according to claim 5, characterized in that: The data storage unit is an on-chip flash memory circular queue. The queue depth is configured to store at least 24 hours of historical data. Each data point is stored in the form of a structure, which includes a timestamp and the corresponding environmental parameter value. When the queue write pointer reaches the end of the queue, it automatically returns to the beginning of the queue to achieve circular storage. The trend prediction unit includes a hardware multiplier, accumulator, and shifter, used to perform weighted least squares linear regression operations to predict the remaining time for environmental parameters to reach a preset safety threshold. The comparator network is used to compare the remaining time output by the trend prediction unit with a preset threshold, and output the comparison result to the hardware state machine; The power monitoring unit includes dual voltage comparators for real-time monitoring of the main power supply voltage and the backup battery voltage, and outputs the main power supply status and the backup battery power range to the hardware state machine. The sampling timer is used to control the sampling frequency of the sensor module, receive the overload value output by the hardware state machine, and periodically trigger sensor data acquisition based on the overload value. The hardware state machine consists of combinational logic and registers. Its inputs are the remaining time comparison result output by the comparator network, the main power status and backup battery power range output by the power monitoring unit, and the network connection status provided by the communication module. Based on the truth table embedded in the hardware logic, it outputs a sampling frequency control signal to the sampling timer, a cache mode control signal to the cache management unit, a peripheral action control signal to the control drive module, and a pre-switching signal to the gate drive circuit of the dual power supply module.
8. The warehouse environment adaptive control system based on edge computing according to claim 5, characterized in that: The sensor module includes a temperature sensor, a humidity sensor, a light sensor, a flame sensor, and a human infrared sensor, which are used to collect temperature, humidity, light intensity, flame signal, and human presence signal in the storage environment, respectively; the raw data collected by each sensor are filtered and amplified before being sent to the microcontroller.
9. The warehouse environment adaptive control system based on edge computing according to claim 5, characterized in that: The dual power supply module includes two N-channel MOSFETs, a dual voltage comparator, and a gate drive circuit. The dual voltage comparator is used to monitor the main power supply voltage and the backup battery voltage in real time. When the main power supply voltage is greater than the backup battery voltage plus 0.1V, the main power MOSFET is turned on; when the main power supply voltage drops below the backup battery voltage, the main power MOSFET is turned off and the backup battery MOSFET is turned on. The pre-switching signal output by the hardware state machine is connected to the gate drive circuit. When the remaining time is less than the second threshold and the main power supply voltage has ripple, the hardware state machine raises the gate voltage of the backup battery side MOSFET to the turn-on threshold in advance but does not fully turn it on, so that the backup battery side MOSFET is in a critical turn-on state. When the main power supply voltage continues to drop below the backup battery voltage, the backup battery side MOSFET is instantly fully turned on, realizing predictive pre-switching.