Method, device and equipment for controlling moisture of cut tobacco with added flavor and storage medium

CN122592994APending Publication Date: 2026-08-18HONGYUN HONGHE TOBACCO (GRP) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610691991.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-19
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0005]本申请的主要目的在于提供一种梗丝加香出口的水分控制方法、装置、设备及存储介质,以解决现有技术中多目标优化片面、多源数据融合不足、动态调整能力缺失、异常响应低效、跨场景适配性弱的问题

Benefits of technology

本方法针对梗丝加香出口水分控制滞后、依赖人工经验、标准偏差偏高的问题,采用三点联动监测与模型预测控制相结合的技术方案,实现了水分的精准预测与自动闭环控制。通过在烘梗丝机出口、梗丝加香机入口、梗丝加香机出口三个关键位置构建前端基准点、中间补偿点、终端校准点的联动监测体系,结合三阶水分偏差预测模型与在线梯度下降算法,有效解决了现有开环控制调节滞后、不合格品占比高的问题,显著降低了水分标准偏差,提升了烟丝感官品质一致性与成品烟支质量稳定性,同时减轻了操作人员劳动强度,降低了质量管控成本。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122592994A_ABST
    Figure CN122592994A_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, equipment, and storage medium for moisture control at the outlet of a tobacco stem flavoring machine, relating to the field of tobacco technology. The method constructs a three-point linkage monitoring system at the outlet of the tobacco stem drying machine, the inlet of the tobacco stem flavoring machine, and the outlet of the tobacco stem flavoring machine. Moisture data from these three points, along with equipment operating parameters, are collected and preprocessed, then input into a third-order moisture deviation prediction model based on a long short-term memory network to output a predicted moisture deviation value. A model predictive control algorithm is used to calculate the drying intensity adjustment, compensation water spray volume, and outlet calibration amount, forming a three-point linkage adjustment command set to drive coordinated equipment action. The predicted deviation is calculated based on feedback data after execution, and the model weight parameters are updated using an online gradient descent algorithm to achieve adaptive model optimization. This invention solves the problems of lag and reliance on manual experience in existing open-loop control, achieving accurate moisture prediction and automatic closed-loop control, reducing the standard deviation of moisture, and improving the consistency of tobacco quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of tobacco technology, and in particular to a method, apparatus, equipment and storage medium for controlling the moisture content of tobacco stems at the flavoring outlet. Background Technology

[0002] The process of adding flavoring to the tobacco stems is one of the core processes in cigarette manufacturing. The stability of the moisture content of the finished product directly affects the consistency of the sensory quality of the tobacco, its suitability for subsequent processing, and the stability of the quality of the finished cigarettes.

[0003] In the current production process, the standard deviation of the moisture content of the tobacco stems after flavoring is too high, which leads to uneven moisture distribution in the tobacco shreds. This can easily cause quality problems such as ash falling off and flameout during the rolling process, while also increasing the difficulty of quality control and cost losses in the production process.

[0004] Currently, the method for controlling the moisture content of the shredded stems with added flavoring is open-loop control, which results in a lag in adjustment time, a high percentage of defective products, and reliance on manual experience for adjustment. This makes it easy for the first half of production to exceed the standard, requiring operators to continuously monitor and frequently adjust parameters, which is labor-intensive and prone to fluctuations due to differences in experience. Summary of the Invention

[0005] The main objective of this application is to provide a method, apparatus, equipment, and storage medium for controlling the moisture content of stalks with added fragrance, in order to solve the problems of one-sided multi-objective optimization, insufficient fusion of multi-source data, lack of dynamic adjustment capability, inefficient abnormal response, and weak cross-scenario adaptability in the prior art.

[0006] To achieve the above objectives, this application provides the following technical solution: A method for controlling the moisture content of shredded stems at the outlet after flavoring, wherein the method is applied to a shredded stem drying machine, a shredded stem flavoring machine, and a moisture meter on the same production line, and the method includes: Step S1: Real-time moisture data and equipment operating parameters are collected at the outlet of the shredded stem drying machine, the inlet of the shredded stem flavoring machine, and the outlet of the shredded stem flavoring machine to obtain front-end reference data, intermediate compensation data, and terminal calibration data, which are then combined to obtain a three-point moisture monitoring dataset. Step S2: Perform timestamp alignment and normalization on the three-point moisture monitoring dataset to obtain a standardized three-point moisture monitoring dataset. Step S3: Based on the standardized three-point moisture monitoring dataset, construct a third-order moisture deviation prediction model that considers the transmission delay from the front-end benchmark point to the intermediate compensation point and the moisture change from the intermediate compensation point to the terminal calibration point, and output a multi-point moisture deviation prediction sequence for a future preset time period to obtain the moisture deviation prediction value. Step S4: Based on the predicted moisture deviation value, the drying intensity adjustment amount of the stem drying machine, the inlet compensation water spray amount of the stem fragrance machine, and the final calibration amount of the outlet of the stem fragrance machine are calculated by the model prediction control algorithm to obtain the three-point linkage adjustment instruction set. Step S5: Drive the drying shredded stem machine, the moisture meter, and the shredded stem flavoring machine to work together according to the three-point linkage adjustment instruction set, and collect the three-point moisture feedback dataset after execution; Step S6: Calculate the prediction deviation based on the three-point moisture feedback dataset after execution, and update the network weight parameters of the third-order moisture deviation prediction model using the online gradient descent algorithm to obtain the iteratively optimized third-order moisture deviation prediction model for use in the next cycle of moisture control.

[0007] Overall beneficial effects of steps S1 to S6: This method addresses the issues of lagging moisture control at the tobacco stem flavoring machine outlet, reliance on manual experience, and high standard deviation. It employs a three-point linkage monitoring and model predictive control approach to achieve accurate moisture prediction and automatic closed-loop control. By constructing a linkage monitoring system at three key locations—the outlet of the tobacco stem drying machine, the inlet of the tobacco stem flavoring machine, and the outlet of the tobacco stem flavoring machine—combining a third-order moisture deviation prediction model and an online gradient descent algorithm, this method effectively solves the problems of lagging adjustment and high defect rate in existing open-loop control. It significantly reduces the moisture standard deviation, improves the consistency of tobacco sensory quality and the stability of finished cigarette quality, while also reducing the workload of operators and lowering quality control costs.

[0008] In this process, step S1 constructs a complete moisture monitoring data chain by collecting data from three locations and matching timestamps, providing a data foundation for subsequent prediction and control. Step S2 eliminates time deviations during material transport and improves data temporal consistency by estimating transmission delays and aligning time. Step S3 constructs a third-order moisture deviation prediction model using a long short-term memory network and attention mechanism, achieving accurate prediction of future moisture deviations and providing reliable predictive input for model predictive control. Step S4 calculates three-point linkage adjustment commands using a model predictive control algorithm, achieving coordinated optimization of drying intensity, compensation spray volume, and outlet calibration volume, avoiding mutual interference from single-point adjustments. Step S5 ensures effective execution of control commands and accurate acquisition of feedback data through coordinated action of drive equipment and feedback acquisition after delay. Step S6 updates model weight parameters using an online gradient descent algorithm, achieving adaptive optimization of the model and improving the system's adaptability to different operating conditions.

[0009] As a further improvement to this application, in step S1, real-time moisture data and equipment operating parameters are collected at the outlet of the shredded stem drying machine, the inlet of the shredded stem flavoring machine, and the outlet of the shredded stem flavoring machine, respectively, to obtain front-end reference data, intermediate compensation data, and terminal calibration data, which are then combined to obtain a three-point moisture monitoring dataset, including: Step S1.1: Collect the drying operation parameters of the drying shreds machine, and collect the real-time moisture value at the outlet of the drying shreds machine using a moisture meter to obtain the front-end reference data; Step S1.2: Collect the fragrance operation parameters of the stem fragrance adding machine, and collect the real-time moisture value at the inlet of the stem fragrance adding machine through a moisture meter to obtain intermediate compensation data; Step S1.3: Collect the output operating parameters of the stem flavoring machine, and collect the real-time moisture value at the outlet of the stem flavoring machine through a moisture meter to obtain terminal calibration data; Step S1.4: Pair the front-end baseline data, the intermediate compensation data, and the terminal calibration data using timestamps as association keys to obtain a three-point moisture monitoring dataset.

[0010] Beneficial effects of steps S1.1 to S1.4: This series of steps involves collecting moisture data and equipment operating parameters at three locations: the outlet of the shredded stem drying machine, the inlet of the shredded stem flavoring machine, and the outlet of the shredded stem flavoring machine. These data are then paired using timestamps as the association key to construct a complete three-point moisture monitoring dataset, providing data support for subsequent time alignment, deviation prediction, and linkage control.

[0011] Specifically, step S1.1 obtains front-end baseline data by collecting the drying operation parameters and real-time moisture value at the outlet of the stem drying machine, providing a basis for judging the output stability of the drying process; step S1.2 obtains intermediate compensation data by collecting the fragrance addition operation parameters and real-time moisture value at the inlet of the stem fragrance addition machine, providing a basis for evaluating the input conditions of the fragrance addition process; step S1.3 obtains terminal calibration data by collecting the discharge operation parameters and real-time moisture value at the outlet of the stem fragrance addition machine, providing a basis for judging whether the final discharge moisture content meets the standard; step S1.4 pairs the three data points using timestamp association keys, establishing a data association relationship between the front-end, intermediate, and terminal points, laying the foundation for subsequent transmission delay estimation and time alignment.

[0012] As a further improvement to this application, step S2 involves performing timestamp alignment and normalization on the three-point moisture monitoring dataset to obtain a standardized three-point moisture monitoring dataset, including: Step S2.1: Based on the timestamps of each data point in the three-point moisture monitoring dataset, calculate the material transfer delay from the outlet of the shredded stem drying machine to the inlet of the shredded stem flavoring machine, and obtain the estimated front-end transfer delay value. Step S2.2: Based on the estimated front-end transmission delay, perform time offset alignment between the front-end baseline data and the intermediate compensation data to obtain a time-aligned dataset; Step S2.3: Perform outlier filtering on the time-aligned dataset to obtain the filtered dataset; Step S2.4: The filtered dataset is subjected to feature scaling using the Min-Max normalization method to obtain a standardized three-point moisture monitoring dataset.

[0013] Beneficial effects of steps S2.1 to S2.4: This series of steps, by aligning and normalizing the three-point moisture monitoring dataset with timestamps, eliminates time deviations caused by material transport delays and numerical differences caused by different units, thereby improving the temporal consistency of the data and the standardization of model input.

[0014] Specifically, step S2.1 calculates the material transfer delay from the outlet of the shredded stem machine to the inlet of the shredded stem flavoring machine to obtain an estimated value of the front-end transfer delay, providing a basis for delay compensation for time alignment; step S2.2 performs time offset alignment on the front-end baseline data and intermediate compensation data based on the estimated front-end transfer delay, eliminating time lag in the material transfer process and improving the time correspondence between the front-end and intermediate data; step S2.3 performs outlier filtering on the time-aligned dataset to remove abnormal data caused by sensor failure or communication interference, improving data quality; step S2.4 performs feature scaling using the Min-Max normalization method to map data of different dimensions to a unified range, avoiding interference from numerical differences on model training and prediction.

[0015] As a further improvement to this application, step S3 involves constructing a third-order moisture deviation prediction model based on the standardized three-point moisture monitoring dataset. This model considers the transmission delay from the front-end reference point to the intermediate compensation point and the moisture change from the intermediate compensation point to the terminal calibration point. The model outputs a multi-point moisture deviation prediction sequence for a preset future duration, yielding the predicted moisture deviation value, including: Step S3.1: Extract the multi-point historical time series sequence divided by a sliding window from the standardized three-point moisture monitoring dataset to obtain the model input sequence; Step S3.2: Input the model input sequence into the third-order moisture deviation prediction model, and perform feature mapping through the input layer of the third-order moisture deviation prediction model to obtain a high-dimensional feature representation; Step S3.3: Input the high-dimensional feature representation into the long short-term memory network layer of the third-order moisture deviation prediction model, and extract the temporal dependency features through the gating mechanism of forget gate, input gate, and output gate to obtain the temporal hidden state; Step S3.4: The temporal hidden state is processed by an attention mechanism to calculate the attention weights of each time step, resulting in weighted temporal features; Step S3.5: Input the weighted temporal features into the fully connected layer and activation function, output the multi-point moisture deviation prediction sequence for a preset time period in the future, and obtain the moisture deviation prediction value.

[0016] Beneficial effects of steps S3.1 to S3.5: This series of steps constructs a third-order moisture deviation prediction model based on long short-term memory networks and attention mechanisms, which enables accurate prediction of moisture deviation at multiple points within a preset time period. This provides reliable predictive input for model predictive control and effectively solves the problem that existing open-loop control cannot predict moisture change trends.

[0017] Specifically, step S3.1 involves dividing the historical time series into multiple points using a sliding window to extract the time series feature segments required for model input, providing input data for model prediction; step S3.2 uses feature mapping through the input layer to convert the original time series data into a high-dimensional feature representation, enhancing the expressive power of the features; step S3.3 uses the forget gate, input gate, and output gate gating mechanism of the Long Short-Term Memory network to extract time series dependency features, capturing the long-term dependency relationship and short-term fluctuation pattern in the moisture data, improving prediction accuracy; step S3.4 uses an attention mechanism to calculate the attention weight of each time step, highlighting the key time steps that have a greater impact on the prediction results, improving the model's ability to focus on key features; and step S3.5 uses a fully connected layer and activation function to output a multi-point moisture deviation prediction sequence, obtaining the predicted values ​​of moisture deviation at the front end, middle, and terminal points within a preset time period, providing a prediction basis for coordinated control.

[0018] As a further improvement to this application, in step S4, based on the predicted moisture deviation value, the drying intensity adjustment amount of the stem drying machine, the inlet compensation water spray amount of the stem fragrance machine, and the final calibration amount of the outlet of the stem fragrance machine are calculated respectively through the model predictive control algorithm to obtain a three-point linkage adjustment instruction set, including: Step S4.1: Determine the current moisture deviation level based on the predicted moisture deviation value, and obtain the deviation level label; Step S4.2: Set the moisture deviation penalty weight and control action change constraint according to the deviation level label to obtain the model prediction control constraint set; Step S4.3: Under the model predictive control constraint set, with the optimization objective of minimizing the weighted sum of accumulated moisture deviation and control energy consumption in the future preset control time domain, the optimal control sequence is solved by quadratic programming to obtain the three-point linkage adjustment command set.

[0019] Beneficial effects of steps S4.1 to S4.3: This series of steps uses a model predictive control algorithm to calculate the adjustment amount of the drying intensity of the shredded stem drying machine, the compensation water spray volume at the inlet of the shredded stem fragrance machine, and the final calibration amount at the outlet of the shredded stem fragrance machine. This achieves coordinated optimization of the three-point linkage adjustment commands, avoids mutual interference of single-point adjustments, and improves the overall coordination and response speed of the control.

[0020] In step S4.1, the current moisture deviation level is determined by the predicted moisture deviation value, providing a level basis for subsequent constraint setting and control strategy selection. In step S4.2, the moisture deviation penalty weight and control action change constraint are set according to the deviation level label, constructing the constraint conditions for model predictive control and balancing control accuracy and control stability. In step S4.3, with the optimization objective of minimizing the weighted sum of accumulated moisture deviation and control energy consumption in the future preset control time domain, the optimal control sequence is solved by quadratic programming, obtaining the optimal adjustment schemes for drying intensity, compensation spray volume, and outlet calibration volume, realizing multi-point coordinated control.

[0021] As a further improvement to this application, step S5 involves driving the drying machine, the moisture meter, and the flavoring machine to work together according to the three-point linkage adjustment instruction set, and collecting the three-point moisture feedback dataset after execution, including: Step S5.1: Extract the drying intensity adjustment amount of the stem drying machine, the inlet compensation water spray amount of the stem fragrance machine, and the final calibration amount of the outlet of the stem fragrance machine from the three-point linkage adjustment instruction set to obtain the classification adjustment parameters; Step S5.2: The classification adjustment parameters are sent to the execution units of the stem drying machine, the moisture meter, and the stem flavoring machine to obtain an execution confirmation signal; Step S5.3: After the execution confirmation signal meets the preset execution delay, real-time moisture data of the stem drying machine outlet, the stem fragrance machine inlet, and the stem fragrance machine outlet are collected again to obtain the three-point moisture feedback dataset after execution.

[0022] Beneficial effects of steps S5.1 to S5.3: This series of steps coordinates the operation of the stem drying machine, moisture meter, and stem flavoring machine, and collects moisture feedback data at three points after execution, ensuring the effective execution of control commands and the accurate acquisition of feedback data, providing feedback basis for closed-loop control and online model updates.

[0023] In step S5.1, the adjustment parameters—drying intensity adjustment, compensation spray volume, and outlet calibration volume—are extracted from the three-point linkage adjustment command set, thus classifying and analyzing the adjustment parameters and providing a parameter basis for issuing them to the corresponding equipment execution units. In step S5.2, the classified adjustment parameters are issued to the execution units of each device and an execution confirmation signal is obtained, ensuring the successful issuance of control commands and the response of the equipment. In step S5.3, after the execution confirmation signal meets the preset execution delay, the real-time moisture data of the three points is collected again to obtain the moisture feedback data after execution, providing feedback input for evaluating the control effect and updating the model online.

[0024] As a further improvement to this application, step S6, calculating the prediction deviation based on the three-point moisture feedback dataset after execution, and updating the network weight parameters of the third-order moisture deviation prediction model using an online gradient descent algorithm, yields an iteratively optimized third-order moisture deviation prediction model for use in the next cycle of moisture control, including: Step S6.1: Compare the terminal calibration data in the three-point moisture feedback dataset after execution with the moisture deviation prediction value, calculate the prediction deviation, and obtain the actual prediction deviation sequence. Step S6.2: Calculate the loss function value based on the actual prediction deviation sequence to obtain the current loss value; Step S6.3: Determine whether the model update condition is triggered based on the current loss value, and obtain the update trigger signal; Step S6.4: When the update trigger signal is in the triggered state, calculate the weight adjustment of each network layer of the third-order moisture deviation prediction model along the gradient descent direction of the loss function to obtain the weight update gradient; Step S6.5: After scaling the weight update gradient with an adaptive learning rate, update the network weight parameters of the third-order moisture deviation prediction model to obtain the iteratively optimized third-order moisture deviation prediction model.

[0025] Beneficial effects of steps S6.1 to S6.5: This series of steps updates the network weight parameters of the third-order moisture deviation prediction model using an online gradient descent algorithm, achieving adaptive optimization of the model, improving the system's adaptability to different working conditions and the characteristics of different batches of stems, and ensuring the stability of prediction accuracy during long-term operation.

[0026] Specifically, step S6.1 calculates the prediction deviation by comparing the terminal calibration data with the moisture deviation prediction value, obtaining the actual prediction deviation sequence, which provides a basis for loss calculation and model update; step S6.2 calculates the loss function value based on the actual prediction deviation sequence, quantifying the prediction error of the current model and providing an objective function for gradient calculation; step S6.3 determines whether the model update condition is triggered based on the current loss value, avoiding the computational overhead and model oscillation caused by frequent updates; step S6.4 calculates the weight adjustment amount along the gradient descent direction of the loss function when the update trigger signal is triggered, obtaining the weight update gradient, which provides an adjustment direction for model parameter update; step S6.5 updates the model weight parameters by scaling the weight update gradient with an adaptive learning rate, realizing dynamic adjustment of the learning rate and improving the stability and speed of model convergence.

[0027] To achieve the above objectives, this application also provides the following technical solutions: A moisture control device for a stem flavoring outlet, the moisture control device being applied to the moisture control method described above, the moisture control device comprising: The moisture monitoring dataset acquisition module is used to collect real-time moisture data and equipment operating parameters at the outlet of the shredded stem drying machine, the inlet of the shredded stem flavoring machine, and the outlet of the shredded stem flavoring machine, respectively, to obtain front-end reference data, intermediate compensation data, and terminal calibration data, which are then merged to obtain a three-point moisture monitoring dataset. The moisture monitoring dataset preprocessing module is used to perform timestamp alignment and normalization on the three-point moisture monitoring dataset to obtain a standardized three-point moisture monitoring dataset. The moisture deviation prediction module is used to construct a third-order moisture deviation prediction model based on the standardized three-point moisture monitoring dataset, taking into account the transmission delay from the front-end reference point to the intermediate compensation point and the moisture change from the intermediate compensation point to the terminal calibration point, and output a multi-point moisture deviation prediction sequence for a preset time period in the future to obtain the moisture deviation prediction value. The linkage adjustment instruction calculation module is used to calculate the drying intensity adjustment amount of the shredded stem drying machine, the inlet compensation spray amount of the shredded stem fragrance machine, and the final calibration amount of the outlet of the shredded stem fragrance machine according to the moisture deviation prediction value, and obtain a three-point linkage adjustment instruction set. The moisture feedback dataset acquisition module is used to drive the drying shredded stem machine, the moisture meter, and the shredded stem flavoring machine to work together according to the three-point linkage adjustment instruction set, and to acquire the three-point moisture feedback dataset after execution. The moisture deviation prediction model iteration module is used to calculate the prediction deviation based on the three-point moisture feedback dataset after execution, and update the network weight parameters of the third-order moisture deviation prediction model through an online gradient descent algorithm to obtain the iteratively optimized third-order moisture deviation prediction model for use in the next cycle of moisture control.

[0028] To achieve the above objectives, this application also provides the following technical solutions: An electronic device includes a processor and a memory coupled to the processor, the memory storing program instructions executable by the processor; when the processor executes the program instructions stored in the memory, it implements the moisture control method for the stalk fragrance outlet as described above.

[0029] To achieve the above objectives, this application also provides the following technical solutions: A computer-readable storage medium storing program instructions, which, when executed by a processor, enable the moisture control method for the aromatized stem outlet as described above. Attached Figure Description

[0030] Figure 1 This is a schematic flowchart illustrating the steps of an embodiment of a method for controlling the moisture content of flavored stems at the outlet according to this application. Figure 2 This is a schematic diagram of the functional modules of a moisture control device for a stem flavoring outlet according to an embodiment of this application; Figure 3 This is a schematic diagram of the structure of an embodiment of the electronic device of this application; Figure 4 This is a schematic diagram of the structure of one embodiment of the storage medium of this application. Detailed Implementation

[0031] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0032] The terms "first," "second," and "third" in this application are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first," "second," or "third" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified. All directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of this application are only used to explain the relative positional relationships and movements between components in a specific orientation (e.g., as shown in the figures). If the specific orientation changes, the directional indications also change accordingly. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.

[0033] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0034] It should be noted that, due to the limited types and number of symbols or letters that can represent specific meanings, for embodiments with many formulas or codes, there may be situations where symbols or letters cannot meet the usage requirements. Therefore, the interpretation of formula symbols in the steps or sub-steps of the embodiments is only valid for the current step or sub-step.

[0035] If the same symbol has different interpretations in different steps or sub-steps, the interpretation in the current step or sub-step shall prevail; if the same symbol appears in different steps or sub-steps, but no interpretation is given in subsequent steps or sub-steps after its first appearance, the interpretation in the first step or sub-step shall be used.

[0036] For example, "i=1,2,...,n" is a writing convention and a well-known meaning. If "i=1,2,...,n" has already appeared once in an embodiment and needs to be used again in formulas with different scenarios and meanings in the future, then the meaning of "i=1,2,...,n" should be interpreted according to the corresponding formulas. If "i=1,2,...,n" is not used for the first time and is changed to symbols or letters with non-well-known meanings, such as "h=1,2,...,q", to avoid repetition, it is more likely to cause confusion, ambiguity, and unclear problems.

[0037] like Figure 1 As shown, this embodiment provides a method for controlling the moisture content of the stem shreds at the flavoring outlet. This method is applied to the stem shred drying machine, stem shred flavoring machine, and moisture meter on the same production line.

[0038] Specifically, the moisture control method includes the following steps: Step S1: Real-time moisture data and equipment operating parameters are collected at the outlet of the shredded stem drying machine, the inlet of the shredded stem flavoring machine, and the outlet of the shredded stem flavoring machine to obtain front-end baseline data, intermediate compensation data, and terminal calibration data, which are then merged to obtain a three-point moisture monitoring dataset.

[0039] Furthermore, step S1 specifically includes the following steps: Step S1.1: Collect the drying operation parameters of the drying shreds machine, and collect the real-time moisture value at the outlet of the drying shreds machine using a moisture meter to obtain the front-end reference data.

[0040] Preferably, the core of this step is to complete the data acquisition at the outlet position of the drying skewer machine, and to obtain the front-end reference data by using an online near-infrared moisture meter and equipment operating parameter acquisition.

[0041] For moisture collection, an online near-infrared moisture meter is used, which is installed in the outlet chute of the drying stalk machine. The measurement parameter is the moisture content of the stalk, the measurement range is 0% to 50%, the accuracy is ±0.2%, and the output frequency is 1 Hz. The moisture meter transmits the real-time moisture value to the centralized control system through a current signal of 4 mA to 20 mA.

[0042] Among them, the operating parameters collected include the drum speed, drum temperature, hot air temperature, and dehumidification opening. The collection frequency is 1 Hz. The range of drum speed is 0 rpm to 20 rpm, the range of drum temperature is 0 degrees Celsius to 200 degrees Celsius, the range of hot air temperature is 0 degrees Celsius to 300 degrees Celsius, and the range of dehumidification opening is 0% to 100%.

[0043] Specifically, for data packaging, the moisture value and four operating parameters under the same timestamp are encapsulated into a single data record. The data record format is {timestamp, moisture value, drum speed, drum temperature, hot air temperature, dehumidification opening}, and this data record is used as the front-end baseline data.

[0044] Preferably, the moisture meter has a measurement accuracy of ±0.2%; the drum speed control accuracy is ±0.1 rpm; and the drum temperature control accuracy is ±1 degree Celsius. For example, during the production of a certain batch, the real-time moisture value measured by the moisture meter at the outlet of the drying skein machine is 18.5%, the drum speed is 12.3 rpm, the drum temperature is 145.6 degrees Celsius, the hot air temperature is 165.2 degrees Celsius, the dehumidification opening is 45.3%, and the timestamp is YYYY-MM-DD-12:00:01-001. This set of data is packaged into front-end reference data.

[0045] Step S1.2: Collect the fragrance operation parameters of the stem fragrance adding machine, and collect the real-time moisture value at the inlet of the stem fragrance adding machine through a moisture meter to obtain intermediate compensation data.

[0046] Preferably, the core of this step is to complete the data acquisition at the inlet position of the stem fragrance machine, and to obtain intermediate compensation data by using an online near-infrared moisture meter and collecting the operating parameters of the fragrance machine.

[0047] For moisture collection, an online near-infrared moisture meter is used, which is installed in the inlet chute of the stem and filament fragrance machine. The measurement parameter is the moisture content of the stem and filament, the measurement range is 0% to 50%, the accuracy is ±0.2%, and the output frequency is 1 Hz. The moisture meter transmits the real-time moisture value to the centralized control system through a current signal of 4 mA to 20 mA.

[0048] Among them, the operating parameters for fragrance addition include the speed of the feed conveyor belt and the rotation speed of the fragrance addition machine drum. The acquisition frequency is 1 Hz, and the range of the feed conveyor belt speed is 0 m / min to 5 m / min, and the range of the rotation speed of the fragrance addition machine drum is 0 rpm to 15 rpm.

[0049] Specifically, for data packaging, the moisture value and two operating parameters under the same timestamp are encapsulated into a single data record. The data record format is {timestamp, moisture value, feed conveyor speed, aroma machine drum speed}, and this data record is used as intermediate compensation data.

[0050] Preferably, the speed control accuracy of the feeding conveyor belt is ±0.01 m / min; the speed control accuracy of the fragrance machine drum is ±0.1 rpm. For example, during the production of a certain batch, the real-time moisture content measured by the moisture meter at the inlet of the fragrance machine is 17.8%, the feeding conveyor belt speed is 2.45 m / min, the speed of the fragrance machine drum is 8.7 rpm, and the timestamp is YYYY-MM-DD-12:00:01-002. This set of data is packaged into intermediate compensation data.

[0051] Step S1.3: Collect the output operating parameters of the stem flavoring machine, and collect the real-time moisture value at the outlet of the stem flavoring machine through a moisture meter to obtain terminal calibration data.

[0052] Preferably, the core of this step is to complete the data acquisition at the outlet position of the stem flavoring machine, and to obtain terminal calibration data by using an online near-infrared moisture meter and collecting the discharge operation parameters.

[0053] For moisture collection, an online near-infrared moisture meter is used, which is installed in the outlet chute of the stem and filament fragrance machine. The measurement parameter is the moisture content of the stem and filament, the measurement range is 0% to 50%, the accuracy is ±0.2%, and the output frequency is 1 Hz. The moisture meter transmits the real-time moisture value to the centralized control system through a current signal of 4 mA to 20 mA.

[0054] Among them, the operating parameters collected include the discharge conveyor belt speed, the fragrance nozzle pressure, and the fragrance proportional valve opening. The collection frequency is 1 Hz. The range of the discharge conveyor belt speed is 0 m / min to 5 m / min, the range of the fragrance nozzle pressure is 0 bar to 5 bar, and the range of the fragrance proportional valve opening is 0% to 100%.

[0055] Specifically, for data packaging, the moisture value and three operating parameters under the same timestamp are packaged into a single data record. The data record format is {timestamp, moisture value, discharge conveyor belt speed, fragrance nozzle pressure, fragrance proportioning valve opening}. This data record is used as terminal calibration data.

[0056] Preferably, the pressure control accuracy of the fragrance nozzle is ±0.01 bar; the opening accuracy of the fragrance proportioning valve is ±0.5%. For example, during the production of a certain batch, the real-time moisture content measured by the moisture meter at the outlet of the stem fragrance machine is 18.2%, the discharge conveyor belt speed is 2.38 m / min, the fragrance nozzle pressure is 2.15 bar, the opening of the fragrance proportioning valve is 62.5%, and the timestamp is YYYY-MM-DD-12:00:01-003. This set of data is packaged into terminal calibration data.

[0057] Step S1.4: Pair the front-end baseline data, the intermediate compensation data, and the terminal calibration data using timestamps as association keys to obtain a three-point moisture monitoring dataset.

[0058] Preferably, the core of this step is to complete the pairing and merging of three data points, and to construct a three-point moisture monitoring dataset through timestamp association and integrity verification.

[0059] Specifically, for timestamp association, the timestamp field is extracted from the front-end baseline data, intermediate compensation data, and terminal calibration data. Three data points with timestamp differences within ±0.5 seconds are identified as data collected at the same time and paired. If a data point cannot find a corresponding point within the ±0.5-second window, the data is marked as unpaired data and temporarily stored.

[0060] For integrity verification, each successfully paired data set should include the moisture content of the front-end baseline data and four operating parameters, the moisture content of the intermediate compensation data and two operating parameters, and the moisture content of the terminal calibration data and three operating parameters. If any type of parameter is missing, the set is marked as incomplete data and discarded.

[0061] For data merging, three data points that are successfully paired and pass the integrity verification are merged into a single complete record. The format of the complete record is {timestamp, front-end moisture value, front-end operating parameters, intermediate moisture value, intermediate operating parameters, terminal moisture value, terminal operating parameters}. All complete records are arranged in chronological order to obtain the three-point moisture monitoring dataset.

[0062] For unpaired data, the unpaired data is temporarily stored in a buffer and re-attempted to pair after subsequent supplementary data arrives. If pairing fails after more than 30 seconds, the data is discarded.

[0063] Preferably, the timestamp pairing tolerance is ±0.5 seconds; the waiting timeout for unpaired data is 30 seconds. For example, in a certain batch of production, the front-end reference data timestamp is 12:00:01.000, the intermediate compensation data timestamp is 12:00:01.200, and the terminal calibration data timestamp is 12:00:01.400. The maximum time difference is 0.4 seconds. Within the 0.5-second tolerance range, it is determined to be a valid pairing, and a complete three-point moisture monitoring data record is obtained by merging them.

[0064] Beneficial effects of steps S1.1 to S1.4: This series of steps involves collecting moisture data and equipment operating parameters at three locations: the outlet of the shredded stem drying machine, the inlet of the shredded stem flavoring machine, and the outlet of the shredded stem flavoring machine. These data are then paired using timestamps as the association key to construct a complete three-point moisture monitoring dataset, providing data support for subsequent time alignment, deviation prediction, and linkage control.

[0065] Specifically, step S1.1 obtains front-end baseline data by collecting the drying operation parameters and real-time moisture value at the outlet of the stem drying machine, providing a basis for judging the output stability of the drying process; step S1.2 obtains intermediate compensation data by collecting the fragrance addition operation parameters and real-time moisture value at the inlet of the stem fragrance addition machine, providing a basis for evaluating the input conditions of the fragrance addition process; step S1.3 obtains terminal calibration data by collecting the discharge operation parameters and real-time moisture value at the outlet of the stem fragrance addition machine, providing a basis for judging whether the final discharge moisture content meets the standard; step S1.4 pairs the three data points using timestamp association keys, establishing a data association relationship between the front-end, intermediate, and terminal points, laying the foundation for subsequent transmission delay estimation and time alignment.

[0066] Step S2: Perform timestamp alignment and normalization on the three-point moisture monitoring dataset to obtain a standardized three-point moisture monitoring dataset.

[0067] Furthermore, step S2 specifically includes the following steps: Step S2.1: Based on the timestamps of each data point in the three-point moisture monitoring dataset, calculate the material transfer delay from the outlet of the skewer drying machine to the inlet of the skewer flavoring machine to obtain the estimated front-end transfer delay value.

[0068] Preferably, the core of this step is to calculate the material transfer delay time, and to obtain the estimated value of the front-end transfer delay by averaging the timestamp differences within the sliding window.

[0069] Specifically, for timestamp extraction, the timestamps of the shredded stem drying machine outlet and the shredded stem flavoring machine inlet are extracted from the three-point moisture monitoring dataset. These timestamps are then paired to form a set of timestamp pairs, with each pair containing the outlet timestamp. With entry timestamp .

[0070] For delayed calculations, 10 consecutive timestamp pairs are taken, and the timestamp difference between each pair is calculated. Calculate 10 more groups The average value is used as the front-end transmission delay estimate. .

[0071] For anomaly detection, 10 sets of calculations are performed. Standard deviation ,like If the timeout value is less than 0.2 seconds, it is determined that there are abnormal timestamp pairs within the window. After removing timestamp pairs that exceed the average value by ±0.2 seconds, the average value is recalculated.

[0072] Specifically, the calculated front-end transmission delay estimate will be included in the output. It is appended to the metadata fields of the three-point moisture monitoring dataset for subsequent time offset alignment.

[0073] Preferably, the sliding window size is 10 groups; the anomaly detection threshold is 0.2 seconds; for example, in a certain batch of production, the timestamp differences of 10 consecutive timestamp pairs are 12.3 seconds, 12.5 seconds, 12.4 seconds, 12.6 seconds, 12.5 seconds, 12.4 seconds, 12.5 seconds, 12.6 seconds, 12.5 seconds, and 12.4 seconds, respectively, with an average value of 12.47 seconds and a standard deviation of 0.10 seconds, which is less than 0.2 seconds, so it is judged as normal, and the estimated front-end transmission delay is 12.47 seconds.

[0074] Step S2.2: Based on the estimated front-end transmission delay, perform time offset alignment between the front-end baseline data and the intermediate compensation data to obtain a time-aligned dataset.

[0075] Preferably, the core of this step is to align the time offset between the front-end reference data and the intermediate compensation data. This is achieved by superimposing the delay estimate on the timestamp of the front-end reference data to match the time of the intermediate compensation data.

[0076] Specifically, for the timestamp offset, the timestamp of each record in the front-end baseline data is added to the estimated front-end transmission delay. Obtain the offset front-end timestamp .

[0077] Specifically, for time matching, the offset front-end timestamp t'_{out} is compared with the timestamp of the intermediate compensation data. Perform a match, if If the time interval is less than 1 second, it is considered a successful match, and the corresponding front-end baseline data and intermediate compensation data are merged into a single time-aligned record.

[0078] Specifically, for handling matching failures, if a certain front-end baseline data cannot find matching intermediate compensation data within a ±0.1 second window, it is marked as unmatched data and temporarily stored; if a certain intermediate compensation data cannot find matching front-end baseline data within a ±0.1 second window, it is also marked and temporarily stored.

[0079] Specifically, for dataset construction, the successfully matched time-aligned records are arranged in chronological order to obtain a time-aligned dataset. Each record in the dataset contains all fields of the front-end baseline data and all fields of the intermediate compensation data.

[0080] Preferably, the time matching tolerance is ±0.1 seconds; the temporary storage time for unmatched data is 60 seconds; for example, in a certain batch of production, the front-end baseline data timestamp is 12:00:01.000, the estimated front-end transmission delay is 12.47 seconds, the offset timestamp is 12:00:13.470, and the intermediate compensation data timestamp is 12:00:13.450, with a time difference of 0.02 seconds. Within the ±0.1 second tolerance range, it is determined to be a successful match.

[0081] Step S2.3: Perform outlier filtering on the time-aligned dataset to obtain the filtered dataset.

[0082] Preferably, the core of this step is to filter outliers in the time-aligned dataset, identifying and removing outlier data using the 3σ criterion to improve data quality.

[0083] For the selection of feature columns, numerical feature columns are selected from the time-aligned dataset, including front-end moisture value, drum speed, drum temperature, hot air temperature, dehumidification opening, intermediate moisture value, feed conveyor belt speed, and fragrance machine drum speed.

[0084] Specifically, for record removal, if the number of outliers in a record exceeds 30% of the total number of feature columns, then the record is removed; otherwise, the outliers are replaced with the mean of the feature column, and the record is retained.

[0085] Specifically, for the dataset output, the datasets that have been filtered for outliers are arranged in chronological order to obtain the filtered dataset.

[0086] Preferably, the outlier detection threshold is 3σ; the record removal threshold is 30%; and the outlier replacement strategy is mean filling. For example, in a certain batch of production, the mean of the front-end moisture value column is 18.5%, and the standard deviation is 0.8%. If the front-end moisture value of a certain record is 21.0%, then... The value was identified as an outlier. Since there was only one outlier in the record, which did not exceed 30% of the total number of feature columns, the outlier was replaced with 18.5%.

[0087] Step S2.4: The filtered dataset is subjected to feature scaling using the Min-Max normalization method to obtain a standardized three-point moisture monitoring dataset.

[0088] Preferably, the core of this step is to normalize the filtered dataset, using Min-Max normalization to map each feature column to the [0,1] interval, thus eliminating dimensional differences.

[0089] For feature selection, all numerical feature columns are selected from the filtered dataset, including front-end moisture value, drum speed, drum temperature, hot air temperature, dehumidification opening, intermediate moisture value, feed conveyor belt speed, fragrance machine drum speed, terminal moisture value, discharge conveyor belt speed, fragrance nozzle pressure, and fragrance proportioning valve opening.

[0090] Specifically, for the calculation of minimum and maximum values, the minimum value is calculated separately for each column of features. With the maximum value The calculation formula is: ; .

[0091] Where N is the number of samples.

[0092] For the normalization calculation, for each value of each feature column... Normalization is performed, and the calculation formula is as follows: .

[0093] Normalized value The range is within the interval [0,1].

[0094] In terms of dataset construction, all normalized feature columns are arranged in chronological order to obtain a standardized three-point moisture monitoring dataset. Each record in the dataset contains all feature values ​​of the normalized front-end, middle, and terminal points.

[0095] Among them, the normalization parameters are saved by storing the features of each column. and Save to the model parameter file for subsequent inverse normalization.

[0096] Preferably, the normalization interval is [0,1]; for example, in a certain batch of production, the minimum value of the front-end moisture value column is 15.0%, the maximum value is 20.0%, and the front-end moisture value of a certain record is 17.5%, then the normalized value is 17.5-15.0 / 20.0-15.0=0.5.

[0097] Beneficial effects of steps S2.1 to S2.4: This series of steps, by aligning and normalizing the three-point moisture monitoring dataset with timestamps, eliminates time deviations caused by material transport delays and numerical differences caused by different units, thereby improving the temporal consistency of the data and the standardization of model input.

[0098] Specifically, step S2.1 calculates the material transfer delay from the outlet of the shredded stem machine to the inlet of the shredded stem flavoring machine to obtain an estimated value of the front-end transfer delay, providing a basis for delay compensation for time alignment; step S2.2 performs time offset alignment on the front-end baseline data and intermediate compensation data based on the estimated front-end transfer delay, eliminating time lag in the material transfer process and improving the time correspondence between the front-end and intermediate data; step S2.3 performs outlier filtering on the time-aligned dataset to remove abnormal data caused by sensor failure or communication interference, improving data quality; step S2.4 performs feature scaling using the Min-Max normalization method to map data of different dimensions to a unified range, avoiding interference from numerical differences on model training and prediction.

[0099] Step S3: Based on the standardized three-point moisture monitoring dataset, construct a third-order moisture deviation prediction model that considers the transmission delay from the front-end benchmark point to the intermediate compensation point and the moisture change from the intermediate compensation point to the terminal calibration point. Output a multi-point moisture deviation prediction sequence for a preset time period in the future to obtain the moisture deviation prediction value.

[0100] Furthermore, step S3 specifically includes the following steps: Step S3.1: Extract the multi-point historical time series sequence divided by a sliding window from the standardized three-point moisture monitoring dataset to obtain the model input sequence.

[0101] Preferably, the core of this step is to extract the historical time series sequence and construct the model input sequence by dividing it into sliding windows.

[0102] Specifically, for the sliding window parameters, the window size is set to 60 time points, and the sliding step size is 1 time point. That is, 60 consecutive time points of data are extracted from the standardized three-point moisture monitoring dataset in chronological order as an input sample.

[0103] For feature selection, the features at each time point include normalized front-end moisture value, drum speed, drum temperature, hot air temperature, dehumidification opening, intermediate moisture value, feed conveyor belt speed, fragrance machine drum speed, terminal moisture value, discharge conveyor belt speed, fragrance nozzle pressure, and fragrance proportioning valve opening, totaling 12 features.

[0104] For sequence construction, the 12-dimensional features of 60 consecutive time points are arranged in chronological order to obtain a 60×12 time series matrix, which is used as a model input sequence. The entire dataset is traversed with a sliding step size of 1 to obtain a multi-preformed input sequence.

[0105] Specifically, for label construction, for each input sequence, the terminal moisture value at the next time point is taken as the predicted label, which is used for loss calculation during model training.

[0106] Preferably, the sliding window size is 60 time points; the sliding step size is 1 time point; and the feature dimension is 12. For example, in a certain batch of production, the standardized three-point moisture monitoring dataset contains 1000 time points. By setting the window size to 60 and the step size to 1, 940 model input sequences can be extracted, and each sequence is a 60×12 time series matrix.

[0107] Step S3.2: Input the model input sequence into the third-order moisture deviation prediction model, and perform feature mapping through the input layer of the third-order moisture deviation prediction model to obtain a high-dimensional feature representation.

[0108] Preferably, the core of this step is to complete the feature mapping of the input sequence, and to achieve high-dimensional feature representation through linear transformation and activation function of the input layer.

[0109] For the input layer structure, the input layer is a fully connected layer with an input dimension of 12 (feature dimension) and an output dimension of 64 (high-dimensional feature dimension). The weight matrix has a shape of 64×12 and the bias vector has a shape of 64×1.

[0110] For the linear transformation, the 12-dimensional features of each time point of the model's input sequence are input into the input layer, and the linear transformation result is calculated: .

[0111] in, This is the 12-dimensional feature vector at time point t. The input layer weight matrix, This is the input layer bias vector. This is the result of a linear transformation.

[0112] For the activation function, the result of the linear transformation is... By applying the ReLU activation function, the high-dimensional feature representation is calculated: Where h_t is the high-dimensional feature representation at time t, with a dimension of 64.

[0113] Specifically, for the output organization, the high-dimensional features at 60 time points are represented. Arranged in chronological order, a high-dimensional feature matrix of 60×64 is obtained, which serves as the input for subsequent LSTM layers.

[0114] Preferably, the input layer output dimension is 64; the activation function is ReLU; for example, the 12-dimensional features of time point t in a certain model input sequence are [0.2,0.5,0.3,0.7,0.1,0.4,0.6,0.2,0.8,0.3,0.5,0.9]. After linear transformation and ReLU activation in the input layer, a 64-dimensional high-dimensional feature representation is obtained.

[0115] Step S3.3: Input the high-dimensional feature representation into the long short-term memory network layer of the third-order moisture deviation prediction model, and extract the temporal dependency features through the gating mechanism of forget gate, input gate and output gate to obtain the temporal hidden state.

[0116] Preferably, the core of this step is to extract time-dependent features, and to capture long-term dependencies and short-term fluctuations through the gating mechanism of the Long Short-Term Memory network.

[0117] For the LSTM layer structure, the LSTM layer contains 64 hidden units, the input is a 60×64 high-dimensional feature matrix, and the output is a 60×64 hidden state matrix; each time step of the LSTM contains three gating units: forget gate, input gate, and output gate.

[0118] Specifically, for the forget gate calculation, the forget gate determines which information is discarded from the cell state of the previous time step, and the calculation formula is as follows: .

[0119] in, Output for the forget gate. Here is the forget gate weight matrix. This is the hidden state from the previous time step. This represents the high-dimensional features of the current time step. Forget gate bias vector, This is the Sigmoid activation function.

[0120] For the input gate calculation, the input gate determines which parts of the new information at the current time step are stored in the cell state. The calculation formula is as follows: .

[0121] .

[0122] in, For input gate output, Candidate cell state, , For the corresponding weight matrix, , This is the corresponding bias vector.

[0123] Among them, for cell state updates, cell state is stored in long-term memory, and the calculation formula is: .

[0124] in, This represents the cell state at the current time step. This represents the cell state at the previous time step. This is element-wise multiplication.

[0125] Specifically, for the output gate calculation, the output gate determines the hidden state output at the current time step, and the calculation formula is: .

[0126] .

[0127] in, For output gate output, Output the LSTM hidden state at the current time step. This is the output gate weight matrix. This is the output gate bias vector.

[0128] Specifically, for the output organization, the LSTM hidden states for 60 time steps are used. Arranged in chronological order, a 60×64 temporal hidden state matrix is ​​obtained.

[0129] Preferably, the number of hidden units in the LSTM is 64; the activation functions used are Sigmoid and Tanh; for example, in a certain batch production process, after the high-dimensional feature matrix is ​​input into the LSTM layer, a 60×64 temporal hidden state matrix is ​​obtained, where the hidden state of each time step contains the temporal dependency features of that time step and the previous time steps.

[0130] Step S3.4: The temporal hidden state is processed by an attention mechanism to calculate the attention weights of each time step, resulting in weighted temporal features.

[0131] Preferably, the core of this step is to calculate the attention weights, highlighting the feature contributions of key time steps through the attention mechanism.

[0132] The attention mechanism structure consists of a fully connected layer with an input dimension of 64 (hidden state dimension), an output dimension of 1 (attention score), a weight matrix of 1×64 shape, and a bias scalar of 1×1.

[0133] Specifically, for the attention score calculation, the temporal hidden state h_t^{LSTM} at each time step is input into the attention mechanism to calculate the attention score: .

[0134] in, Let v be the attention score at time point t, and v be the weight vector. This is the weight matrix. This is the bias vector.

[0135] Specifically, for the calculation of attention weights, the Softmax function is applied to the attention scores to calculate the attention weights at each time step: .

[0136] in, Let be the attention weights at time point t, satisfying .

[0137] Specifically, for the calculation of weighted temporal features, the weighted temporal features are obtained by multiplying the temporal hidden state by the attention weights at each time step and then summing the results. .

[0138] in, The weighted time series features have a dimension of 64.

[0139] For the output organization, weighted time-series features will be used. As input to subsequent fully connected layers.

[0140] Preferably, the attention mechanism output dimension is 1; the Softmax function is applied to the time step dimension; for example, in a certain batch production process, the attention scores of 60 time steps are processed by Softmax to obtain the attention weight distribution, in which the weight of recent time steps (such as t=55 to t=60) is higher, indicating that these time steps have a greater impact on the prediction results.

[0141] Step S3.5: Input the weighted temporal features into the fully connected layer and activation function, output the multi-point moisture deviation prediction sequence for a preset time period in the future, and obtain the moisture deviation prediction value.

[0142] Preferably, the core of this step is to output the moisture deviation prediction sequence, and to achieve multi-point prediction through a fully connected layer and an activation function.

[0143] For the fully connected layer structure, the fully connected layer contains two fully connected sub-layers. The first fully connected sub-layer has an input dimension of 64 (weighted temporal feature dimension) and an output dimension of 32, with the activation function being ReLU. The second fully connected sub-layer has an input dimension of 32 and an output dimension of the number of predicted points within a preset time period × 3 (three-point moisture deviation), with the activation function being linear activation.

[0144] Specifically, for the future preset duration setting, if the future preset duration is set to 10 time points (i.e., predicting the moisture deviation in the next 10 seconds), then the output dimension of the second fully connected sub-layer is 10×3=30.

[0145] For the forward propagation computation, weighted temporal features are used. Input the first fully connected sublayer, and calculate: .

[0146] in, This is the output of the first fully connected sublayer. , For the corresponding weights and biases.

[0147] Specifically, for the calculation of the predicted output, Input the second fully connected sublayer and compute: .

[0148] in, The predicted output is a 10×3 matrix, with each row containing the predicted moisture deviation values ​​for the three points at the beginning, middle, and end of a time point.

[0149] For the output organization, Arranged chronologically, a multi-point moisture deviation prediction sequence for a preset future duration is obtained, which serves as the moisture deviation prediction value.

[0150] Preferably, the output dimension of the first fully connected sublayer is 32; the output dimension of the second fully connected sublayer is a preset duration × 3; the preset duration is 10 time points; for example, in the production process of a certain batch, after the weighted time series features are calculated by the fully connected layer, a multi-point moisture deviation prediction sequence for the next 10 seconds is output, where the predicted value of the front-end moisture deviation in the first second is -0.3%, the predicted value of the middle moisture deviation is +0.2%, and the predicted value of the terminal moisture deviation is -0.1%.

[0151] Beneficial effects of steps S3.1 to S3.5: This series of steps constructs a third-order moisture deviation prediction model based on long short-term memory networks and attention mechanisms, which enables accurate prediction of moisture deviation at multiple points within a preset time period. This provides reliable predictive input for model predictive control and effectively solves the problem that existing open-loop control cannot predict moisture change trends.

[0152] Specifically, step S3.1 involves dividing the historical time series into multiple points using a sliding window to extract the time series feature segments required for model input, providing input data for model prediction; step S3.2 uses feature mapping through the input layer to convert the original time series data into a high-dimensional feature representation, enhancing the expressive power of the features; step S3.3 uses the forget gate, input gate, and output gate gating mechanism of the Long Short-Term Memory network to extract time series dependency features, capturing the long-term dependency relationship and short-term fluctuation pattern in the moisture data, improving prediction accuracy; step S3.4 uses an attention mechanism to calculate the attention weight of each time step, highlighting the key time steps that have a greater impact on the prediction results, improving the model's ability to focus on key features; and step S3.5 uses a fully connected layer and activation function to output a multi-point moisture deviation prediction sequence, obtaining the predicted values ​​of moisture deviation at the front end, middle, and terminal points within a preset time period, providing a prediction basis for coordinated control.

[0153] Step S4: Based on the predicted moisture deviation value, the drying intensity adjustment amount of the stem drying machine, the inlet compensation water spray amount of the stem fragrance machine, and the final calibration amount of the outlet of the stem fragrance machine are calculated by the model predictive control algorithm to obtain the three-point linkage adjustment instruction set.

[0154] Furthermore, step S4 specifically includes the following steps: Step S4.1: Determine the current moisture deviation level based on the predicted moisture deviation value, and obtain the deviation level label.

[0155] Preferably, the core of this step is to determine the moisture deviation level, and the level is classified by setting a preset deviation threshold.

[0156] Specifically, the deviation threshold setting includes three deviation levels: Level 1 deviation (slight), Level 2 deviation (moderate), and Level 3 deviation (severe), with corresponding thresholds of: Level 1 deviation is |moisture deviation| ≤ 0.3%, Level 2 deviation is 0.3% < |moisture deviation| ≤ 0.8%, and Level 3 deviation is |moisture deviation| > 0.8%.

[0157] Specifically, for the level determination, the maximum absolute value of the predicted terminal moisture deviation at all time points within a preset future time period is taken as the current deviation level, and the deviation level is determined according to the threshold.

[0158] Specifically, the deviation levels are labeled as Level_1, Level_2, and Level_3, corresponding to first-level, second-level, and third-level deviations, respectively. The level labels are written into the control parameter structure for subsequent constraint settings.

[0159] Preferably, the first-level deviation threshold is ≤0.3%; the second-level deviation threshold is 0.3% to 0.8%; and the third-level deviation threshold is >0.8%. For example, in the production process of a certain batch, if the maximum absolute value of the predicted terminal moisture deviation in the next 10 seconds is 1.2%, which is greater than 0.8%, it is judged as a third-level deviation, and the deviation level is marked as Level_3.

[0160] Step S4.2: Set the moisture deviation penalty weight and control action change constraint according to the deviation level mark to obtain the model prediction control constraint set.

[0161] Preferably, the core of this step is to construct the model predictive control constraint set, and to set the constraints by mapping the deviation level with the penalty weight and the change constraint.

[0162] Specifically, regarding the setting of penalty weights, a deviation penalty weight matrix is ​​set up, with a penalty weight of 1.0 for first-level deviations, 2.0 for second-level deviations, and 5.0 for third-level deviations. The penalty weights are used to weight the deviation terms in the subsequent optimization objective function.

[0163] Among them, for the control action change constraint setting, the change constraints of drying intensity adjustment, compensation spray volume and outlet calibration are set as follows: under the first level deviation, the change constraint is ±5%; under the second level deviation, the change constraint is ±10%; under the third level deviation, the change constraint is ±20%.

[0164] In the construction of the constraint set, the penalty weight, change constraint, and upper and lower limits of the control quantity (drying intensity adjustment range is -20% to +20%, compensation spray volume range is 0 to 100%, and outlet calibration range is -10% to +10%) are integrated into the model prediction control constraint set, which serves as the constraint condition for subsequent quadratic programming solution.

[0165] Specifically, for the constraint set output, the constraint set is written into the input structure of the model prediction and control module for use in optimization.

[0166] Preferably, the penalty weights are set as follows: Level 1 1.0, Level 2 2.0, and Level 3 5.0; the variation constraints are as follows: Level 1 ±5%, Level 2 ±10%, and Level 3 ±20%. For example, in a certain batch of production, the deviation level is marked as Level_3, the penalty weight is set to 5.0, and the variation constraint is ±20%, which is then integrated to obtain the model predictive control constraint set.

[0167] Step S4.3: Under the model predictive control constraint set, with the optimization objective of minimizing the weighted sum of accumulated moisture deviation and control energy consumption in the future preset control time domain, the optimal control sequence is solved by quadratic programming to obtain the three-point linkage adjustment command set.

[0168] Preferably, the core of this step is to solve for the optimal control sequence, and to optimize the calculation of multi-point coordinated control quantities through a quadratic programming algorithm.

[0169] Specifically, the objective function for optimization is: .

[0170] in, For the time domain prediction, 10 time points are set. This represents the predicted terminal moisture deviation at time point k. As a reference value, set it to 0. The change in control quantity at time point k. The deviation penalty weight is set by step S4.2. To control energy consumption weight, it is set to 0.1.

[0171] Specifically, for constructing the quadratic programming problem, the objective function is transformed into the standard form of quadratic programming: .

[0172] Where g is the optimization variable of the control sequence, H is the Hessian matrix, f is the gradient vector, and the constraints are provided by the model prediction control constraint set.

[0173] For the solver selection, the interior-point method is used to solve the quadratic programming problem. The solver is OSQP (Operator Split Quadratic Programming Solver), with a maximum of 100 iterations and a convergence tolerance of 10. -6 .

[0174] In the process of extracting the optimal control sequence, the control sequence for the next 10 time points is obtained. The control quantity at each time point includes three variables: drying intensity adjustment, compensation water spray volume, and outlet calibration. The control quantity at the first time point is extracted as the current control command, and the control quantities at the remaining time points are used for rolling optimization.

[0175] Specifically, for the construction of the instruction set, the current control instruction and the predicted control quantity at subsequent time points are integrated into a three-point linkage adjustment instruction set, which includes the drying intensity adjustment of the stem drying machine, the inlet compensation water spray volume of the stem fragrance machine, and the final calibration quantity of the outlet of the stem fragrance machine.

[0176] Preferably, the prediction time domain has 10 time points; the energy consumption weight is 0.1; the solver is OSQP; the maximum number of iterations is 100; and the convergence tolerance is 10. -6For example, in the production process of a certain batch, the objective function is optimized to obtain the control sequence for the next 10 time points. The current time point has a drying intensity adjustment of +8.5%, a compensation water spray volume of 62.3%, and an outlet calibration of -2.1%. These are integrated to obtain a three-point linkage adjustment instruction set.

[0177] Beneficial effects of steps S4.1 to S4.3: This series of steps uses a model predictive control algorithm to calculate the adjustment amount of the drying intensity of the shredded stem drying machine, the compensation water spray volume at the inlet of the shredded stem fragrance machine, and the final calibration amount at the outlet of the shredded stem fragrance machine. This achieves coordinated optimization of the three-point linkage adjustment commands, avoids mutual interference of single-point adjustments, and improves the overall coordination and response speed of the control.

[0178] In step S4.1, the current moisture deviation level is determined by the predicted moisture deviation value, providing a level basis for subsequent constraint setting and control strategy selection. In step S4.2, the moisture deviation penalty weight and control action change constraint are set according to the deviation level label, constructing the constraint conditions for model predictive control and balancing control accuracy and control stability. In step S4.3, with the optimization objective of minimizing the weighted sum of accumulated moisture deviation and control energy consumption in the future preset control time domain, the optimal control sequence is solved by quadratic programming, obtaining the optimal adjustment schemes for drying intensity, compensation spray volume, and outlet calibration volume, realizing multi-point coordinated control.

[0179] Step S5: Drive the drying stalk machine, moisture meter, and stalk fragrance adding machine to work together according to the three-point linkage adjustment instruction set, and collect the three-point moisture feedback dataset after execution.

[0180] Furthermore, step S5 specifically includes the following steps: Step S5.1: Extract the drying intensity adjustment amount of the stem drying machine, the inlet compensation water spray amount of the stem fragrance machine, and the final calibration amount of the outlet of the stem fragrance machine from the three-point linkage adjustment instruction set to obtain the classification adjustment parameters.

[0181] Preferably, the core of this step is to classify and parse the adjustment commands, and to classify and package the control parameters by extracting three types of adjustment quantities.

[0182] For instruction set parsing, the three-point linkage adjustment instruction set is a structure containing three fields: dryer_adjust (drying intensity adjustment amount), spray_adjust (compensation spray volume), and calibration_adjust (outlet calibration amount), with each field corresponding to an adjustment value.

[0183] Specifically, for the categorized packaging, dryer_adjust is packaged as the adjustment parameter package for the shredded stem drying machine, including the adjustment amount of drum speed, drum temperature, hot air temperature, and exhaust opening (derived from the decomposition of drying intensity adjustment); spray_adjust is packaged as the inlet adjustment parameter package for the shredded stem fragrance machine, including the adjustment amount of the compensation spray valve opening; and calibration_adjust is packaged as the outlet adjustment parameter package for the shredded stem fragrance machine, including the adjustment amount of the discharge conveyor belt speed and the fragrance proportioning valve.

[0184] For parameter verification, check whether the adjustment amounts in the three types of adjustment parameter packages are within the allowable range of the equipment (drum speed adjustment range: -20% to +20%, drum temperature adjustment range: -10% to +10%, hot air temperature adjustment range: -15% to +15%, exhaust opening adjustment range: -20% to +20%, compensation spray valve opening adjustment range: -100% to +100%, discharge conveyor belt speed adjustment range: -10% to +10%, and fragrance proportioning valve adjustment range: -20% to +20%). If they exceed the range, cut off to the boundary value.

[0185] Specifically, for the output organization, the three types of adjustment parameter packages are integrated into a classified adjustment parameter structure and output to the execution unit distribution module.

[0186] Preferably, the drying intensity adjustment is decomposed into four sub-adjustment values ​​(drum speed, drum temperature, hot air temperature, and dehumidification opening); the parameter verification range is set according to the physical limitations of the equipment; for example, in a certain batch of production, the drying intensity adjustment in the three-point linkage adjustment command set is +8.5%, which is decomposed into drum speed adjustment +5.2%, drum temperature adjustment +2.1%, hot air temperature adjustment +1.8%, and dehumidification opening adjustment -0.6%, all of which are within the allowable range and are packaged into a drying skein machine adjustment parameter package.

[0187] Step S5.2: The classification adjustment parameters are sent to the execution units of the stem drying machine, the moisture meter, and the stem flavoring machine to obtain an execution confirmation signal.

[0188] Preferably, the core of this step is to issue and confirm the execution of the adjustment parameters, and to transmit the parameters to the device execution unit through a communication protocol and obtain a confirmation signal.

[0189] For the communication protocol selection, the ModbusTCP protocol is used for parameter distribution, with a communication period of 1 second, 3 retransmissions after timeout, and a timeout period of 500 milliseconds.

[0190] Specifically, for the object mapping, the adjustment parameter package of the drying stem and shredded meat machine is sent to the PLC (Programmable Logic Controller) execution unit of the drying stem and shredded meat machine; the adjustment amount of the opening of the compensating water spray valve is sent to the compensating water spray valve execution unit at the inlet of the stem and shredded meat fragrance machine; the adjustment amount of the discharge conveyor belt speed and the adjustment amount of the fragrance proportion valve are sent to the PLC execution unit of the stem and shredded meat fragrance machine; the execution unit of the moisture meter is the data upload frequency adjustment module, which adjusts the moisture data upload frequency from 1 Hz to 2 Hz according to the adjustment command.

[0191] Specifically, for execution confirmation, each execution unit returns an execution confirmation signal after receiving the adjustment parameters: if the parameters are successfully received and the actuator starts to operate, it returns an confirmation signal "ACK"; if the parameters are invalid or the actuator malfunctions, it returns an confirmation signal "NACK".

[0192] Specifically, for the confirmation signal processing, if all execution units return "ACK", the overall execution confirmation signal is "successful"; if any execution unit returns "NACK", the overall execution confirmation signal is "failed" and an audible and visual alarm is triggered.

[0193] Specifically, for the output organization, the overall execution confirmation signal is written into the control status structure for use by the subsequent delay acquisition module.

[0194] Preferably, the communication protocol is ModbusTCP; the communication cycle is 1 second; the number of timeout retransmissions is 3; for example, during a certain batch of production, the PLC of the drying shredded stem machine returns "ACK", the compensating water spray valve returns "ACK", the PLC of the shredded stem fragrance machine returns "ACK", the moisture meter data upload frequency adjustment module returns "ACK", and the overall execution confirmation signal is "success".

[0195] Step S5.3: After the execution confirmation signal meets the preset execution delay, real-time moisture data of the stem drying machine outlet, the stem fragrance machine inlet, and the stem fragrance machine outlet are collected again to obtain the three-point moisture feedback dataset after execution.

[0196] Preferably, the core of this step is to collect feedback data after execution. By waiting for the control action to stabilize after a preset delay, the accuracy of the feedback data can be improved.

[0197] Among them, the preset execution delay setting is set to 3 seconds, that is, starting from the moment the execution confirmation signal is "success", wait 3 seconds before collecting feedback data to avoid the transient process of control action affecting the authenticity of data.

[0198] Specifically, for data acquisition triggering, when the execution confirmation signal is "successful" and the waiting time reaches 3 seconds, the three-point moisture data acquisition task is triggered, and the HTTP interface of the moisture meter is called to obtain the real-time moisture value.

[0199] For data acquisition, real-time moisture values ​​are collected at the outlet of the shredded stem drying machine, the inlet of the shredded stem flavoring machine, and the outlet of the shredded stem flavoring machine, respectively. At the same time, the operating parameters of the corresponding equipment (the same parameters as in step S1) are collected to obtain three points of moisture data after execution.

[0200] Specifically, for dataset construction, the three moisture data points after execution are packaged with the corresponding timestamps (in the format YYYY-MM-DDHH:MM:SS) and equipment operating parameters to obtain the three moisture feedback dataset after execution, which is arranged in chronological order.

[0201] In terms of handling data collection failures, if data collection at a certain point fails, the data at that point will be collected again, with a maximum of 3 recollections. If all 3 recollections fail, the data at that point will be marked as a missing value and filled with the average of the past 10 sets of historical data for that point.

[0202] Preferably, the preset execution delay is 3 seconds; the maximum number of resampling attempts is 3; the missing value filling strategy is to fill with the average of the past 10 sets of historical data; for example, during the production of a certain batch, the execution confirmation signal changes to "success" at 12:00:15.000, and after waiting for 3 seconds, the data collection is triggered at 12:00:18.000, and three moisture values ​​are successfully collected: 18.3% at the outlet of the stem drying machine, 17.9% at the inlet of the stem flavoring machine, and 18.1% at the outlet of the stem flavoring machine. The three moisture feedback data after execution are obtained by packaging.

[0203] Beneficial effects of steps S5.1 to S5.3: This series of steps coordinates the operation of the stem drying machine, moisture meter, and stem flavoring machine, and collects moisture feedback data at three points after execution, ensuring the effective execution of control commands and the accurate acquisition of feedback data, providing feedback basis for closed-loop control and online model updates.

[0204] In step S5.1, the adjustment parameters—drying intensity adjustment, compensation spray volume, and outlet calibration volume—are extracted from the three-point linkage adjustment command set, thus classifying and analyzing the adjustment parameters and providing a parameter basis for issuing them to the corresponding equipment execution units. In step S5.2, the classified adjustment parameters are issued to the execution units of each device and an execution confirmation signal is obtained, ensuring the successful issuance of control commands and the response of the equipment. In step S5.3, after the execution confirmation signal meets the preset execution delay, the real-time moisture data of the three points is collected again to obtain the moisture feedback data after execution, providing feedback input for evaluating the control effect and updating the model online.

[0205] Step S6: Calculate the prediction deviation based on the three-point moisture feedback dataset after execution, and update the network weight parameters of the third-order moisture deviation prediction model using the online gradient descent algorithm to obtain the iteratively optimized third-order moisture deviation prediction model for use in the next cycle of moisture control.

[0206] Furthermore, step S6 specifically includes the following steps: Step S6.1: Compare the terminal calibration data in the three-point moisture feedback dataset after execution with the moisture deviation prediction value, calculate the prediction deviation, and obtain the actual prediction deviation sequence.

[0207] Preferably, the core of this step is to calculate the prediction deviation, and obtain the deviation sequence by comparing the terminal calibration data with the predicted value.

[0208] Specifically, for data extraction, the moisture value is extracted from the terminal calibration data from the three-point moisture feedback dataset after execution, denoted as... Extract the terminal moisture deviation prediction value for the corresponding time point from the moisture deviation prediction value, and denot it as... .

[0209] Specifically, for the deviation calculation, the prediction deviation at each time point is calculated. : .

[0210] Where t is the time point index, The actual moisture content at time point t. This represents the predicted terminal moisture deviation at time point t.

[0211] For sequence construction, the prediction bias at all time points is... Arranged in chronological order, the actual prediction deviation sequence is obtained. , where N is the number of time points for feedback data.

[0212] Specifically, for deviation statistics, the mean of the actual predicted deviation sequence is calculated. with standard deviation This is used for subsequent loss function calculation and update condition judgment.

[0213] Preferably, the deviation is calculated by subtracting each time point; the deviation statistics include the mean and standard deviation; for example, in a certain batch of production, the three-point moisture feedback dataset after execution contains 10 time points, and the actual terminal moisture values ​​are 18.2%, 18.3%, 18.1%, 18.4%, 18.2%, 18.3%, 18.2%, 18.1%, 18.3%, and 18.2%, respectively. The corresponding predicted terminal moisture deviation values ​​are 18.0%, 18.2%, 18.0%, 18.3%, 18.1%, 18.2%, 18.0%, 18.0%, 18.2%, and 18.1%, respectively. The calculated actual predicted deviation sequence is [0.2%, 0.1%, 0.1%, 0.1%, 0.1%, 0.1%, 0.2%, 0.1%, 0.1%, 0.1%].

[0214] Step S6.2: Calculate the loss function value based on the actual prediction deviation sequence to obtain the current loss value.

[0215] Preferably, the core of this step is to calculate the loss function value and quantify the model prediction error using the mean squared error function.

[0216] Regarding the selection of the loss function, the mean squared error (MSE) is chosen as the loss function, and the calculation formula is as follows: .

[0217] Where L is the loss function value, and N is the length of the actual prediction bias sequence. This represents the prediction bias at time point t.

[0218] Specifically, for the calculation of the loss value, the actual prediction deviation sequence is used. Substitute into the mean square error formula to calculate the current loss value. .

[0219] For loss value recording, the current loss value will be recorded. It is written to the model update log along with the timestamp and batch number for subsequent update condition judgment and model performance monitoring.

[0220] For loss value normalization, the current loss value is... Divide by the initial loss value (Initial loss value after model training) to obtain normalized loss value It is used to eliminate the influence of dimensions.

[0221] Preferably, the loss function is the mean squared error (MSE); the normalized loss value is the current loss value divided by the initial loss value; for example, in a certain batch of production, the actual predicted deviation sequence is [0.2%, 0.1%, 0.1%, 0.1%, 0.1%, 0.1%, 0.2%, 0.1%, 0.1%, 0.1%], and the calculated current loss value... =0.00015, initial loss value =0.0002, normalized loss value =0.75.

[0222] Step S6.3: Determine whether the model update condition is triggered based on the current loss value, and obtain the update trigger signal.

[0223] Preferably, the core of this step is to determine the model update conditions, and to generate an update trigger signal by comparing the normalized loss value with a preset threshold.

[0224] Specifically, for the update condition settings, two update trigger conditions are set: condition one is the normalized loss value. Condition two is the average normalized loss value of five consecutive batches. If any condition is met, a model update will be triggered.

[0225] Among them, for condition one, if the normalized loss value of the current batch is... If condition one is met, set the condition one flag to 1; otherwise, set it to 0.

[0226] For condition two, a queue of normalized loss values ​​of length 5 is maintained, and each value is added to the current batch after calculation. If the queue length reaches 5, then calculate the average of the 5 values ​​in the queue. ,like If condition two is met, then the condition two flag is set to 1; otherwise, it is 0.

[0227] Specifically, for trigger signal generation, if the first condition flag is 1 or the second condition flag is 1, the trigger signal is updated to "trigger state"; otherwise, it is "non-trigger state".

[0228] Specifically, for signal output, the update trigger signal is written into the model update state structure for use in subsequent weight update steps.

[0229] Preferably, the threshold for condition one is 0.3; the threshold for condition two is 0.5; and the queue length is 5. For example, during a certain batch of production, the normalized loss value of the current batch... =0.4, greater than 0.3, condition one is met, update the trigger signal to "trigger state".

[0230] Step S6.4: When the update trigger signal is in the triggered state, calculate the weight adjustment of each network layer of the third-order moisture deviation prediction model along the gradient descent direction of the loss function to obtain the weight update gradient.

[0231] Preferably, the core of this step is to calculate the weight adjustment amount by calculating the weight gradient of each network layer using the gradient descent algorithm.

[0232] Specifically, for gradient calculation, the backpropagation algorithm is used to calculate the gradient of the loss function with respect to the weights of each network layer: .

[0233] in, Let W be the gradient of the weights W, and L be the loss function.

[0234] Specifically, for gradient calculation at each layer, the weight gradients of the input layer, LSTM layer, attention mechanism, and fully connected layer are calculated separately: Input layer weight gradient: .

[0235] LSTM layer weight gradient: .

[0236] Attention mechanism weight gradient: .

[0237] Gradient of fully connected layer weights: .

[0238] Specifically, for gradient clipping, in order to avoid gradient explosion, the calculated gradient is clipped. If the norm of the gradient exceeds the threshold of 10.0, the gradient is scaled proportionally to make its norm equal to 10.0.

[0239] Specifically, for the weight update gradient organization, the weight gradients of each network layer are arranged in the order of the network structure to obtain the weight update gradient structure, which includes the weight gradient matrix and bias gradient vector of each layer.

[0240] Preferably, the gradient calculation method is the backpropagation algorithm; the gradient clipping threshold is 10.0; for example, in a certain batch production process, the update trigger signal is "trigger state", and the input layer weight gradient matrix (shape 64×12), LSTM layer weight gradient matrix (multiple), attention mechanism weight gradient vector (shape 64×1), and fully connected layer weight gradient matrix (multiple) are calculated by the backpropagation algorithm, and then organized to obtain the weight update gradient structure.

[0241] Step S6.5: After scaling the weight update gradient with an adaptive learning rate, update the network weight parameters of the third-order moisture deviation prediction model to obtain the iteratively optimized three-point linkage moisture control model.

[0242] Preferably, the core of this step is to update the model weights, and to achieve iterative optimization of the weight parameters through the adaptive learning rate algorithm (Adam).

[0243] Regarding the selection of the adaptive learning rate algorithm, the Adam optimizer was chosen. The parameters of the Adam optimizer were set as follows: learning rate 0.001, first-order momentum decay rate 0.9, second-order momentum decay rate 0.999, and numerical stability constant 10. -8 .

[0244] Specifically, for gradient scaling, the Adam optimizer adaptively adjusts the effective learning rate of each weight parameter based on the first and second moment estimates of the gradient, and calculates the update amount for each weight parameter. : .

[0245] .

[0246] .

[0247] .

[0248] .

[0249] in, For first-order moment estimation, For second-order moment estimation, This is the first-order moment estimate after bias correction. This is the second-order moment estimate after bias correction. This represents the weight update amount.

[0250] Specifically, for weight updates, the calculated weight update amount is used. Update the weight parameters of each network layer: .

[0251] in, The current weight parameters, These are the updated weight parameters.

[0252] Specifically, for model saving, the updated weight parameters of the third-order moisture deviation prediction model are saved to the model file, overwriting the original model file, for use in the next cycle of moisture control.

[0253] Specifically, the update log records the timestamp, batch number, update triggering condition, and change in loss value (loss value before and after the update) for this model update and writes it into the model update log.

[0254] Preferably, the Adam optimizer has a learning rate of 0.001; a first-order momentum decay rate of 0.9; a second-order momentum decay rate of 0.999; and a numerical stability constant of 10. -8 For example, during a certain batch of production, the update trigger signal is "trigger state". The Adam optimizer is used to calculate the weight update amount and update the weight parameters of each network layer of the third-order moisture deviation prediction model. The loss value before the update is 0.00015 and the loss value after the update is 0.00012. The model update is completed and saved to the model file.

[0255] Beneficial effects of steps S6.1 to S6.5: This series of steps updates the network weight parameters of the third-order moisture deviation prediction model using an online gradient descent algorithm, achieving adaptive optimization of the model, improving the system's adaptability to different working conditions and the characteristics of different batches of stems, and ensuring the stability of prediction accuracy during long-term operation.

[0256] Specifically, step S6.1 calculates the prediction deviation by comparing the terminal calibration data with the moisture deviation prediction value, obtaining the actual prediction deviation sequence, which provides a basis for loss calculation and model update; step S6.2 calculates the loss function value based on the actual prediction deviation sequence, quantifying the prediction error of the current model and providing an objective function for gradient calculation; step S6.3 determines whether the model update condition is triggered based on the current loss value, avoiding the computational overhead and model oscillation caused by frequent updates; step S6.4 calculates the weight adjustment amount along the gradient descent direction of the loss function when the update trigger signal is triggered, obtaining the weight update gradient, which provides an adjustment direction for model parameter update; step S6.5 updates the model weight parameters by scaling the weight update gradient with an adaptive learning rate, realizing dynamic adjustment of the learning rate and improving the stability and speed of model convergence.

[0257] In summary, the overall beneficial effects of steps S1 to S6 in this embodiment are as follows: This method addresses the issues of lagging moisture control at the tobacco stem flavoring machine outlet, reliance on manual experience, and high standard deviation. It employs a three-point linkage monitoring and model predictive control approach to achieve accurate moisture prediction and automatic closed-loop control. By constructing a linkage monitoring system at three key locations—the outlet of the tobacco stem drying machine, the inlet of the tobacco stem flavoring machine, and the outlet of the tobacco stem flavoring machine—combining a third-order moisture deviation prediction model and an online gradient descent algorithm, this method effectively solves the problems of lagging adjustment and high defect rate in existing open-loop control. It significantly reduces the moisture standard deviation, improves the consistency of tobacco sensory quality and the stability of finished cigarette quality, while also reducing the workload of operators and lowering quality control costs.

[0258] In this process, step S1 constructs a complete moisture monitoring data chain by collecting data from three locations and matching timestamps, providing a data foundation for subsequent prediction and control. Step S2 eliminates time deviations during material transport and improves data temporal consistency by estimating transmission delays and aligning time. Step S3 constructs a third-order moisture deviation prediction model using a long short-term memory network and attention mechanism, achieving accurate prediction of future moisture deviations and providing reliable predictive input for model predictive control. Step S4 calculates three-point linkage adjustment commands using a model predictive control algorithm, achieving coordinated optimization of drying intensity, compensation spray volume, and outlet calibration volume, avoiding mutual interference from single-point adjustments. Step S5 ensures effective execution of control commands and accurate acquisition of feedback data through coordinated action of drive equipment and feedback acquisition after delay. Step S6 updates model weight parameters using an online gradient descent algorithm, achieving adaptive optimization of the model and improving the system's adaptability to different operating conditions.

[0259] like Figure 2As shown, this embodiment provides an example of a moisture control device for the outlet of the stalk fragrance. In this embodiment, the moisture control device is applied to the moisture control method as described in the above embodiment.

[0260] Specifically, the moisture control device includes a moisture monitoring dataset acquisition module 1, a moisture monitoring dataset preprocessing module 2, a moisture deviation prediction module 3, a linkage adjustment command calculation module 4, a moisture feedback dataset acquisition module 5, and a moisture deviation prediction model iteration module 6, which are connected electrically or through communication in sequence.

[0261] The moisture monitoring dataset acquisition module 1 collects real-time moisture data and equipment operating parameters at the outlet of the shredded stem drying machine, the inlet of the shredded stem flavoring machine, and the outlet of the shredded stem flavoring machine, respectively, to obtain front-end baseline data, intermediate compensation data, and terminal calibration data, which are then merged to obtain a three-point moisture monitoring dataset. The moisture monitoring dataset preprocessing module 2 performs timestamp alignment and normalization on the three-point moisture monitoring dataset to obtain a standardized three-point moisture monitoring dataset. The moisture deviation prediction module 3 constructs a third-order moisture deviation prediction model based on the standardized three-point moisture monitoring dataset, considering the transmission delay from the front-end baseline point to the intermediate compensation point and the moisture change from the intermediate compensation point to the terminal calibration point, and outputs a multi-point moisture deviation prediction sequence for a preset future duration, thus obtaining the moisture deviation prediction. The measurement and linkage adjustment command calculation module 4 is used to calculate the drying intensity adjustment amount of the shredded stem drying machine, the inlet compensation spray volume of the shredded stem fragrance machine, and the final calibration amount of the outlet of the shredded stem fragrance machine according to the moisture deviation prediction value through the model predictive control algorithm, so as to obtain a three-point linkage adjustment command set; the moisture feedback dataset acquisition module 5 is used to drive the shredded stem drying machine, moisture meter, and shredded stem fragrance machine to coordinate their actions according to the three-point linkage adjustment command set, and to acquire the three-point moisture feedback dataset after execution; the moisture deviation prediction model iteration module 6 is used to calculate the prediction deviation according to the three-point moisture feedback dataset after execution, and to update the network weight parameters of the third-order moisture deviation prediction model through the online gradient descent algorithm, so as to obtain the iteratively optimized third-order moisture deviation prediction model for the moisture control of the next cycle.

[0262] like Figure 3 As shown, the electronic device 7 includes a processor 71 and a memory 72 coupled to the processor 71.

[0263] The memory 72 stores program instructions for implementing the moisture control method of the stem fragrance outlet of any of the above embodiments.

[0264] The processor 71 is used to execute program instructions stored in the memory 72 for moisture control at the stem fragrance outlet.

[0265] The processor 71 can also be referred to as a CPU (Central Processing Unit). The processor 71 may be an integrated circuit chip with signal processing capabilities. The processor 71 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor can be a microprocessor or any conventional processor.

[0266] Furthermore, Figure 4 This is a schematic diagram of the structure of a storage medium according to an embodiment of this application. See also: Figure 4 The storage medium 8 in this embodiment stores program instructions 81 capable of implementing all the above methods. These program instructions 81 can be stored in the storage medium as a software product, including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to perform all or part of the steps of the methods in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, or terminal devices such as computers, servers, mobile phones, and tablets.

[0267] In the several embodiments provided in this application, it should be understood that the disclosed apparatus, devices, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the moisture control of a unit is only a logical function of moisture control; in actual implementation, there may be other moisture control methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or omitted. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interface; the indirect coupling or communication connection of devices or units may be electrical, mechanical, signal, or other forms.

[0268] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units described above can be implemented in hardware or as software functional units. The above are merely embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made based on the description and drawings of this application, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A method for controlling the moisture content of shredded stems at the outlet after flavoring, wherein the moisture control method is applied to a shredded stem drying machine, a shredded stem flavoring machine, and a moisture meter on the same production line, characterized in that, The moisture control method includes: Step S1: Real-time moisture data and equipment operating parameters are collected at the outlet of the shredded stem drying machine, the inlet of the shredded stem flavoring machine, and the outlet of the shredded stem flavoring machine to obtain front-end reference data, intermediate compensation data, and terminal calibration data, which are then combined to obtain a three-point moisture monitoring dataset. Step S2: Perform timestamp alignment and normalization on the three-point moisture monitoring dataset to obtain a standardized three-point moisture monitoring dataset. Step S3: Based on the standardized three-point moisture monitoring dataset, construct a third-order moisture deviation prediction model that considers the transmission delay from the front-end benchmark point to the intermediate compensation point and the moisture change from the intermediate compensation point to the terminal calibration point, and output a multi-point moisture deviation prediction sequence for a future preset time period to obtain the moisture deviation prediction value. Step S4: Based on the predicted moisture deviation value, the drying intensity adjustment amount of the stem drying machine, the inlet compensation water spray amount of the stem fragrance machine, and the final calibration amount of the outlet of the stem fragrance machine are calculated by the model prediction control algorithm to obtain the three-point linkage adjustment instruction set. Step S5: Drive the drying shredded stem machine, the moisture meter, and the shredded stem flavoring machine to work together according to the three-point linkage adjustment instruction set, and collect the three-point moisture feedback dataset after execution; Step S6: Calculate the prediction deviation based on the three-point moisture feedback dataset after execution, and update the network weight parameters of the third-order moisture deviation prediction model using the online gradient descent algorithm to obtain the iteratively optimized third-order moisture deviation prediction model for use in the next cycle of moisture control.

2. The moisture control method according to claim 1, characterized in that, Step S1: Real-time moisture data and equipment operating parameters are collected at the outlet of the stem drying machine, the inlet of the stem flavoring machine, and the outlet of the stem flavoring machine, respectively, to obtain front-end reference data, intermediate compensation data, and terminal calibration data. These are then combined to obtain a three-point moisture monitoring dataset, including: Step S1.1: Collect the drying operation parameters of the drying shreds machine, and collect the real-time moisture value at the outlet of the drying shreds machine using a moisture meter to obtain the front-end reference data; Step S1.2: Collect the fragrance operation parameters of the stem fragrance adding machine, and collect the real-time moisture value at the inlet of the stem fragrance adding machine through a moisture meter to obtain intermediate compensation data; Step S1.3: Collect the output operating parameters of the stem flavoring machine, and collect the real-time moisture value at the outlet of the stem flavoring machine through a moisture meter to obtain terminal calibration data; Step S1.4: Pair the front-end baseline data, the intermediate compensation data, and the terminal calibration data using timestamps as association keys to obtain a three-point moisture monitoring dataset.

3. The moisture control method according to claim 1, characterized in that, Step S2: Perform timestamp alignment and normalization on the three-point moisture monitoring dataset to obtain a standardized three-point moisture monitoring dataset, including: Step S2.1: Based on the timestamps of each data point in the three-point moisture monitoring dataset, calculate the material transfer delay from the outlet of the shredded stem drying machine to the inlet of the shredded stem flavoring machine, and obtain the estimated front-end transfer delay value. Step S2.2: Based on the estimated front-end transmission delay, perform time offset alignment between the front-end baseline data and the intermediate compensation data to obtain a time-aligned dataset; Step S2.3: Perform outlier filtering on the time-aligned dataset to obtain the filtered dataset; Step S2.4: The filtered dataset is subjected to feature scaling using the Min-Max normalization method to obtain a standardized three-point moisture monitoring dataset.

4. The moisture control method according to claim 1, characterized in that, Step S3: Based on the standardized three-point moisture monitoring dataset, construct a third-order moisture deviation prediction model that considers the transmission delay from the front-end reference point to the intermediate compensation point and the moisture change from the intermediate compensation point to the terminal calibration point. Output a multi-point moisture deviation prediction sequence for a preset future time period to obtain the moisture deviation prediction value, including: Step S3.1: Extract the multi-point historical time series sequence divided by a sliding window from the standardized three-point moisture monitoring dataset to obtain the model input sequence; Step S3.2: Input the model input sequence into the third-order moisture deviation prediction model, and perform feature mapping through the input layer of the third-order moisture deviation prediction model to obtain a high-dimensional feature representation; Step S3.3: Input the high-dimensional feature representation into the long short-term memory network layer of the third-order moisture deviation prediction model, and extract the temporal dependency features through the gating mechanism of forget gate, input gate, and output gate to obtain the temporal hidden state; Step S3.4: The temporal hidden state is processed by an attention mechanism to calculate the attention weights of each time step, resulting in weighted temporal features; Step S3.5: Input the weighted temporal features into the fully connected layer and activation function, output the multi-point moisture deviation prediction sequence for a preset time period in the future, and obtain the moisture deviation prediction value.

5. The moisture control method according to claim 1, characterized in that, Step S4: Based on the predicted moisture deviation value, the drying intensity adjustment of the stem drying machine, the inlet compensation water spray volume of the stem fragrance machine, and the final calibration amount of the outlet of the stem fragrance machine are calculated using a model predictive control algorithm to obtain a three-point linkage adjustment command set, including: Step S4.1: Determine the current moisture deviation level based on the predicted moisture deviation value, and obtain the deviation level label; Step S4.2: Set the moisture deviation penalty weight and control action change constraint according to the deviation level label to obtain the model prediction control constraint set; Step S4.3: Under the model predictive control constraint set, with the optimization objective of minimizing the weighted sum of accumulated moisture deviation and control energy consumption in the future preset control time domain, the optimal control sequence is solved by quadratic programming to obtain the three-point linkage adjustment command set.

6. The moisture control method according to claim 1, characterized in that, Step S5: Drive the stem drying machine, the moisture meter, and the stem flavoring machine to work together according to the three-point linkage adjustment instruction set, and collect the three-point moisture feedback dataset after execution, including: Step S5.1: Extract the drying intensity adjustment amount of the stem drying machine, the inlet compensation water spray amount of the stem fragrance machine, and the final calibration amount of the outlet of the stem fragrance machine from the three-point linkage adjustment instruction set to obtain the classification adjustment parameters; Step S5.2: The classification adjustment parameters are sent to the execution units of the stem drying machine, the moisture meter, and the stem flavoring machine to obtain an execution confirmation signal; Step S5.3: After the execution confirmation signal meets the preset execution delay, real-time moisture data of the stem drying machine outlet, the stem fragrance machine inlet, and the stem fragrance machine outlet are collected again to obtain the three-point moisture feedback dataset after execution.

7. The moisture control method according to claim 1, characterized in that, Step S6: Calculate the prediction deviation based on the three-point moisture feedback dataset after execution, and update the network weight parameters of the third-order moisture deviation prediction model using an online gradient descent algorithm to obtain an iteratively optimized third-order moisture deviation prediction model for use in the next cycle of moisture control, including: Step S6.1: Compare the terminal calibration data in the three-point moisture feedback dataset after execution with the moisture deviation prediction value, calculate the prediction deviation, and obtain the actual prediction deviation sequence. Step S6.2: Calculate the loss function value based on the actual prediction deviation sequence to obtain the current loss value; Step S6.3: Determine whether the model update condition is triggered based on the current loss value, and obtain the update trigger signal; Step S6.4: When the update trigger signal is in the triggered state, calculate the weight adjustment of each network layer of the third-order moisture deviation prediction model along the gradient descent direction of the loss function to obtain the weight update gradient; Step S6.5: After scaling the weight update gradient using an adaptive learning rate, update the network weight parameters of the third-order moisture deviation prediction model to obtain the iteratively optimized third-order moisture deviation prediction model.

8. A moisture control device for a stem-fragrant outlet, wherein the moisture control device is applied to the moisture control method as described in any one of claims 1 to 7, characterized in that, The moisture control device includes: The moisture monitoring dataset acquisition module is used to collect real-time moisture data and equipment operating parameters at the outlet of the shredded stem drying machine, the inlet of the shredded stem flavoring machine, and the outlet of the shredded stem flavoring machine, respectively, to obtain front-end reference data, intermediate compensation data, and terminal calibration data, which are then merged to obtain a three-point moisture monitoring dataset. The moisture monitoring dataset preprocessing module is used to perform timestamp alignment and normalization on the three-point moisture monitoring dataset to obtain a standardized three-point moisture monitoring dataset. The moisture deviation prediction module is used to construct a third-order moisture deviation prediction model based on the standardized three-point moisture monitoring dataset, taking into account the transmission delay from the front-end reference point to the intermediate compensation point and the moisture change from the intermediate compensation point to the terminal calibration point, and output a multi-point moisture deviation prediction sequence for a preset time period in the future to obtain the moisture deviation prediction value. The linkage adjustment instruction calculation module is used to calculate the drying intensity adjustment amount of the shredded stem drying machine, the inlet compensation spray amount of the shredded stem fragrance machine, and the final calibration amount of the outlet of the shredded stem fragrance machine according to the moisture deviation prediction value, and obtain a three-point linkage adjustment instruction set. The moisture feedback dataset acquisition module is used to drive the drying shredded stem machine, the moisture meter, and the shredded stem flavoring machine to work together according to the three-point linkage adjustment instruction set, and to acquire the three-point moisture feedback dataset after execution. The moisture deviation prediction model iteration module is used to calculate the prediction deviation based on the three-point moisture feedback dataset after execution, and update the network weight parameters of the third-order moisture deviation prediction model through an online gradient descent algorithm to obtain the iteratively optimized third-order moisture deviation prediction model for use in the next cycle of moisture control.

9. An electronic device, characterized in that, The method includes a processor and a memory coupled to the processor, the memory storing program instructions that can be executed by the processor; when the processor executes the program instructions stored in the memory, it implements the moisture control method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program instructions that, when executed by a processor, enable the moisture control method as described in any one of claims 1 to 7.