Fresh-frozen vegetable production monitoring method and system based on internet of things

CN122340030BActive Publication Date: 2026-08-21SHAANXI CAI ZI TOU FOOD TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202610795024.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-06-04
Publication Date
2026-08-21
Estimated Expiration
2046-06-04

AI Technical Summary

Technical Problem

[0005]本发明提供基于物联网的鲜冻蔬菜生产监控方法及系统,以解决现有技术中拥塞控制滞后、不区分数据紧急度、资源分配不均以及适配性差的技术问题

Benefits of technology

[0020]Further, the weighted average queue length of the routing cache queue is calculated, and the queue length growth gradient is calculated based on the time change of the weighted average queue length, including: obtaining the current instantaneous queue length of the routing cache queue at the arrival of each preset sampling period, using a preset weighting factor to calculate a weighted moving average of the current instantaneous queue length and the historical weighted average queue length of the previous period, updating the current weighted average queue length, calculating the difference between the current weighted average queue length and the historical weighted average queue length, and dividing the difference by the time interval of the preset sampling period to obtain the queue length growth gradient.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122340030B_ABST
    Figure CN122340030B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of internet of things monitoring, and particularly relates to a fresh-frozen vegetable production monitoring method and system based on the internet of things, which comprises the following steps: obtaining a monitoring data packet sent by a sensor on a fresh-frozen vegetable production line, the monitoring data packet carrying a production unit identifier and a data urgency coefficient, calculating a weighted average queue length of a routing cache queue, and calculating a queue length growth gradient based on a time change of the weighted average queue length; obtaining a reference minimum queue threshold value and a reference maximum queue threshold value from a mapping table according to a current process stage, and adjusting the reference minimum queue threshold value and the reference maximum queue threshold value based on an absolute value of a product of the queue length growth gradient and a preset time constant. The application improves the transmission efficiency and reliability of the monitoring network, reduces the risk of packet loss, ensures the priority transmission of emergency data, and takes into account bandwidth fairness and service stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of Internet of Things (IoT) monitoring technology, specifically relating to a method and system for monitoring the production of fresh and frozen vegetables based on IoT. Background Technology

[0002] The large-scale production of fresh and frozen vegetables typically involves multiple continuous and highly demanding processes, including washing, blanching, cooling, quick-freezing, and packaging. To ensure product quality and production safety, numerous IoT sensors are deployed on the production line to monitor process parameters such as temperature, humidity, conveyor belt speed, and equipment status in real time. Different stages of the fresh and frozen vegetable production line are highly unpredictable. For example, in the quick-freezing and blanching stages, the sampling frequency and transmission requirements for temperature and pressure data are high; in the color sorting stage, video traffic is large, and unexpected situations can cause network traffic to exhibit intermittent characteristics. Instantaneous high-concurrency data flows can easily cause congestion in the production monitoring network router's cache queue, leading to network latency and packet loss. The quality control of fresh and frozen vegetables is highly time-sensitive. If critical monitoring data is delayed or lost due to network congestion, the control system will be unable to adjust in time, often directly resulting in damage to the quality of the entire batch of vegetables or even scrapping them. Therefore, ensuring low-latency, high-reliability transmission of monitoring data in the production network and resolving network congestion caused by data bursts have become critical issues that urgently need to be addressed in the production of fresh and frozen vegetables.

[0003] Chinese patent document CN117395166B discloses an IoT-based intelligent agricultural management platform. This platform includes a data collection and preprocessing module, an adaptive data transmission module, a network integration management module, an edge computing processing module, an intelligent traffic control module, a data fusion and analysis module, a user interaction and feedback module, and a system optimization and iteration module. In this patent, the adaptive data transmission module optimizes transmission efficiency and reduces congestion through dynamic packet management and network adjustment; the network integration management module improves data exchange capabilities and network reliability through heterogeneous network fusion and intelligent routing selection; and the edge computing processing module reduces the server load through distributed processing and real-time analysis.

[0004] Active queue management monitors the length of the router's buffer queue and proactively marks or discards data packets with a certain probability before the queue reaches full capacity. This sends congestion notices to the sender in advance, prompting the sender to reduce its transmission rate, maintain low queue latency, and absorb sudden traffic surges. Traditional AQM algorithms cannot adapt to the changing network traffic characteristics at different stages of fresh and frozen vegetable production. When a sudden surge in network traffic causes a sharp increase in queue length, there is no adjustment mechanism based on the queue length growth trend, resulting in lagging congestion control. Existing technologies do not consider the varying urgency of different monitoring data in industrial settings when calculating the probability of marking or discarding data packets. When a sensor in a production unit malfunctions or generates a large amount of concurrent data under special operating conditions, the data packets quickly crowd out the routing buffer queue, causing monitoring data from other normal production units to be excluded, resulting in severe uneven distribution of network resources and queue starvation. Existing active queue management technologies lack the ability to predict queue change trends and cannot balance data urgency with resource fairness among production units, thus failing to meet the monitoring needs of fresh and frozen vegetable production. Summary of the Invention

[0005] This invention provides a method and system for monitoring the production of fresh and frozen vegetables based on the Internet of Things, in order to solve the technical problems of lagging congestion control, failure to distinguish data urgency, uneven resource allocation, and poor adaptability in the prior art.

[0006] In a first aspect, the present invention provides a method for monitoring the production of fresh and frozen vegetables based on the Internet of Things, comprising the following steps: S1. Obtain the monitoring data packets sent by the sensors on the fresh and frozen vegetable production line. The monitoring data packets carry the production unit identifier and data urgency coefficient. Calculate the weighted average queue length of the routing cache queue and calculate the queue length growth gradient based on the time change of the weighted average queue length. S2, based on the current process stage, obtain the baseline minimum queue threshold and the baseline maximum queue threshold from the mapping table, and adjust the baseline minimum queue threshold and the baseline maximum queue threshold based on the absolute value of the product of the queue length growth gradient and the preset time constant to obtain the instantaneous minimum queue threshold and the instantaneous maximum queue threshold. S3. Calculate the basic labeling probability based on the weighted average queue length, the instantaneous minimum queue threshold, and the instantaneous maximum queue threshold. Adjust the basic labeling probability using the data urgency coefficient to obtain the individualized labeling probability. Count the number of data packets in the routing cache queue that have the same production unit identifier as the monitoring data packet. When the number of data packets exceeds the association threshold, increase the individualized labeling probability using the congestion enhancement factor. If it does not exceed the threshold, keep it unchanged and limit the upper limit to 1 to obtain the labeling probability. Generate a random number. When the random number is less than the labeling probability, mark it with a congestion notice and place it in the routing cache queue.

[0007] By acquiring monitoring data packets sent by sensors on the fresh and frozen vegetable production line, calculating the weighted average length and growth gradient of the routing cache queue, dynamically adjusting the queue threshold in conjunction with the process stage, and then calculating the marking probability and implementing congestion marking based on the data urgency and the number of data packets from the same source, it is possible to adapt to changes in production flow in real time, suppress congestion in advance, ensure priority transmission of urgent data, avoid bandwidth hogged by a single production unit, improve the transmission efficiency, reliability and resource allocation fairness of the monitoring network, and reduce the risk of data packet loss and delay.

[0008] Furthermore, based on the absolute value of the product of the queue length growth gradient and the preset time constant, the baseline minimum queue threshold and the baseline maximum queue threshold are adjusted, including: when the queue length growth gradient is positive, the absolute value is subtracted to reduce the threshold, and the adjusted threshold is limited to not being lower than the preset capacity lower limit; when the queue length growth gradient is negative, the absolute value is added to increase the threshold; and when the queue length growth gradient is 0, the threshold remains unchanged.

[0009] The baseline queue threshold is dynamically adjusted based on the positive and negative values ​​of the queue length growth gradient and its absolute value. When the gradient is positive, the threshold is lowered to tighten the cache and suppress congestion. When the gradient is negative, the threshold is raised to loosen the cache and improve bandwidth utilization. When the gradient is 0, the threshold is kept stable and the threshold is limited to not be lower than the capacity limit. This can accurately match the queue change trend, avoid congestion or resource waste caused by unreasonable thresholds, and enhance the rationality and stability of threshold adjustment.

[0010] Further, the weighted average queue length of the routing cache queue is calculated, and the queue length growth gradient is calculated based on the time change of the weighted average queue length, including: obtaining the current instantaneous queue length of the routing cache queue at the arrival of each preset sampling period, using a preset weighting factor to calculate a weighted moving average of the current instantaneous queue length and the historical weighted average queue length of the previous period, updating the current weighted average queue length, calculating the difference between the current weighted average queue length and the historical weighted average queue length, and dividing the difference by the time interval of the preset sampling period to obtain the queue length growth gradient.

[0011] By obtaining the instantaneous queue length through a preset sampling period, updating the weighted average queue length through a weighted moving average, and then calculating the queue length growth gradient by combining the period interval, the instantaneous jitter of the queue length can be smoothed, high-frequency noise can be filtered out, and the speed and trend of queue backlog changes can be accurately captured. This provides reliable and stable basic data for subsequent threshold adjustment and congestion control, and improves the accuracy of congestion prediction.

[0012] Furthermore, based on the current process stage, the baseline minimum queue threshold and baseline maximum queue threshold are obtained from the mapping table, including: extracting the current process stage identifier corresponding to the monitoring data packet as the search keyword; reading the pre-configured process stage and queue threshold mapping table, which contains multiple process stage identifiers and corresponding minimum tolerance parameters and maximum capacity limits; when a matching item is found in the queue threshold mapping table that matches the search keyword, the corresponding minimum tolerance parameter is extracted as the baseline minimum queue threshold, and the corresponding maximum capacity limit parameter is extracted as the baseline maximum queue threshold.

[0013] Using the current process stage identifier as a keyword, the corresponding baseline queue threshold is matched from the preset mapping table. This can adapt to the differences in flow characteristics of different process stages such as cleaning, blanching, and quick-freezing in fresh and frozen vegetable production lines, and achieve accurate matching between queue threshold and production cycle. This avoids the problem that a single threshold cannot adapt to the flow changes of multiple processes, and improves the adaptability of congestion control to different production scenarios.

[0014] Furthermore, the basic labeling probability is calculated based on the weighted average queue length, the instantaneous minimum queue threshold, and the instantaneous maximum queue threshold, including: when the weighted average queue length is less than the instantaneous minimum queue threshold, the basic labeling probability is set to 0; when the weighted average queue length is greater than the instantaneous maximum queue threshold, the basic labeling probability is set to 1; when the weighted average queue length is between the instantaneous minimum queue threshold and the instantaneous maximum queue threshold, the difference between the weighted average queue length and the instantaneous minimum queue threshold is calculated, the difference is divided by the difference between the instantaneous maximum queue threshold and the instantaneous minimum queue threshold, and then multiplied by a preset maximum labeling probability constant to obtain the basic labeling probability.

[0015] The basic marking probability is calculated based on the relationship between the weighted average queue length and the instantaneous threshold. When the queue is idle, the probability is 0 to ensure lossless data transmission. When the queue is overloaded, the probability is 1 to quickly respond to congestion. The probability is linearly calculated in the middle interval to match the degree of congestion. This can achieve accurate matching between the congestion marking probability and the actual congestion state, avoid the congestion response lag or link oscillation caused by fixed probability, and ensure the stability of congestion control.

[0016] Furthermore, the basic labeling probability is weighted and adjusted using the data urgency coefficient to obtain the individualized labeling probability. This includes: parsing the monitoring data packet, obtaining the data urgency coefficient, the data urgency coefficient being normalized to between 0 and 1, subtracting the data urgency coefficient from 1 to calculate the corresponding urgency decay factor, and multiplying the basic labeling probability by the urgency decay factor to obtain the individualized labeling probability.

[0017] Furthermore, the number of data packets in the routing cache queue that have the same production unit identifier as the monitoring data packet is counted. When the number of data packets exceeds the association threshold, the individualized labeling probability is increased using the congestion enhancement factor. When it does not exceed the threshold, it remains unchanged and the upper limit is limited to 1 to obtain the labeling probability. This includes: traversing the current routing cache queue, matching the production unit identifier in the header of each data packet to accumulate the total number of source data packets that have the same production unit identifier as the current monitoring data packet. When the total number of source data packets exceeds the preset association threshold, the difference between the total number of source data packets and the association threshold is calculated. The difference is divided by the preset maximum number of overdue packets constant and then multiplied by the congestion enhancement factor to obtain the penalty probability increment. The individualized labeling probability is added to the penalty probability increment as the calculated value. When the total number of source data packets does not exceed the preset association threshold, the individualized labeling probability is used as the calculated value, and the upper limit of the calculated value is limited to 1 to obtain the labeling probability.

[0018] Secondly, the present invention provides an Internet of Things-based monitoring system for the production of fresh and frozen vegetables, comprising: The calculation module is used to acquire monitoring data packets sent by sensors on the fresh and frozen vegetable production line. The monitoring data packets carry the production unit identifier and data urgency coefficient. The module calculates the weighted average queue length of the routing cache queue and calculates the queue length growth gradient based on the time change of the weighted average queue length. The adjustment module is used to obtain the baseline minimum queue threshold and baseline maximum queue threshold from the mapping table according to the current process stage, and adjust the baseline minimum queue threshold and baseline maximum queue threshold based on the absolute value of the product of the queue length growth gradient and the preset time constant to obtain the instantaneous minimum queue threshold and instantaneous maximum queue threshold. The generation module is used to calculate the basic labeling probability based on the weighted average queue length, the instantaneous minimum queue threshold, and the instantaneous maximum queue threshold. The basic labeling probability is weighted and adjusted using the data urgency coefficient to obtain the individualized labeling probability. The number of data packets in the routing cache queue that have the same production unit identifier as the monitoring data packets is counted. When the number of data packets exceeds the association threshold, the individualized labeling probability is increased using the congestion enhancement factor. If it does not exceed the threshold, it remains unchanged and the upper limit is limited to 1 to obtain the labeling probability. A random number is generated. When the random number is less than the labeling probability, a congestion announcement is made and the data is placed in the routing cache queue.

[0019] Furthermore, based on the absolute value of the product of the queue length growth gradient and the preset time constant, the baseline minimum queue threshold and the baseline maximum queue threshold are adjusted, including: when the queue length growth gradient is positive, the absolute value is subtracted to reduce the threshold, and the adjusted threshold is limited to not being lower than the preset capacity lower limit; when the queue length growth gradient is negative, the absolute value is added to increase the threshold; and when the queue length growth gradient is 0, the threshold remains unchanged.

[0020] Further, the weighted average queue length of the routing cache queue is calculated, and the queue length growth gradient is calculated based on the time change of the weighted average queue length, including: obtaining the current instantaneous queue length of the routing cache queue at the arrival of each preset sampling period, using a preset weighting factor to calculate a weighted moving average of the current instantaneous queue length and the historical weighted average queue length of the previous period, updating the current weighted average queue length, calculating the difference between the current weighted average queue length and the historical weighted average queue length, and dividing the difference by the time interval of the preset sampling period to obtain the queue length growth gradient.

[0021] The beneficial effects are as follows: This invention proposes a proactive queue management method for monitoring the production of fresh and frozen vegetables, which can improve the transmission efficiency and reliability of the monitoring network. By calculating the weighted average queue length and the queue length growth gradient, the baseline queue threshold for different process stages is adjusted in real time. When the queue size expands, the threshold is tightened in advance to proactively suppress congestion; when the queue shrinks, the threshold is relaxed to improve network link utilization, thereby preventing queue overflow and reducing the risk of data packet loss. When calculating the congestion marking probability, a data urgency coefficient is used to assign a differentiated processing mechanism to monitoring data of different importance levels, effectively ensuring the priority and reliable transmission of urgent data such as critical anomaly alarms in the fresh and frozen vegetable production line. By statistically analyzing the data packet size of the same production unit and combining it with a congestion enhancement factor to implement directional constraints, excessive occupation of overall bandwidth resources by a single device node is prevented, ensuring the global fairness and service stability of the collaborative transmission of monitoring data from multiple production stages. Attached Figure Description

[0022] Figure 1 This is a flowchart of a method for monitoring the production of fresh and frozen vegetables based on the Internet of Things.

[0023] Figure 2 This is a diagram illustrating the comparison of queue thresholds at different stages of the process.

[0024] Figure 3 This is a diagram illustrating the number of data packets and the probability of being labeled.

[0025] Figure 4 This is a diagram showing the comparison of packet loss rates across multiple experimental groups. Detailed Implementation

[0026] 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, not all, of the embodiments of the present invention. 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.

[0027] An embodiment of the IoT-based monitoring method for fresh and frozen vegetable production provided by this invention: like Figure 1 As shown, the IoT-based method for monitoring the production of fresh and frozen vegetables includes the following steps: S1 collects monitoring data packets and calculates the queue length and growth gradient.

[0028] Acquire monitoring data packets sent by sensors on the fresh and frozen vegetable production line. The monitoring data packets carry production unit identifiers and data urgency coefficients. Calculate the weighted average queue length of the routing cache queue and calculate the queue length growth gradient based on the time change of the weighted average queue length.

[0029] The system uses the socket interface's receive data function to detect the underlying byte stream data on the Transmission Control Protocol (TCP) port. It then calls the Scapy network packet processing library to deserialize the byte stream into packet objects with a defined field hierarchy. The options field of the Internet Protocol (IP) header is extracted, and the integer production unit identifier and floating-point data urgency coefficient are parsed. An exponentially weighted moving average algorithm is used to calculate the length. The actual number of queue elements at the current time point is obtained and multiplied by a smoothing weight constant. This is then multiplied by the product of 1 minus the smoothing weight constant and the weighted average queue length from the previous time point to obtain the latest weighted average queue length. Finally, the system calls the operating system's microsecond-level timestamp function to obtain the time points of the current and previous calculations. The latest weighted average queue length is subtracted from the previous weighted average queue length, and then divided by the relative time difference between the two to obtain the queue length growth gradient, reflecting the queue backlog rate.

[0030] In one possible embodiment, the weighted average queue length of the routing cache queue is calculated, and the queue length growth gradient is calculated based on the time variation of the weighted average queue length, including: At the arrival of each preset sampling period, the current instantaneous queue length of the routing cache queue is obtained. Using a preset weighting factor, the current instantaneous queue length is calculated as a weighted moving average with the historical weighted average queue length of the previous period. The current weighted average queue length is updated and obtained. The difference between the current weighted average queue length and the historical weighted average queue length is calculated, and the difference is divided by the time interval of the preset sampling period to obtain the queue length growth gradient.

[0031] During system initialization, a high-precision hardware timer is set as the trigger source. At the arrival of each preset sampling period, the actual number of queue elements in the routing cache queue is read from the register of the network interface controller. To balance sensitivity to transient congestion and filtering queue length fluctuations caused by high-frequency noise, the preferred range for the preset sampling period is 5ms to 50ms, and can be precisely set to 10ms for example. After reading the actual number of queue elements, a smoothing filtering algorithm is input, and a weighted moving average is calculated using a preset smoothing weight constant. The specific formula is: Latest weighted average queue length = Actual number of queue elements × Smoothing weight constant + Weighted average queue length of the previous moment × (1 - Smoothing weight constant). The value of the smoothing weight constant determines the forgetting rate of historical queue states, and the preferred range is limited to 0.001 to 0.1.

[0032] To detect the worsening or mitigation trend of queue backlog in real time, the difference between the latest weighted average queue length and the weighted average queue length at the previous time step is calculated in real time. This difference is then divided by the preset sampling period to obtain the accurate queue length growth gradient. For example, when the preset sampling period is set to 10ms and the smoothing weight constant is set to 0.002, if the weighted average queue length at the previous time step was 100 data packets, and the number of actual queue elements read recently surges to 150 data packets, the latest weighted average queue length is calculated to be 100.1 data packets. The difference between the two is calculated as 0.1 data packets, and this difference is divided by the 0.01s sampling interval to obtain the queue length growth gradient at that moment as 10 packets / s.

[0033] S2, dynamically adapts to the process and adjusts the queue threshold in real time.

[0034] Based on the current process stage, the baseline minimum queue threshold and baseline maximum queue threshold are obtained from the mapping table. Based on the absolute value of the product of the queue length growth gradient and the preset time constant, the baseline minimum queue threshold and baseline maximum queue threshold are adjusted. When the gradient is positive, the absolute value is subtracted to decrease the threshold, and the adjusted threshold is limited to not being lower than the preset capacity lower limit. When the gradient is negative, the absolute value is added to increase the threshold. When the gradient is 0, the threshold remains unchanged, thus obtaining the instantaneous minimum queue threshold and instantaneous maximum queue threshold.

[0035] A hash table data structure with strings as keys and double-integers as values ​​is initialized in memory. The baseline minimum queue threshold and baseline maximum queue threshold are obtained by retrieving the corresponding table entry based on the hash value of the current process stage identifier. The absolute value function of floating-point numbers from the mathematical calculation library is called to calculate the positive absolute value of the queue length growth gradient multiplied by a preset time constant. A branch selection structure is used to determine the positive or negative attribute of the gradient. If the gradient value is greater than 0, the absolute value is subtracted from both the baseline minimum and maximum queue thresholds. A value comparison algorithm is then called to compare the result of the subtraction operation with the system's preset lower capacity limit, and the larger value is assigned to the updated threshold variable to prevent threshold underflow. If the gradient value is less than 0, the absolute value is added to both the baseline minimum and maximum queue thresholds for a relaxed threshold. If the gradient value is equal to 0, the addition and subtraction operations are skipped, and the value is directly assigned to the updated threshold variable. The instantaneous minimum and maximum queue thresholds temporarily stored in memory are then output.

[0036] In one possible embodiment, obtaining the baseline minimum queue threshold and the baseline maximum queue threshold from the mapping table according to the current process stage includes: Extract the current process stage identifier corresponding to the monitoring data packet as the search keyword, read the pre-configured process stage and queue threshold mapping table. The queue threshold mapping table contains multiple process stage identifiers and corresponding minimum tolerance parameters and maximum capacity limit parameters. When a matching item is found in the queue threshold mapping table that matches the search keyword, extract the corresponding minimum tolerance parameter as the baseline minimum queue threshold, and extract the corresponding maximum capacity limit parameter as the baseline maximum queue threshold.

[0037] A dedicated parsing buffer is allocated in the packet parsing module to accurately strip the data link layer and network layer headers of monitoring packets entering the router, and extract the current process stage identifier from the specified offset address in the application layer protocol header as the search keyword. Fresh-frozen vegetable production lines typically encompass multiple distinct processing techniques. To adapt to the unique data concurrency characteristics of each process stage, a hash-indexed mapping table between process stages and queue thresholds is pre-built and initialized in memory. Figure 2 As shown, the different baseline queue threshold configurations corresponding to different production process stages reflect the matching relationship between process scenarios and cache thresholds. This mapping table records in detail the current process stage identifiers of core links on the production line, including raw material cleaning, high-temperature blanching, rapid freezing, and intelligent packaging, and statically binds a pair of minimum tolerance parameters and maximum capacity limits to each identifier.

[0038] After extracting the search keywords, the matching engine performs constant-time hash addressing in the mapping table. Once a table entry that perfectly matches the search keywords is found, the corresponding minimum tolerance parameter is read and loaded into the baseline minimum queue threshold register, and the corresponding maximum capacity parameter is loaded into the baseline maximum queue threshold register. When the extracted identifier points to the rapid freezing process stage, due to the concurrent monitoring bursts generated by the liquid nitrogen injection device and multi-point high-frequency temperature sensors in this stage, a larger queue threshold configuration will be extracted from the mapping table, for example, setting the baseline minimum queue threshold to 200 data packets and the baseline maximum queue threshold to 500 data packets. However, if the identifier points to the raw material cleaning stage with a slower data flow, the corresponding extracted baseline minimum and maximum queue thresholds may only be 50 and 150 data packets, respectively, thus achieving seamless integration between the flow control mechanism and the underlying production cycle.

[0039] S3, calculate the labeling probability and implement congestion labeling in stages.

[0040] The basic labeling probability is calculated based on the weighted average queue length, the instantaneous minimum queue threshold, and the instantaneous maximum queue threshold. The basic labeling probability is then adjusted using a data urgency coefficient to obtain an individualized labeling probability. The number of data packets in the routing cache queue that have the same production unit identifier as the monitoring data packets is counted. When the number of data packets exceeds the association threshold, the individualized labeling probability is increased using a congestion enhancement factor. If the number does not exceed the threshold, the probability remains unchanged and the upper limit is limited to 1 to obtain the labeling probability. A random number is generated. When the random number is less than the labeling probability, a congestion announcement is made and the data is placed in the routing cache queue.

[0041] The weighted average queue length is subtracted from the instantaneous minimum queue threshold using arithmetic subtraction. This result is then divided by the range difference between the instantaneous maximum queue threshold and the instantaneous minimum queue threshold. The quotient is multiplied by a pre-defined maximum labeling probability constant to obtain the base labeling probability. A floating-point multiplication instruction is invoked to multiply the extracted data urgency coefficient by this base labeling probability, yielding individualized labeling probabilities with distinct characteristics. A pointer traversal algorithm is then used to sequentially access the doubly linked list memory addresses of the storage routing cache queue. A logical equality operator is used to compare the unit attribute bits carried by the linked list nodes with the production unit identifier of the current data packet. Each match triggers a counter variable increment to complete the data packet count. The greater than relational operator is used to determine whether the counter variable value exceeds the integer association threshold. If it does, a multiplication assignment operation is called to multiply the congestion enhancement factor by the individualized labeling probability to increase the value. If it does not exceed the threshold, the original value of the individualized labeling probability is retained. Then, a minimum value algorithm is called to compare the increased or retained probability data with a constant 1, and the minimum value is taken as the labeling probability after exceeding the limit. Figure 3As shown, this demonstrates the correlation between changes in the number of data packets and the marking probability. By calling the Mason tween pseudo-random number generation algorithm, a double-precision floating-point random number between 0 and 1 is generated. The less-than relational operator is then used to determine if this random number is less than the calculated marking probability. If the condition is met, a bitwise OR operation is called to rewrite the Differentiated Services Code Point (DSC) region of the monitoring data packet header to an explicit congestion notification flag status bit to warn of network congestion. Finally, the tail insertion function in the data structure is called to link the memory reference address of the data packet object to the end of the routing cache queue, queuing it for scheduling and forwarding.

[0042] In one possible embodiment, the base label probability is calculated based on the weighted average queue length, the instantaneous minimum queue threshold, and the instantaneous maximum queue threshold, including: When the weighted average queue length is less than the instantaneous minimum queue threshold, the basic labeling probability is set to 0. When the weighted average queue length is greater than the instantaneous maximum queue threshold, the basic labeling probability is set to 1. When the weighted average queue length is between the instantaneous minimum queue threshold and the instantaneous maximum queue threshold, the difference between the weighted average queue length and the instantaneous minimum queue threshold is calculated. The difference is divided by the difference between the instantaneous maximum queue threshold and the instantaneous minimum queue threshold, and then multiplied by the preset maximum labeling probability constant to obtain the basic labeling probability.

[0043] A set of numerical comparators with multiplexing capabilities is deployed in the probability calculation unit. These comparators receive the currently updated weighted average queue length in real time and compare it in parallel with the instantaneous minimum and maximum queue thresholds generated after gradient correction. Based on the comparison results, three mutually exclusive probability generation logics are executed: if the current weighted average queue length is lower than the instantaneous minimum queue threshold, it indicates sufficient network bandwidth and an idle queue; the drop switch is forcibly disabled, and the basic label probability is set to absolute zero to ensure lossless data transmission. Conversely, if the weighted average queue length exceeds the instantaneous maximum queue threshold, it indicates that the switching node is facing a severe buffer overflow crisis; a hard congestion response is immediately triggered, and the basic label probability is set to the highest value of 1, thereby implementing indiscriminate congestion restrictions on subsequent packets.

[0044] For general congestion where the weighted average queue length falls between two thresholds, a linear incremental calculation module is activated to derive the specific labeling probability. A subtractor calculates the surplus difference between the current weighted average queue length and the instantaneous minimum queue threshold. This difference is then used as the dividend and divided by the range between the instantaneous maximum and minimum queue thresholds to obtain the relative percentage of congestion. This percentage is then multiplied by a preset maximum labeling probability constant. The optimal range for the maximum labeling probability constant is typically set between 0.05 and 0.2 to avoid communication link oscillations caused by excessively high probabilities. Assuming the instantaneous minimum and maximum queue thresholds are 100 and 300 packets respectively, the current weighted average queue length is 150 packets, and the preset maximum labeling probability constant is configured to 0.1, the relative congestion percentage is 0.25. Multiplying this by 0.1 further precisely anchors the calculated base labeling probability to 0.025.

[0045] In one possible embodiment, the individualized label probability is obtained by weighting the base label probability using a data urgency coefficient, including: Parse the monitoring data packets to obtain the data urgency coefficient. The data urgency coefficient is normalized to be between 0 and 1. Subtract the data urgency coefficient from 1 to calculate the corresponding urgency decay factor. Multiply the base labeling probability by the urgency decay factor to obtain the individualized labeling probability.

[0046] A differential service scheduling strategy is integrated into the congestion management module to ensure that critical alarms or control commands in the fresh-frozen vegetable production process are immune to conventional congestion suppression actions. When processing current monitoring data packets, a data urgency coefficient carried in the protocol header is extracted using deep packet inspection technology. This coefficient has been rigorously filtered and normalized to a floating-point number between 0 and 1 at the previous data acquisition end. A higher value indicates a more stringent timeliness requirement for production safety; for example, the data urgency coefficient for compressor overpressure alarms is set much higher than that of conventional temperature and humidity monitoring heartbeat packets.

[0047] After obtaining the coefficient, the data urgency coefficient is subtracted from the constant 1 to generate the corresponding urgency attenuation factor. The previously calculated base marking probability is multiplied by this urgency attenuation factor to obtain the individualized marking probability. When a data packet carries fatal fault information, the data urgency coefficient may be set to 0.9, and the calculated urgency attenuation factor will be only 0.1. Assuming that the base marking probability caused by congestion is 0.05, the individualized marking probability after attenuation adjustment will drop sharply to 0.005, thereby reducing the risk of congestion marking or dropping of this high-priority packet by 90%. If the currently accessed data is a normal device operation status log with an urgency coefficient of only 0.2, the calculated attenuation factor is as high as 0.8, and the obtained individualized marking probability is 0.04. This means that the system still has a high probability of congestion limiting the status log, thus achieving differentiated data protection based on business semantics at the congestion control layer.

[0048] In one possible embodiment, the number of packets with the same production unit identifier as the monitoring packets in the routing cache queue is counted. When the number of packets exceeds an association threshold, the individualized labeling probability is increased using a congestion enhancement factor; otherwise, it remains unchanged and the upper limit is limited to 1, resulting in the labeling probability, including: Traverse the current routing cache queue, match the production unit identifier in the header of each data packet, and accumulate the total number of source data packets with the same production unit identifier as the current monitored data packet. When the total number of source data packets exceeds the preset association threshold, calculate the difference between the total number of source data packets and the association threshold. Divide the difference by the preset maximum number of overdue packets constant and multiply by the congestion enhancement factor to obtain the penalty probability increment. Add the penalty probability increment to the individualized labeling probability as the calculated value. When the total number of source data packets does not exceed the preset association threshold, use the individualized labeling probability as the calculated value and limit the maximum upper limit of the calculated value to 1 to obtain the labeling probability.

[0049] To prevent a faulty or restarting production unit in a fresh-frozen vegetable production line from injecting abnormal concurrent data flows into the network, thus triggering a "micro-flow starvation" effect, a strict micro-flow control isolation mechanism was constructed at the hardware control level. Whenever a new monitoring data packet arrives and is about to be queued, the system not only assesses the overall network congestion status but also quickly traverses the entire routing cache queue, comparing the production unit identifier in the header of each cached data packet to accurately count the number of packets currently waiting to be processed. In this verification phase, a threshold value was input to determine whether the cache resource usage of a single service flow exceeded the limit. The optimal engineering range for this threshold is generally set between 10 and 30 data packets.

[0050] When the number of data packets counted exceeds the preset association threshold, it is determined that the source device is maliciously occupying the shared buffer, and a probability penalty mechanism is triggered for that data packet. First, the specific number of oversent packets is calculated, and this difference is divided by a preset maximum over-limit packet count constant to map it to a non-negative over-limit penalty ratio. This ratio is multiplied by a set congestion enhancement factor, thereby generating a positive penalty probability increment. This penalty probability increment is added to the individualized label probability obtained in the previous stage to obtain a new calculated value. For example, if the number of data packets from a sensor surges to 35 packets, the association threshold is 20 packets, the maximum over-limit packet count constant is set to 50, and the congestion enhancement factor is 0.3, then the penalty increment is 0.09; if the original individualized label probability is 0.05, the calculated value after addition soars to 0.14. If the number of data packets does not exceed the association threshold, the individualized label probability is used as the calculated value. Regardless of the logical branch used, a safety clamp module is applied to the calculated value before output to hard truncate the calculated value to ensure that it does not exceed the upper limit of 1, thereby outputting a label probability that has microscopic fair scheduling significance.

[0051] The experimental conditions were as follows: the underlying switching nodes were equipped with Gigabit Ethernet controllers and hardware timers; the preset sampling period was set to 10ms; and the weighted moving average smoothing constant was set to 0.002. The test traffic simulated a multi-stage mixed concurrent data stream, including overpressure fatal alarm traffic from devices with an urgency level greater than 0.8 and abnormally high-frequency concurrent traffic continuously injected by a faulty sensor. The comparative experimental groups were set as follows: a traditional random early detection baseline group using static thresholds; ablation group one with data urgency attenuation logic removed; ablation group two with packet count penalty mechanism removed; and a complete solution group applying queue length growth gradients, process thresholds, and micro-flow control isolation strategies.

[0052] The differences in core performance among the groups after 500 seconds of full network load, such as Figure 4 As shown, the packet loss rate metrics of each experimental group can be used to compare the performance of this invention with traditional mechanisms and ablation schemes. The baseline group achieved a high-priority alarm packet loss rate of 14.5%, with an average queue latency of 52ms, and the fault source occupied 78% of the global cache space. Ablation group one reduced the average queue latency to 31ms through gradient calculation, but the high-priority alarm packet loss rate remained as high as 7.2%. Ablation group two reduced the high-priority alarm packet loss rate to 1.5%, but the cache occupancy rate was still as high as 66%, causing the transmission of ordinary node status logs to stall. The complete solution group achieved the best performance across all metrics, with a high-priority alarm packet loss rate of only 0.1%, an average queue latency stabilized at 15ms, and the cache occupancy rate of the fault source concurrent flow strictly limited to within 12%.

[0053] The embodiment of the IoT-based fresh-frozen vegetable production monitoring system provided by the present invention includes the following modules: The calculation module is used to acquire monitoring data packets sent by sensors on the fresh and frozen vegetable production line. The monitoring data packets carry the production unit identifier and data urgency coefficient. The module calculates the weighted average queue length of the routing cache queue and calculates the queue length growth gradient based on the time change of the weighted average queue length. The adjustment module is used to obtain the baseline minimum queue threshold and baseline maximum queue threshold from the mapping table according to the current process stage, and adjust the baseline minimum queue threshold and baseline maximum queue threshold based on the absolute value of the product of the queue length growth gradient and the preset time constant to obtain the instantaneous minimum queue threshold and instantaneous maximum queue threshold. The generation module is used to calculate the basic labeling probability based on the weighted average queue length, the instantaneous minimum queue threshold, and the instantaneous maximum queue threshold. The basic labeling probability is weighted and adjusted using the data urgency coefficient to obtain the individualized labeling probability. The number of data packets in the routing cache queue that have the same production unit identifier as the monitoring data packets is counted. When the number of data packets exceeds the association threshold, the individualized labeling probability is increased using the congestion enhancement factor. If it does not exceed the threshold, it remains unchanged and the upper limit is limited to 1 to obtain the labeling probability. A random number is generated. When the random number is less than the labeling probability, a congestion announcement is made and the data is placed in the routing cache queue.

[0054] The above are all preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Therefore, all equivalent changes made in accordance with the structure, shape and principle of the present invention should be covered within the scope of protection of the present invention.

Claims

1. A method for monitoring the production of fresh and frozen vegetables based on the Internet of Things, characterized in that, Includes the following steps: S1. Acquire monitoring data packets sent by sensors on the fresh-frozen vegetable production line. These packets carry production unit identifiers and data urgency coefficients. Calculate the weighted average queue length of the routing buffer queue and calculate the queue length growth gradient based on the time variation of the weighted average queue length. This includes calculating the difference between the current weighted average queue length and the historical weighted average queue length, and dividing the difference by the time interval of the preset sampling period to obtain the queue length growth gradient. S2. Based on the current process stage, obtain the baseline minimum queue threshold and baseline maximum queue threshold from the mapping table. Adjust the baseline minimum queue threshold and baseline maximum queue threshold based on the absolute value of the product of the queue length growth gradient and the preset time constant. This includes subtracting the absolute value to lower the threshold when the queue length growth gradient is positive, while ensuring the adjusted threshold is not lower than the preset capacity lower limit; adding the absolute value to raise the threshold when the queue length growth gradient is negative; and keeping the threshold unchanged when the queue length growth gradient is 0. Obtain the instantaneous minimum queue threshold and instantaneous maximum queue threshold. S3. Calculate the queue length growth gradient based on the weighted average queue length, the instantaneous minimum queue threshold, and the instantaneous maximum queue threshold. The basic labeling probability is calculated, and the basic labeling probability is weighted and adjusted using the data urgency coefficient to obtain the individualized labeling probability. The number of data packets with the same production unit identifier as the monitoring data packet in the routing cache queue is counted. When the number of data packets exceeds the association threshold, the individualized labeling probability is increased using the congestion enhancement factor. If it does not exceed the threshold, it remains unchanged and the upper limit is limited to 1 to obtain the labeling probability. This includes: traversing the current routing cache queue, matching the production unit identifier in the header of each data packet to accumulate the total number of source data packets with the same production unit identifier as the current monitoring data packet. When the total number of source data packets exceeds the preset association threshold, the difference between the total number of source data packets and the association threshold is calculated. The difference is divided by the preset maximum number of overdue packets constant and then multiplied by the congestion enhancement factor to obtain the penalty probability increment. The individualized labeling probability plus the penalty probability increment is used as the calculated value. When the total number of source data packets does not exceed the preset association threshold, the individualized labeling probability is used as the calculated value, and the upper limit of the calculated value is limited to 1 to obtain the labeling probability. A random number is generated. When the random number is less than the labeling probability, a congestion announcement is made and the data is placed in the routing cache queue.

2. The method for monitoring the production of fresh and frozen vegetables based on the Internet of Things according to claim 1, characterized in that, The calculation of the weighted average queue length of the routing cache queue includes: obtaining the current instantaneous queue length of the routing cache queue at the arrival of each preset sampling period, calculating the weighted moving average of the current instantaneous queue length and the historical weighted average queue length of the previous period using a preset weighting factor, and updating the current weighted average queue length.

3. The method for monitoring the production of fresh and frozen vegetables based on the Internet of Things according to claim 1, characterized in that, Based on the current process stage, the baseline minimum queue threshold and baseline maximum queue threshold are obtained from the mapping table. This includes: extracting the current process stage identifier corresponding to the monitoring data packet as the search keyword; reading the pre-configured process stage and queue threshold mapping table, which contains multiple process stage identifiers and their corresponding minimum tolerance parameters and maximum capacity limits; when a matching item is found in the queue threshold mapping table that matches the search keyword, the corresponding minimum tolerance parameter is extracted as the baseline minimum queue threshold, and the corresponding maximum capacity limit parameter is extracted as the baseline maximum queue threshold.

4. The method for monitoring the production of fresh and frozen vegetables based on the Internet of Things according to claim 1, characterized in that, The basic label probability is calculated based on the weighted average queue length, the instantaneous minimum queue threshold, and the instantaneous maximum queue threshold. This includes: setting the basic label probability to 0 when the weighted average queue length is less than the instantaneous minimum queue threshold; setting the basic label probability to 1 when the weighted average queue length is greater than the instantaneous maximum queue threshold; and calculating the difference between the weighted average queue length and the instantaneous minimum queue threshold when the weighted average queue length is between the instantaneous minimum queue threshold and the instantaneous maximum queue threshold. The difference is then divided by the difference between the instantaneous maximum queue threshold and the instantaneous minimum queue threshold, and multiplied by a preset maximum label probability constant to obtain the basic label probability.

5. The method for monitoring the production of fresh and frozen vegetables based on the Internet of Things according to claim 1, characterized in that, The individualized labeling probability is obtained by weighting and adjusting the basic labeling probability using the data urgency coefficient. This includes parsing the monitoring data packet, obtaining the data urgency coefficient (the value of which is normalized to between 0 and 1), subtracting the data urgency coefficient from 1 to calculate the corresponding urgency decay factor, and multiplying the basic labeling probability by the urgency decay factor to obtain the individualized labeling probability.

6. A monitoring system for fresh and frozen vegetable production based on the Internet of Things, characterized in that, include: The calculation module is used to acquire monitoring data packets sent by sensors on the fresh-frozen vegetable production line. These data packets carry production unit identifiers and data urgency coefficients. It calculates the weighted average queue length of the routing cache queue and calculates the queue length growth gradient based on the time change of the weighted average queue length. This includes calculating the difference between the current weighted average queue length and the historical weighted average queue length, and dividing the difference by the time interval of a preset sampling period to obtain the queue length growth gradient. The adjustment module is used to obtain the baseline minimum queue threshold and baseline maximum queue threshold from a mapping table according to the current process stage. Based on the absolute value of the product of the queue length growth gradient and a preset time constant, it adjusts the baseline minimum queue threshold and baseline maximum queue threshold. This includes subtracting the absolute value to lower the threshold when the queue length growth gradient is positive, while ensuring the adjusted threshold is not lower than a preset capacity lower limit; adding the absolute value to raise the threshold when the queue length growth gradient is negative; and keeping the threshold unchanged when the queue length growth gradient is 0, thus obtaining the instantaneous minimum queue threshold and instantaneous maximum queue threshold. The generation module is used to generate the instantaneous minimum queue threshold and instantaneous maximum queue threshold based on the weighted average queue length, the instantaneous minimum queue threshold, and the instantaneous maximum queue threshold. The basic labeling probability is calculated using a large queue threshold. This basic labeling probability is then weighted and adjusted using a data urgency coefficient to obtain an individualized labeling probability. The number of packets in the routing cache queue that share the same production unit identifier as the monitoring packet is counted. When the number of packets exceeds the association threshold, a congestion enhancement factor is used to increase the individualized labeling probability; otherwise, it remains unchanged with an upper limit of 1. The labeling probability is obtained by: traversing the current routing cache queue, matching the production unit identifier in the header of each packet to accumulate the total number of source packets with the same production unit identifier as the current monitoring packet. When the total number of source packets exceeds a preset association threshold, the difference between the total number of source packets and the association threshold is calculated. This difference is divided by a preset maximum excess packet count constant and multiplied by the congestion enhancement factor to obtain a penalty probability increment. The individualized labeling probability is added to the penalty probability increment as the calculated value. When the total number of source packets does not exceed the preset association threshold, the individualized labeling probability is used as the calculated value, with the maximum upper limit of the calculated value limited to 1. A random number is generated. When the random number is less than the labeling probability, a congestion announcement is made and the packet is placed in the routing cache queue.

7. The system according to claim 6, characterized in that, Based on the absolute value of the product of the queue length growth gradient and the preset time constant, the baseline minimum queue threshold and the baseline maximum queue threshold are adjusted, including: when the queue length growth gradient is positive, the absolute value is subtracted to reduce the threshold, and the adjusted threshold is limited to not being lower than the preset capacity lower limit; when the queue length growth gradient is negative, the absolute value is added to increase the threshold; and when the queue length growth gradient is 0, the threshold remains unchanged.

8. The system according to claim 6, characterized in that, The calculation of the weighted average queue length of the routing cache queue and the calculation of the queue length growth gradient based on the time change of the weighted average queue length include: obtaining the current instantaneous queue length of the routing cache queue at the arrival of each preset sampling period; using preset weight factors to calculate the weighted moving average of the current instantaneous queue length and the historical weighted average queue length of the previous period; updating the current weighted average queue length; calculating the difference between the current weighted average queue length and the historical weighted average queue length; and dividing the difference by the time interval of the preset sampling period to obtain the queue length growth gradient.

Citation Information

Patent Citations

  • Smart agriculture management platform based on the Internet of Things

    CN117395166B

  • Intelligent agricultural management platform based on Internet of Things

    CN117395166A

  • Network adaptive congestion control method based on average queue length change trend

    CN117499314A