Temperature and humidity prediction method and device based on random forest model, equipment and medium

By using a temperature and humidity prediction method based on a random forest model, the problem of inaccurate temperature and humidity prediction in non-constant temperature industrial scenarios is solved. Through feature reconstruction and model optimization, efficient and accurate temperature and humidity prediction is achieved.

CN121010018APending Publication Date: 2025-11-25HUBEI CHINA TOBACCO INDUSTRY CO LTD

Patent Information

Application Number
CN202511152415.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-18
Publication Date
2025-11-25

AI Technical Summary

Technical Problem

In non-constant temperature industrial scenarios, existing technologies, such as linear regression and traditional time series models, cannot effectively handle nonlinear and high-dimensional meteorological data, and lack comprehensive consideration of multi-source data, resulting in inaccurate and inefficient temperature and humidity predictions.

Method used

A temperature and humidity prediction method based on a random forest model is adopted. By acquiring the temperature, humidity and parameter information of the target workshop, feature reconstruction and feature sequence combination are performed. The random forest model is trained and optimized by combining a preset grid search and cross-validation method to obtain the target random forest model and perform data prediction.

Benefits of technology

It improves the accuracy and efficiency of temperature and humidity prediction in non-constant temperature industrial scenarios, solves the problem of inaccurate prediction caused by external climate fluctuations, and achieves rapid and efficient temperature and humidity prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121010018A_ABST
    Figure CN121010018A_ABST
Patent Text Reader

Abstract

The invention discloses a temperature and humidity prediction method and device based on a random forest model, equipment and a medium. The method comprises the steps of performing feature reconstruction on a target temperature and humidity information set and target parameter information corresponding to a target workshop based on a preset feature division rule to obtain target feature sequences corresponding to target feature dimensions, and performing combined processing on each target feature sequence to obtain a data set comprising a training set, a verification set and a test set; training the basic random forest model based on a preset grid search method, a preset cross validation method, the training set and the validation set to obtain a first random forest model, and optimizing the first random forest model based on a preset feature importance analysis strategy model to obtain a target random forest model containing a preset model number; and performing data prediction on the test set based on the target random forest model to obtain a temperature and humidity prediction result and a prediction result evaluation index. Through the technical scheme of the invention, rapid prediction of temperature and humidity can be realized, and the accuracy and efficiency of a temperature and humidity prediction result are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data prediction technology, and in particular to a method, apparatus, equipment and medium for predicting temperature and humidity based on a random forest model. Background Technology

[0002] With the rapid development of computer technology, temperature and humidity prediction is increasingly being applied to various industrial scenarios to reduce the impact of temperature and humidity fluctuations on product quality stability. Therefore, ensuring the accuracy of temperature and humidity prediction results has become extremely important.

[0003] In existing technologies, temperature and humidity prediction models are typically constructed using methods such as linear regression or simple time series analysis. However, for some temperature and humidity-sensitive industrial scenarios, such as non-constant temperature tobacco processing workshops in cigarette production, it is usually necessary to comprehensively consider the impact of external climate fluctuations and equipment operating conditions on the prediction results.

[0004] However, linear regression models are generally ineffective at handling nonlinear and high-dimensional meteorological data, and traditional time series models have limited ability to capture long-term dependencies. Furthermore, both linear regression and traditional time series models lack comprehensive consideration of multi-source data and have poor generalization ability, making them difficult to adapt to changes in different seasons or production batches. Using existing linear regression or traditional time series models for temperature and humidity prediction in temperature- and humidity-sensitive industrial scenarios will reduce the accuracy and efficiency of the prediction results.

[0005] Therefore, how to achieve rapid prediction of temperature and humidity in non-constant temperature industrial scenarios, improve the accuracy and efficiency of temperature and humidity prediction results in non-constant temperature industrial scenarios, and solve the problem of inaccurate temperature and humidity prediction caused by external climate fluctuations are urgent problems to be solved. Summary of the Invention

[0006] This invention provides a method, apparatus, device, and medium for predicting temperature and humidity based on a random forest model, which can solve the problem of inaccurate temperature and humidity prediction caused by external climate fluctuations.

[0007] According to one aspect of the present invention, a method for predicting temperature and humidity based on a random forest model is provided, comprising:

[0008] Obtain the target temperature and humidity information set and target parameter information corresponding to the target workshop; wherein, the target temperature and humidity information set includes the target temperature and humidity information corresponding to each time moment; the target temperature and humidity information includes target indoor temperature and humidity data and target outdoor temperature and humidity data; the target parameter information includes target operating parameters and target process parameters;

[0009] Based on preset feature segmentation rules, the target temperature and humidity information set and target parameter information are reconstructed to obtain target feature sequences corresponding to target feature dimensions. The target feature sequences corresponding to each target feature dimension are then combined and processed to obtain the dataset corresponding to the target workshop. The dataset includes a training set, a validation set, and a test set.

[0010] The basic random forest model is trained using a preset grid search method, a preset cross-validation method, a training set, and a validation set to obtain a first random forest model. The first random forest model is then optimized using a preset feature importance analysis strategy to obtain a target random forest model containing a preset number of models.

[0011] The test set is predicted based on the objective random forest model to obtain temperature and humidity prediction results and evaluation indicators within a preset time range.

[0012] According to another aspect of the present invention, a temperature and humidity prediction device based on a random forest model is provided, comprising:

[0013] The data acquisition module is used to acquire the target temperature and humidity information set and target parameter information corresponding to the target workshop; wherein, the target temperature and humidity information set includes the target temperature and humidity information corresponding to each time moment; the target temperature and humidity information includes target indoor temperature and humidity data and target outdoor temperature and humidity data; the target parameter information includes target operating parameters and target process parameters;

[0014] The feature reconstruction module is used to reconstruct the target temperature and humidity information set and target parameter information based on preset feature partitioning rules, obtain the target feature sequence corresponding to the target feature dimension, and combine the target feature sequences corresponding to each target feature dimension to obtain the dataset corresponding to the target workshop; wherein, the dataset includes a training set, a validation set and a test set;

[0015] The model optimization module is used to train the basic random forest model based on a preset grid search method, a preset cross-validation method, a training set and a validation set to obtain a first random forest model, and to optimize the first random forest model based on a preset feature importance analysis strategy to obtain a target random forest model containing a preset number of models.

[0016] The data prediction module is used to perform data prediction on the test set based on the target random forest model, and obtain the temperature and humidity prediction results and the prediction result evaluation index within a preset time range.

[0017] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0018] At least one processor; and

[0019] A memory communicatively connected to the at least one processor; wherein,

[0020] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the temperature and humidity prediction method based on the random forest model as described in any embodiment of the present invention.

[0021] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the temperature and humidity prediction method based on the random forest model as described in any embodiment of the present invention.

[0022] According to another aspect of the present invention, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the temperature and humidity prediction method based on a random forest model as described in any embodiment of the present invention.

[0023] The technical solution of this invention involves acquiring a set of target temperature and humidity information and target parameter information corresponding to a target workshop. Then, based on preset feature partitioning rules, the target temperature and humidity information set and target parameter information are reconstructed to obtain target feature sequences corresponding to target feature dimensions. These target feature sequences are then combined to obtain a dataset corresponding to the target workshop, including a training set, a validation set, and a test set. Further, a basic random forest model is trained using a preset grid search method, a preset cross-validation method, and the training and validation sets to obtain a first random forest model. This first random forest model is then optimized using a preset feature importance analysis strategy to obtain a target random forest model containing a preset number of models. Finally, data prediction is performed on the test set based on the target random forest model to obtain temperature and humidity prediction results and evaluation metrics within a preset time range. By combining the random forest model and feature engineering for temperature and humidity prediction, the problem of inaccurate temperature and humidity prediction caused by external climate fluctuations is solved. This enables rapid prediction of temperature and humidity in non-constant temperature industrial scenarios, improving the accuracy and efficiency of temperature and humidity prediction results in such scenarios.

[0024] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0025] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0026] Figure 1 This is a flowchart of a temperature and humidity prediction method based on a random forest model according to Embodiment 1 of the present invention;

[0027] Figure 2 This is a flowchart of a temperature and humidity prediction method based on a random forest model according to Embodiment 2 of the present invention;

[0028] Figure 3 This is a flowchart of an optional temperature and humidity prediction method based on a random forest model provided according to Embodiment 2 of the present invention;

[0029] Figure 4 This is a schematic diagram of a temperature and humidity prediction device based on a random forest model according to Embodiment 3 of the present invention;

[0030] Figure 5 This is a schematic diagram of the structure of an electronic device that implements the temperature and humidity prediction method based on the random forest model according to embodiments of the present invention. Detailed Implementation

[0031] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0032] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0033] Example 1

[0034] Figure 1 This is a flowchart of a temperature and humidity prediction method based on a random forest model provided in Embodiment 1 of the present invention. This embodiment is applicable to the rapid prediction of temperature and humidity in non-constant temperature industrial scenarios. The method can be executed by a temperature and humidity prediction device based on a random forest model. This device can be implemented in hardware and / or software and can be configured in an electronic device, for example, in a computer device. Figure 1 As shown, the method includes:

[0035] S110. Obtain the target temperature and humidity information set and target parameter information corresponding to the target workshop; wherein, the target temperature and humidity information set includes the target temperature and humidity information corresponding to each time; the target temperature and humidity information includes the target indoor temperature and humidity data and the target outdoor temperature and humidity data; the target parameter information includes the target operating parameters and the target process parameters.

[0036] The target workshop can refer to the selected industrial production workshop for temperature and humidity prediction. Typically, the target workshop can be a non-constant temperature special environment workshop sensitive to temperature and humidity, or it can be a general production workshop; this embodiment of the invention does not specifically limit this. For example, the target workshop can be a non-constant temperature tobacco processing workshop in the cigarette production process. Temperature and humidity information can refer to temperature and humidity information related to the production environment. Typically, temperature and humidity information can include production-related indoor temperature and humidity data, i.e., temperature and humidity data within the target workshop, or production-related outdoor temperature and humidity data, i.e., temperature and humidity data of the outdoor environment surrounding the target workshop. Target temperature and humidity information can refer to the final temperature and humidity information obtained after data processing. Typically, target temperature and humidity information includes target indoor temperature and humidity data and target outdoor temperature and humidity data. Target indoor temperature and humidity data can refer to production-related indoor temperature and humidity data obtained after data processing. Target outdoor temperature and humidity data can refer to production-related outdoor temperature and humidity data obtained after data processing. Typically, the target indoor temperature and humidity data and target outdoor temperature and humidity data included in a set of target temperature and humidity information have the same collection time point. The target temperature and humidity information set can refer to the set of various target temperature and humidity information corresponding to the same target workshop. Typically, the target temperature and humidity information set can contain target temperature and humidity information for 24 hours.

[0037] Parameter information refers to a set of production parameters related to the production process. Typically, parameter information includes equipment operating parameters and production process parameters. Target parameter information refers to the parameter information corresponding to the target workshop. Target operating parameters refer to the equipment operating parameter data corresponding to the target workshop. Target process parameters refer to the process parameter data corresponding to the target workshop.

[0038] S120. Based on preset feature partitioning rules, the target temperature and humidity information set and target parameter information are reconstructed to obtain target feature sequences corresponding to target feature dimensions, and the target feature sequences corresponding to each target feature dimension are combined and processed to obtain the dataset corresponding to the target workshop; wherein, the dataset includes a training set, a validation set and a test set.

[0039] The preset feature segmentation rule refers to a pre-defined rule used to define the feature segmentation process. For example, the preset feature segmentation rule may include the object of feature segmentation and the specific segmentation process. Feature reconstruction refers to the operation of constructing features using the preset feature segmentation rule. Feature dimension refers to a standard used to segment relevant data in the production process. Target feature dimension refers to the feature dimension corresponding to the target workshop. In an optional implementation, the target feature dimension may include: temperature and humidity dimension, time dimension, process dimension, and environmental dimension. The temperature and humidity dimension refers to the feature level related to temperature and humidity data. The time dimension refers to the feature level related to time data. The process dimension refers to the feature level related to the production process. The environmental dimension refers to the feature level related to the production environment.

[0040] In this context, a feature sequence refers to a combination of feature data obtained after feature partitioning using a preset feature partitioning rule. A target feature sequence refers to a feature sequence corresponding to a target feature dimension. Typically, for the same target feature dimension, one target feature sequence corresponds to one target feature dimension. A dataset refers to a collection of data consisting of target feature sequences corresponding to all target feature dimensions. A training set refers to a collection of data used to provide the data foundation for the model training process. Typically, the training set can account for 70% of the dataset's data volume. A validation set refers to a collection of data used during training to evaluate the model's performance and help adjust parameters. Typically, the validation set can account for 15% of the dataset's data volume. A test set refers to a collection of data used to finally evaluate the model's generalization ability in real-world scenarios. Typically, the test set can account for 15% of the dataset's data volume. It is worth noting that in this embodiment of the invention, the data in the training set, validation set, and test set do not overlap.

[0041] S130. The basic random forest model is trained based on a preset grid search method, a preset cross-validation method, a training set, and a validation set to obtain a first random forest model. The first random forest model is then optimized based on a preset feature importance analysis strategy to obtain a target random forest model containing a preset number of models.

[0042] Among these, the pre-defined grid search method refers to a pre-set method for systematically finding the optimal combination of parameters. Typically, the pre-defined grid search method exhaustively tries all combinations within a specified parameter grid. The pre-defined cross-validation method refers to a pre-defined method for evaluating the model's generalization ability. The random forest model refers to an ensemble learning algorithm that improves model accuracy and stability by constructing multiple decision trees and combining their predictions. The basic random forest model refers to an initially constructed random forest model that has not been trained. The first random forest model refers to the random forest model obtained after the initial training.

[0043] The pre-defined feature importance analysis strategy refers to pre-set rules for filtering the importance of multiple features. Typically, this strategy identifies the features most influential on the prediction target. The pre-defined number of models refers to a pre-set numerical value used to evaluate the number of random forest models. For example, the pre-defined number of models could be five. This number is usually determined based on historical model training experience. The target random forest model refers to the final trained random forest model.

[0044] It is worth noting that, in this embodiment of the invention, when validating the basic random forest model using the validation set, validation set data from future time periods can be used as label data, thereby verifying the accuracy of the prediction results output by the basic random forest model. This embodiment of the invention will not elaborate further on this aspect.

[0045] S140. Based on the target random forest model, perform data prediction on the test set to obtain temperature and humidity prediction results and prediction result evaluation indicators within a preset time range.

[0046] The preset time range refers to a pre-defined time period used to limit the data prediction results. For example, the preset time range could be the next 72 hours. The temperature and humidity prediction results refer to the predicted temperature and humidity data for the target workshop within the preset time range. Typically, the temperature and humidity prediction results can be temperature and humidity prediction curves within the preset time range. The prediction result evaluation index refers to a metric used to quantify the confidence level of the model in a single prediction result. Typically, the prediction result evaluation index can be directly derived from the target random forest model, and the reliability of the target random forest model's predictions can be assessed through the prediction result evaluation index.

[0047] The technical solution of this invention involves acquiring a set of target temperature and humidity information and target parameter information corresponding to a target workshop. Then, based on preset feature partitioning rules, the target temperature and humidity information set and target parameter information are reconstructed to obtain target feature sequences corresponding to target feature dimensions. These target feature sequences are then combined to obtain a dataset corresponding to the target workshop, including a training set, a validation set, and a test set. Further, a basic random forest model is trained using a preset grid search method, a preset cross-validation method, and the training and validation sets to obtain a first random forest model. This first random forest model is then optimized using a preset feature importance analysis strategy to obtain a target random forest model containing a preset number of models. Finally, data prediction is performed on the test set based on the target random forest model to obtain temperature and humidity prediction results and evaluation metrics within a preset time range. By combining the random forest model and feature engineering for temperature and humidity prediction, the problem of inaccurate temperature and humidity prediction caused by external climate fluctuations is solved. This enables rapid prediction of temperature and humidity in non-constant temperature industrial scenarios, improving the accuracy and efficiency of temperature and humidity prediction results in such scenarios.

[0048] Example 2

[0049] Figure 2 This is a flowchart of a temperature and humidity prediction method based on a random forest model provided in Embodiment 2 of the present invention. This embodiment is a refinement based on the above embodiment. Specifically, this embodiment refines the operation of obtaining the target temperature and humidity information set and target parameter information corresponding to the target workshop. Specifically, it may include: acquiring basic outdoor temperature and humidity data corresponding to the target workshop in real time based on a preset meteorological program interface, and collecting basic indoor temperature and humidity data corresponding to the target workshop in real time based on a preset Internet of Things sensor network; determining the target operating parameters and target process parameters corresponding to the target workshop based on a preset manufacturing execution system, and combining and processing the target operating parameters and target process parameters to obtain target parameter information; performing data preprocessing on the basic outdoor temperature and humidity data and basic indoor temperature and humidity data based on preset data processing rules to obtain target indoor temperature and humidity data and target outdoor temperature and humidity data; combining and processing the target indoor temperature and humidity data and target outdoor temperature and humidity data corresponding to the same moment to obtain target temperature and humidity information, and summarizing and processing the target temperature and humidity information corresponding to each moment to obtain the target temperature and humidity information set. Figure 2 As shown, the method includes:

[0050] S210. Based on the preset meteorological program interface, the basic outdoor temperature and humidity data corresponding to the target workshop are obtained in real time, and based on the preset Internet of Things sensor network, the basic indoor temperature and humidity data corresponding to the target workshop are collected in real time.

[0051] The preset meteorological program interface can refer to a pre-defined meteorological data transmission interface. For example, the preset meteorological program interface can be an application programming interface (API) in a pre-selected meteorological application used for transmitting meteorological data externally. The basic outdoor temperature and humidity data can refer to the initially collected outdoor temperature and humidity data corresponding to the target workshop. Typically, the data collection time range for the basic outdoor temperature and humidity data can be longer than the preset time range.

[0052] The pre-set IoT sensor network refers to a pre-defined IoT network consisting of a large number of distributed sensor nodes interconnected via wireless communication. Typically, this network can sense and collect environmental temperature and humidity data in real time, transmitting it to the cloud or edge computing platform for analysis. Basic indoor temperature and humidity data refers to the initially collected indoor temperature and humidity data corresponding to the target workshop.

[0053] S220. Based on the preset manufacturing execution system, determine the target operating parameters and target process parameters corresponding to the target workshop, and combine and process the target operating parameters and target process parameters to obtain target parameter information.

[0054] In this context, a pre-set Manufacturing Execution System (MES) refers to a core information system that is pre-defined to connect enterprise management with the workshop production site. Typically, a pre-set MES allows for real-time monitoring, coordination, and control of the workshop's production processes.

[0055] S230. Based on preset data processing rules, perform data preprocessing on the basic outdoor temperature and humidity data and the basic indoor temperature and humidity data to obtain the target indoor temperature and humidity data and the target outdoor temperature and humidity data.

[0056] Data preprocessing refers to the process of cleaning, transforming, and integrating raw data before model training. For example, data preprocessing may include outlier handling, missing value imputation, and data standardization. Pre-defined data processing rules refer to pre-set rules that define the data preprocessing flow. For example, pre-defined data processing rules may include identifying outliers by setting upper and lower thresholds; identifying missing values ​​in the current data and imputing them using the mean of adjacent data points when an interface call fails or returns missing data; or using the result of subtracting the mean from the data and then dividing by the standard deviation as the standardization result.

[0057] S240. Combine and process the target indoor temperature and humidity data and the target outdoor temperature and humidity data corresponding to the same time to obtain the target temperature and humidity information, and summarize and process the target temperature and humidity information corresponding to each time to obtain the target temperature and humidity information set.

[0058] Specifically, before model training, basic outdoor temperature and humidity data corresponding to the target workshop can be acquired in real time through a preset meteorological program interface. Basic indoor temperature and humidity data corresponding to the target workshop can also be collected in real time based on a preset IoT sensor network. Target operating parameters and target process parameters corresponding to the target workshop are determined through a preset manufacturing execution system. These parameters are then combined and processed to obtain target parameter information. Further, the basic outdoor and indoor temperature and humidity data are preprocessed based on preset data processing rules to obtain target indoor and outdoor temperature and humidity data. Finally, the target indoor and outdoor temperature and humidity data at the same time are combined and processed to obtain target temperature and humidity information. The target temperature and humidity information at each time point is then aggregated to obtain a target temperature and humidity information set. This constructs the original data corresponding to the target workshop, providing a valid foundation for subsequent model training.

[0059] S250. Based on preset feature partitioning rules, the target temperature and humidity information set and target parameter information are reconstructed to obtain target feature sequences corresponding to target feature dimensions, and the target feature sequences corresponding to each target feature dimension are combined and processed to obtain the dataset corresponding to the target workshop; wherein, the dataset includes a training set, a validation set and a test set.

[0060] In an optional implementation, the target temperature and humidity information set and target parameter information are reconstructed based on a preset feature partitioning rule to obtain a target feature sequence corresponding to the target feature dimension, including:

[0061] Step a1: If the target feature dimension is the temperature and humidity dimension, then perform feature statistics on the target temperature and humidity information set based on a preset sliding window to obtain the statistical features corresponding to the target temperature and humidity information set; calculate the rate of change of the target temperature and humidity information in the target temperature and humidity information set based on a preset difference rule to obtain the temperature and humidity change rate corresponding to the target temperature and humidity information; summarize and process the statistical features and each temperature and humidity change rate corresponding to the same target temperature and humidity information set to obtain the temperature and humidity dimension feature sequence corresponding to the temperature and humidity dimension.

[0062] Here, a preset sliding window refers to a pre-defined value used to limit the length of data traversal. For example, a preset sliding window could be 24 hours. Feature statistics refer to the operation of extracting features from raw data using mathematical statistical methods. For example, feature statistics could include 24-hour mean calculation, variance calculation, extreme value calculation, skewness calculation, and kurtosis calculation. Statistical features refer to quantitative indicators extracted from raw data using mathematical statistical methods that can characterize the data distribution pattern or central tendency. For example, statistical features could include 24-hour mean, variance, extreme values, skewness, and kurtosis.

[0063] The preset difference rule refers to a pre-defined rule used to constrain the calculation process of the temperature change rate. For example, the preset difference rule can be either first-order or second-order difference. Typically, temperature and humidity data at continuous time points can be differencing to obtain a first-order time gradient trend, thus completing the first-order difference. Alternatively, the first-order time gradient trend can be differencing again to obtain a second-order time gradient acceleration, thus completing the second-order difference. The temperature and humidity change rate refers to the calculation result obtained after calculating the data according to the preset difference rule. For example, the temperature and humidity change rate can include both the first-order time gradient trend and the second-order time gradient acceleration. The temperature and humidity dimensional feature sequence refers to a feature set composed of statistical features corresponding to the same target temperature and humidity information set and various temperature and humidity change rates.

[0064] Therefore, by extracting features from the temperature and humidity dimensions, outdoor temperature and humidity can be incorporated into the dataset, enabling algorithms such as random forests to not only fit the data but also learn thermodynamic laws, ultimately achieving high-precision and strong generalization predictions, providing an effective foundation for subsequent model predictions.

[0065] Step a2: If the target feature dimension is a time dimension, then obtain the collection time information corresponding to the target temperature and humidity information in the target temperature and humidity information set based on the preset meteorological program interface; perform weight division on the collection time information based on the preset weight division rule to obtain the time weight relationship corresponding to the target temperature and humidity information; extract time features from the collection time information based on the preset time feature extraction rule to obtain the time features corresponding to the target temperature and humidity information; summarize and process the time weight relationship and time features corresponding to the same target temperature and humidity information as the time dimension feature information corresponding to the target temperature and humidity information, and summarize and process the time dimension feature information corresponding to each target temperature and humidity information in the target temperature and humidity information set to obtain the time dimension feature sequence corresponding to the time dimension.

[0066] The data acquisition time information refers to the data acquisition time corresponding to the target temperature and humidity information. For example, the data acquisition time information may include the season, month, and hour of data acquisition. The preset weighting rules refer to pre-defined rules used to limit the time weighting process. For example, the preset weighting rules may set the temperature weighting coefficient for seasons with large indoor-outdoor temperature differences, such as winter, to be greater than 1; and set the temperature weighting coefficient for seasons with small indoor-outdoor temperature differences, such as spring and autumn, to be approximately equal to 1. The time weighting relationship refers to the division result obtained after weighting using the preset weighting rules.

[0067] Among them, the preset time feature extraction rule can refer to the pre-defined rules used to limit the time feature extraction process. For example, the preset time feature extraction rule can be to perform feature matching on the collected time information according to a pre-defined time feature specification. For instance, the pre-defined time feature specification can be to divide each year into spring (March to March), summer (June to August), autumn (September to November), and winter (December to February of the following year). Time features can refer to the feature results obtained after extracting time features using the preset time feature extraction rule. For example, if the collected time information is a month, the time feature can be the season of that month and its proportion within the year; if the collected time information is an hour, the time feature can be the time period of the day, such as early morning, morning, or afternoon. Time dimension feature information can refer to the data combination composed of time features corresponding to the same target temperature and humidity information. A time dimension feature sequence can refer to the set of time dimension feature information corresponding to each target temperature and humidity information in the same target temperature and humidity information set.

[0068] Therefore, by systematically constructing time-dimensional features, the model can accurately capture the inertial mechanism, periodic patterns, and abrupt responses of temperature and humidity evolution, ultimately achieving predictive capabilities that surpass those of simple numerical fitting.

[0069] Step a3: If the target feature dimension is a process dimension, then the target parameter information is divided into processes based on the preset process division rules to determine the process stage set corresponding to the target workshop; the set temperature and humidity data corresponding to the target process stage in the process stage set is determined based on the target temperature and humidity information set and the preset data filtering rules; the set temperature and humidity data corresponding to each target process stage in the process stage set are summarized and processed to obtain the process dimension feature sequence corresponding to the process dimension.

[0070] Here, the preset process division rule refers to the pre-defined rules used to define the process flow. For example, the preset process division rule could be to match and divide parameter information according to the production plan corresponding to the target workshop. A process stage can refer to each time stage corresponding to the production process. For example, taking a non-constant temperature yarn-making workshop as an example, the process stages could be yarn drying, rehydration, and material feeding. A process stage set can refer to the set of all process stages corresponding to the same target workshop.

[0071] Here, the preset data filtering rules refer to pre-defined rules used to limit the data filtering process. For example, a preset data filtering rule could be to use the most frequently occurring temperature and humidity data within the same process stage as the data filtering result. The target process stage can refer to the selected process stage for data filtering. For example, the target process stage can be any process stage in the set of process stages. The set temperature and humidity data can refer to the typical temperature and humidity data characteristics determined for the target process stage based on the preset data filtering rules. The process dimension feature sequence can refer to the data sequence composed of the set temperature and humidity data corresponding to each target process stage in the set of process stages.

[0072] Therefore, by constructing the correlation features between process parameters and temperature and humidity data, temperature and humidity prediction can overcome the limitations of environmental data and truly serve process optimization, energy consumption control and yield improvement, providing an effective foundation for subsequent model prediction.

[0073] Step a4: If the target feature dimension is the environmental dimension, then the indoor and outdoor temperature and humidity difference at the target time is determined based on the relative difference between the target indoor temperature and humidity data and the target outdoor temperature and humidity data at the target time in the target temperature and humidity information set; the impact factor evaluation of the indoor and outdoor temperature and humidity difference is performed based on the preset environmental interaction rules and the target temperature and humidity information set to obtain the environmental coupling feature sequence corresponding to the environmental dimension.

[0074] The target time can refer to the selected data acquisition time for data processing. For example, the target time can be any data acquisition time corresponding to the target temperature and humidity information set. The relative difference can refer to the instantaneous difference between the target indoor temperature and humidity data and the target outdoor temperature and humidity data at the same target time. Typically, the relative difference can include both temperature and humidity differences. The indoor and outdoor temperature and humidity difference can refer to the relative difference between the target indoor temperature and humidity data and the target outdoor temperature and humidity data at the same target time.

[0075] Among them, the preset environmental interaction rules can refer to pre-defined rules used to limit the environmental impact assessment process. For example, the preset environmental interaction rules can be to calculate the difference between the target indoor temperature and humidity data after the target time and the target indoor temperature and humidity data at the corresponding target time. If the difference exceeds a set floating threshold, the relative difference is compared with a set assessment threshold. If the relative difference does not meet the set assessment threshold, the relative difference is used as an impact factor. Impact factor assessment can refer to the process of determining the environmental factors affecting the difference between indoor and outdoor temperature and humidity. Impact factors can refer to the environmental factors affecting the difference between indoor and outdoor temperature and humidity. For example, if high outdoor temperature causes the workshop temperature to rise through wall conduction, outdoor temperature can be used as an impact factor; similarly, if indoor humidity increases rapidly during heavy rain outdoors, outdoor humidity can be used as an impact factor. The environmental coupling feature sequence can refer to the set of impact factors corresponding to each target time in the target temperature and humidity information set.

[0076] Therefore, by quantifying the dynamic interactions among multiple environmental factors, the problem of nonlinear response in complex systems can be solved, and the prediction model can be upgraded from a simple statistical fitting to a physical mechanism-driven agent, providing an effective foundation for subsequent model training.

[0077] S260. Obtain the current hyperparameter combination in the preset hyperparameter set, and train the basic random forest model based on the current hyperparameter combination and the training set to obtain the candidate random forest model corresponding to the current hyperparameter combination.

[0078] Here, the preset hyperparameter set can refer to a pre-defined parameter grid containing various hyperparameter ranges. The current hyperparameter combination can refer to the hyperparameter combination selected at the current moment. For example, the current hyperparameter combination can be any hyperparameter combination in the preset hyperparameter set. The candidate random forest model can refer to the random forest model obtained after initial training of the basic random forest model.

[0079] S270. Based on the validation set and preset evaluation metrics, the performance of the candidate random forest model is evaluated to obtain the performance evaluation results corresponding to the candidate random forest model.

[0080] The preset evaluation metric refers to a pre-defined metric used to evaluate the accuracy of the output results of the candidate random forest model. For example, the preset evaluation metric could be classification accuracy, root mean square error, or mean absolute error. Typically, the preset evaluation metric is the same for each candidate random forest model in the same training epoch; this embodiment of the invention does not impose specific limitations on this. The performance evaluation result refers to the evaluation result generated after evaluating the performance of the candidate random forest model based on the preset evaluation metric.

[0081] S280. Based on the preset evaluation result judgment rules, the results of each performance evaluation result are judged to obtain the target performance evaluation result that satisfies the preset evaluation result judgment rules.

[0082] The preset evaluation result judgment rule can refer to a pre-defined rule used to limit the result judgment process. For example, the preset evaluation result judgment rule could be to calculate the average of the performance evaluation results across multiple iterations as the final performance evaluation result for that set of hyperparameters, and then filter the final performance evaluation result with the highest average score. The target performance evaluation result can refer to the performance evaluation result that satisfies the preset evaluation result judgment rule. For example, the target performance evaluation result could be the final performance evaluation result with the highest average score.

[0083] S290. Based on the current hyperparameter combination and training set corresponding to the target performance evaluation result, the basic random forest model is trained to obtain the first random forest model.

[0084] Specifically, after obtaining the dataset corresponding to the target workshop, the optimal combination of hyperparameters can be found through grid search and cross-validation. Then, a final random forest model is trained on the entire training set using this optimal hyperparameter combination. This yields a preliminarily trained first random forest model, providing a solid foundation for subsequent operations.

[0085] S2100. Obtain the feature importance score results corresponding to each target feature dimension output by the first random forest model.

[0086] The feature importance score refers to the sum of the reductions in node impurity caused by splitting the feature across all trees. Generally, the smaller the reduction, the more important the feature.

[0087] S2110. Based on the preset importance scoring result analysis rules, perform importance analysis on the feature importance scoring results, generate importance analysis results, and perform feature filtering on the training set and validation set based on the importance analysis results to determine the first feature subset and the second feature subset.

[0088] The preset importance scoring result analysis rule can refer to a pre-defined rule used to limit the analysis process of feature importance scoring results. For example, the preset importance scoring result analysis rule can be to judge the importance analysis results using an importance threshold. The importance analysis result can refer to the judgment result obtained after performing importance analysis on the feature importance scoring results using the preset importance scoring result analysis rule. For example, the importance analysis result can be an important feature dimension, or important feature data within a certain feature dimension. Feature selection can refer to the process of selecting features from the training set and validation set using the importance analysis result. For example, feature selection can be to select important feature dimensions from the training set and validation set, or to retain important feature data within a certain feature dimension of the training set and validation set. The first feature subset can refer to the feature subset obtained after feature selection of the training set. The second feature subset can refer to the feature subset obtained after feature selection of the validation set.

[0089] S2120. Based on the preset grid search method, preset cross-validation method, first feature subset and second feature subset, the basic random forest model is trained to obtain a second random forest model, and the second random forest model with a preset number of models is aggregated to obtain a target random forest model containing the preset number of models.

[0090] The second random forest model can refer to the final trained random forest model.

[0091] Specifically, after obtaining the first random forest model, an importance analysis can be performed on the feature importance scores of the first random forest model using preset importance scoring rules. Based on the importance analysis results, features are then filtered on the training and validation sets to determine the first and second feature subsets. Next, the training process for the basic random forest model is repeated using the first and second feature subsets to obtain a trained second random forest model. Finally, a preset number of second random forest models are aggregated to obtain the target random forest model. Thus, combining multiple random forest models can improve prediction stability.

[0092] S2130. Based on the target random forest model, perform data prediction on the test set to obtain temperature and humidity prediction results and prediction result evaluation indicators within a preset time range.

[0093] It is worth noting that, in this embodiment of the invention, after obtaining the temperature and humidity prediction results and the prediction result evaluation indicators within a preset time range, the results can be displayed on the front end.

[0094] In an optional implementation, after the data prediction of the test set based on the target random forest model to obtain the temperature and humidity prediction results and prediction result evaluation indicators within a preset time range, the method may further include: performing a threshold judgment on the temperature and humidity prediction results based on a preset process threshold to generate a threshold judgment result; generating an early warning instruction corresponding to the target workshop based on the threshold judgment result and a preset early warning mechanism, and sending the early warning instruction to the workshop control system corresponding to the target workshop.

[0095] The preset process threshold refers to a pre-set value used to evaluate the temperature and humidity prediction results. Typically, different process parameters correspond to different preset process thresholds, and the same process parameter can also correspond to different preset process thresholds for different alarm levels. The threshold judgment result refers to the judgment result obtained after judging the temperature and humidity prediction results using the preset process threshold. For example, the threshold judgment result can be either exceeding the preset process threshold or meeting the preset process threshold. The preset early warning mechanism refers to pre-set rules used to limit the early warning process. For example, the preset early warning mechanism can include early warning methods corresponding to different alarm levels. For instance, if the alarm level is warning, the preset early warning mechanism can be a message pop-up; if the alarm level is severe, the preset early warning mechanism can be a message bounce; if the alarm level is emergency, the preset early warning mechanism can be a ringing alarm. The early warning instruction refers to the corresponding early warning trigger instruction generated based on the threshold judgment result and the preset early warning mechanism. The workshop control system refers to a system used to control the workshop production process.

[0096] Specifically, after obtaining the temperature and humidity prediction results within a preset time range, a threshold judgment can be performed on the predicted results using a preset process threshold. If the threshold judgment result indicates that the predicted temperature and humidity exceed the preset process threshold, a warning instruction corresponding to the target workshop is generated according to a preset warning mechanism and sent to the workshop control system corresponding to the target workshop. This allows staff to receive timely warning information, adjust parameters, and ensure quality stability during the production process.

[0097] The technical solution of this invention involves acquiring basic outdoor temperature and humidity data corresponding to the target workshop in real time through a preset meteorological program interface, collecting basic indoor temperature and humidity data corresponding to the target workshop in real time based on a preset Internet of Things sensor network, determining target operating parameters and target process parameters corresponding to the target workshop based on a preset manufacturing execution system, combining and processing the target operating parameters and target process parameters to obtain target parameter information, performing data preprocessing on the basic outdoor temperature and humidity data and basic indoor temperature and humidity data based on preset data processing rules to obtain target indoor temperature and humidity data and target outdoor temperature and humidity data, combining and processing the target indoor temperature and humidity data and target outdoor temperature and humidity data corresponding to the same moment to obtain target temperature and humidity information, and summarizing and processing the target temperature and humidity information corresponding to each moment to obtain a target temperature and humidity information set. Furthermore, based on preset feature segmentation rules, feature reconstruction is performed on the target temperature and humidity information set and target parameter information to obtain target feature sequences corresponding to target feature dimensions, and combining and processing the target feature sequences corresponding to each target feature dimension to obtain the dataset corresponding to the target workshop. Furthermore, the current hyperparameter combination in the preset hyperparameter set is obtained. Based on the current hyperparameter combination and the training set, the basic random forest model is trained to obtain candidate random forest models corresponding to the current hyperparameter combination. The performance of the candidate random forest models is evaluated based on the validation set and preset evaluation metrics to obtain the performance evaluation results corresponding to the candidate random forest models. Based on preset evaluation result judgment rules, each performance evaluation result is judged to obtain the target performance evaluation result that meets the preset evaluation result judgment rules. Based on the current hyperparameter combination and training set corresponding to the target performance evaluation result, the basic random forest model is trained to obtain the first random forest model. Further, the feature importance score results corresponding to each target feature dimension output by the first random forest model are obtained. Based on preset importance score result analysis rules, the feature importance score results are analyzed to generate importance analysis results. Based on the importance analysis results, features are filtered on the training set and validation set to determine the first feature subset and the second feature subset. Finally, a second random forest model is trained based on a preset grid search method, a preset cross-validation method, and a first and second feature subset. This second random forest model is then aggregated to obtain a target random forest model containing the preset number of models. Data prediction on the test set is then performed based on the target random forest model to obtain temperature and humidity prediction results and evaluation metrics within a preset time range. By combining the random forest model with feature engineering for temperature and humidity prediction, the problem of inaccurate predictions due to external climate fluctuations is solved. This enables rapid prediction of temperature and humidity in non-constant temperature industrial scenarios, improving the accuracy and efficiency of temperature and humidity prediction results in such scenarios.

[0098] Figure 3The diagram shows a flowchart of an optional temperature and humidity prediction method based on a random forest model provided by an embodiment of the present invention. Specifically, firstly, basic outdoor temperature and humidity data corresponding to the target workshop are acquired in real time through a preset meteorological program interface, and basic indoor temperature and humidity data corresponding to the target workshop are collected in real time through a preset Internet of Things sensor network. Then, target operating parameters and target process parameters corresponding to the target workshop are determined through a preset manufacturing execution system. Next, the basic outdoor and indoor temperature and humidity data are preprocessed using preset data processing rules to obtain target indoor and outdoor temperature and humidity data. The target indoor and outdoor temperature and humidity data corresponding to the same moment are combined to obtain target temperature and humidity information. The target temperature and humidity information corresponding to each moment is summarized to obtain a target temperature and humidity information set. The target operating parameters and target process parameters are then combined to obtain target parameter information. Further, based on preset feature partitioning rules, the target temperature and humidity information set and target parameter information are reconstructed to obtain target feature sequences corresponding to target feature dimensions. The target feature sequences corresponding to each target feature dimension are then combined to obtain the dataset corresponding to the target workshop, thus realizing the construction of a multi-dimensional feature engineering system. Furthermore, a basic random forest model is trained using a preset grid search method, a preset cross-validation method, and training and validation sets to obtain a first random forest model. This first random forest model is then optimized using a preset feature importance analysis strategy to obtain a target random forest model containing a preset number of models. Finally, data prediction is performed on the test set based on the target random forest model to obtain temperature and humidity prediction results and evaluation metrics within a preset time range. This achieves high-precision temperature and humidity prediction.

[0099] It is worth noting that, in this embodiment of the invention, in addition to inputting the test set into the target random forest model for data prediction, the real-time collected data can also be processed to obtain a feature matrix, and the processed feature matrix can be input into the target random forest model for data prediction. This embodiment of the invention does not impose specific limitations on this.

[0100] Example 3

[0101] Figure 4 This is a schematic diagram of a temperature and humidity prediction device based on a random forest model provided in Embodiment 3 of the present invention. Figure 4 As shown, the device includes: a data acquisition module 310, a feature reconstruction module 320, a model optimization module 330, and a data prediction module 340;

[0102] The data acquisition module 310 is used to acquire the target temperature and humidity information set and target parameter information corresponding to the target workshop; wherein, the target temperature and humidity information set includes the target temperature and humidity information corresponding to each time moment; the target temperature and humidity information includes target indoor temperature and humidity data and target outdoor temperature and humidity data; the target parameter information includes target operating parameters and target process parameters;

[0103] The feature reconstruction module 320 is used to reconstruct the target temperature and humidity information set and target parameter information based on a preset feature partitioning rule, to obtain the target feature sequence corresponding to the target feature dimension, and to combine and process the target feature sequences corresponding to each target feature dimension to obtain the dataset corresponding to the target workshop; wherein, the dataset includes a training set, a validation set and a test set;

[0104] The model optimization module 330 is used to train the basic random forest model based on a preset grid search method, a preset cross-validation method, a training set and a validation set to obtain a first random forest model, and to optimize the first random forest model based on a preset feature importance analysis strategy to obtain a target random forest model containing a preset number of models.

[0105] The data prediction module 340 is used to perform data prediction on the test set based on the target random forest model to obtain the temperature and humidity prediction results and the prediction result evaluation index within a preset time range.

[0106] The technical solution of this invention involves acquiring a set of target temperature and humidity information and target parameter information corresponding to a target workshop. Then, based on preset feature partitioning rules, the target temperature and humidity information set and target parameter information are reconstructed to obtain target feature sequences corresponding to target feature dimensions. These target feature sequences are then combined to obtain a dataset corresponding to the target workshop, including a training set, a validation set, and a test set. Further, a basic random forest model is trained using a preset grid search method, a preset cross-validation method, and the training and validation sets to obtain a first random forest model. This first random forest model is then optimized using a preset feature importance analysis strategy to obtain a target random forest model containing a preset number of models. Finally, data prediction is performed on the test set based on the target random forest model to obtain temperature and humidity prediction results and evaluation metrics within a preset time range. By combining the random forest model and feature engineering for temperature and humidity prediction, the problem of inaccurate temperature and humidity prediction caused by external climate fluctuations is solved. This enables rapid prediction of temperature and humidity in non-constant temperature industrial scenarios, improving the accuracy and efficiency of temperature and humidity prediction results in such scenarios.

[0107] Optionally, the data acquisition module 310 can be used for:

[0108] The basic outdoor temperature and humidity data corresponding to the target workshop are obtained in real time based on the preset meteorological program interface, and the basic indoor temperature and humidity data corresponding to the target workshop are collected in real time based on the preset Internet of Things sensor network.

[0109] Based on the preset manufacturing execution system, the target operating parameters and target process parameters corresponding to the target workshop are determined, and the target operating parameters and target process parameters are combined and processed to obtain the target parameter information;

[0110] Based on preset data processing rules, the basic outdoor temperature and humidity data and the basic indoor temperature and humidity data are preprocessed to obtain the target indoor temperature and humidity data and the target outdoor temperature and humidity data.

[0111] Combine the target indoor temperature and humidity data and the target outdoor temperature and humidity data corresponding to the same moment to obtain the target temperature and humidity information, and summarize the target temperature and humidity information corresponding to each moment to obtain the target temperature and humidity information set.

[0112] Optional target feature dimensions include: temperature and humidity dimension, time dimension, process dimension, and environment dimension.

[0113] Optionally, the feature reconstruction module 320 can be used for:

[0114] If the target feature dimension is a temperature and humidity dimension, then feature statistics are performed on the target temperature and humidity information set based on a preset sliding window to obtain the statistical features corresponding to the target temperature and humidity information set; the rate of change of the target temperature and humidity information in the target temperature and humidity information set is calculated based on a preset difference rule to obtain the temperature and humidity change rate corresponding to the target temperature and humidity information; the statistical features and each temperature and humidity change rate corresponding to the same target temperature and humidity information set are summarized and processed to obtain the temperature and humidity dimension feature sequence corresponding to the temperature and humidity dimension.

[0115] If the target feature dimension is a time dimension, then the collection time information corresponding to the target temperature and humidity information in the target temperature and humidity information set is obtained based on a preset meteorological program interface; the collection time information is weighted according to a preset weighting rule to obtain the time weight relationship corresponding to the target temperature and humidity information; the collection time information is extracted according to a preset time feature extraction rule to obtain the time feature corresponding to the target temperature and humidity information; the time weight relationship and time feature corresponding to the same target temperature and humidity information are summarized and processed as the time dimension feature information corresponding to the target temperature and humidity information, and the time dimension feature information corresponding to each target temperature and humidity information in the target temperature and humidity information set is summarized and processed to obtain the time dimension feature sequence corresponding to the time dimension.

[0116] If the target feature dimension is a process dimension, then the target parameter information is divided into processes based on preset process division rules to determine the process stage set corresponding to the target workshop; the set temperature and humidity data corresponding to the target process stage in the process stage set is determined based on the target temperature and humidity information set and preset data filtering rules; the set temperature and humidity data corresponding to each target process stage in the process stage set are summarized and processed to obtain the process dimension feature sequence corresponding to the process dimension.

[0117] If the target feature dimension is the environmental dimension, then the indoor and outdoor temperature and humidity difference at the target time is determined based on the relative difference between the target indoor temperature and humidity data and the target outdoor temperature and humidity data at the target time in the target temperature and humidity information set; the impact factor evaluation of the indoor and outdoor temperature and humidity difference is performed based on the preset environmental interaction rules and the target temperature and humidity information set to obtain the environmental coupling feature sequence corresponding to the environmental dimension.

[0118] Optional, model optimization module 330, specifically can be used for:

[0119] Obtain the current hyperparameter combination in the preset hyperparameter set, and train the basic random forest model based on the current hyperparameter combination and the training set to obtain the candidate random forest model corresponding to the current hyperparameter combination;

[0120] The performance of the candidate random forest models is evaluated based on the validation set and preset evaluation metrics to obtain the performance evaluation results corresponding to the candidate random forest models.

[0121] Based on the preset evaluation result judgment rules, each performance evaluation result is judged to obtain the target performance evaluation result that satisfies the preset evaluation result judgment rules;

[0122] Based on the current hyperparameter combination and training set corresponding to the target performance evaluation results, the basic random forest model is trained to obtain the first random forest model.

[0123] Optional, model optimization module 330, specifically can be used for:

[0124] Obtain the feature importance scores corresponding to each target feature dimension output by the first random forest model;

[0125] The importance of the feature importance score results are analyzed based on the preset importance score result analysis rules to generate importance analysis results. Based on the importance analysis results, the training set and validation set are selected for feature filtering to determine the first feature subset and the second feature subset.

[0126] The basic random forest model is trained based on the preset grid search method, preset cross-validation method, first feature subset and second feature subset to obtain a second random forest model. The second random forest model with a preset number of models is then aggregated to obtain a target random forest model containing the preset number of models.

[0127] Optionally, the temperature and humidity prediction device based on the random forest model may further include: an early warning module, used to perform a threshold judgment on the temperature and humidity prediction results based on a preset process threshold after the test set is predicted based on the target random forest model to obtain the temperature and humidity prediction results and prediction result evaluation indicators within a preset time range, and generate a threshold judgment result; generate an early warning instruction corresponding to the target workshop based on the threshold judgment result and a preset early warning mechanism, and send the early warning instruction to the workshop control system corresponding to the target workshop.

[0128] The temperature and humidity prediction device based on the random forest model provided in this embodiment of the invention can execute the temperature and humidity prediction method based on the random forest model provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0129] Example 4

[0130] Figure 5 A schematic diagram of an electronic device 410 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0131] like Figure 5As shown, the electronic device 410 includes at least one processor 420 and a memory, such as a read-only memory (ROM) 430 or a random access memory (RAM) 440, communicatively connected to the at least one processor 420. The memory stores computer programs executable by the at least one processor. The processor 420 can perform various appropriate actions and processes based on the computer program stored in the ROM 430 or loaded into the RAM 440 from storage unit 490. The RAM 440 may also store various programs and data required for the operation of the electronic device 410. The processor 420, ROM 430, and RAM 440 are interconnected via a bus 450. An input / output (I / O) interface 460 is also connected to the bus 450.

[0132] Multiple components in electronic device 410 are connected to I / O interface 460, including: input unit 470, such as keyboard, mouse, etc.; output unit 480, such as various types of monitors, speakers, etc.; storage unit 490, such as disk, optical disk, etc.; and communication unit 4100, such as network card, modem, wireless transceiver, etc. Communication unit 4100 allows electronic device 410 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0133] Processor 420 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 420 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 420 performs the various methods and processes described above, such as a temperature and humidity prediction method based on a random forest model.

[0134] The method includes:

[0135] Obtain the target temperature and humidity information set and target parameter information corresponding to the target workshop; wherein, the target temperature and humidity information set includes the target temperature and humidity information corresponding to each time moment; the target temperature and humidity information includes target indoor temperature and humidity data and target outdoor temperature and humidity data; the target parameter information includes target operating parameters and target process parameters;

[0136] Based on preset feature segmentation rules, the target temperature and humidity information set and target parameter information are reconstructed to obtain target feature sequences corresponding to target feature dimensions. The target feature sequences corresponding to each target feature dimension are then combined and processed to obtain the dataset corresponding to the target workshop. The dataset includes a training set, a validation set, and a test set.

[0137] The basic random forest model is trained using a preset grid search method, a preset cross-validation method, a training set, and a validation set to obtain a first random forest model. The first random forest model is then optimized using a preset feature importance analysis strategy to obtain a target random forest model containing a preset number of models.

[0138] The test set is predicted based on the objective random forest model to obtain temperature and humidity prediction results and evaluation indicators within a preset time range.

[0139] In some embodiments, the temperature and humidity prediction method based on a random forest model can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 490. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 410 via ROM 430 and / or communication unit 4100. When the computer program is loaded into RAM 440 and executed by processor 420, one or more steps of the temperature and humidity prediction method based on a random forest model described above can be performed. Alternatively, in other embodiments, processor 420 can be configured to perform the temperature and humidity prediction method based on a random forest model by any other suitable means (e.g., by means of firmware).

[0140] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0141] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0142] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0143] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0144] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0145] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0146] This application also discloses a computer program product, which includes a computer program that, when executed by a processor, implements the temperature and humidity prediction method based on a random forest model provided in any embodiment of this application. This program product shares the same inventive concept as the temperature and humidity prediction method based on a random forest model disclosed in the embodiments of this application, and therefore will not be described in detail here.

[0147] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0148] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for predicting temperature and humidity based on a random forest model, characterized in that, include: Obtain the target temperature and humidity information set and target parameter information corresponding to the target workshop; wherein, the target temperature and humidity information set includes the target temperature and humidity information corresponding to each time moment; the target temperature and humidity information includes target indoor temperature and humidity data and target outdoor temperature and humidity data; the target parameter information includes target operating parameters and target process parameters; Based on preset feature segmentation rules, the target temperature and humidity information set and target parameter information are reconstructed to obtain target feature sequences corresponding to target feature dimensions. The target feature sequences corresponding to each target feature dimension are then combined and processed to obtain the dataset corresponding to the target workshop. The dataset includes a training set, a validation set, and a test set. The basic random forest model is trained using a preset grid search method, a preset cross-validation method, a training set, and a validation set to obtain a first random forest model. The first random forest model is then optimized using a preset feature importance analysis strategy to obtain a target random forest model containing a preset number of models. The test set is predicted based on the objective random forest model to obtain temperature and humidity prediction results and evaluation indicators within a preset time range.

2. The method according to claim 1, characterized in that, The acquisition of the target temperature and humidity information set and target parameter information corresponding to the target workshop includes: The basic outdoor temperature and humidity data corresponding to the target workshop are obtained in real time based on the preset meteorological program interface, and the basic indoor temperature and humidity data corresponding to the target workshop are collected in real time based on the preset Internet of Things sensor network. Based on the preset manufacturing execution system, the target operating parameters and target process parameters corresponding to the target workshop are determined, and the target operating parameters and target process parameters are combined and processed to obtain the target parameter information; Based on preset data processing rules, the basic outdoor temperature and humidity data and the basic indoor temperature and humidity data are preprocessed to obtain the target indoor temperature and humidity data and the target outdoor temperature and humidity data. Combine the target indoor temperature and humidity data and the target outdoor temperature and humidity data corresponding to the same moment to obtain the target temperature and humidity information, and summarize the target temperature and humidity information corresponding to each moment to obtain the target temperature and humidity information set.

3. The method according to claim 1, characterized in that, The target feature dimensions include: temperature and humidity dimension, time dimension, process dimension, and environment dimension.

4. The method according to claim 3, characterized in that, The step of reconstructing the target temperature and humidity information set and target parameter information based on preset feature segmentation rules to obtain the target feature sequence corresponding to the target feature dimension includes: If the target feature dimension is a temperature and humidity dimension, then feature statistics are performed on the target temperature and humidity information set based on a preset sliding window to obtain the statistical features corresponding to the target temperature and humidity information set; the rate of change of the target temperature and humidity information in the target temperature and humidity information set is calculated based on a preset difference rule to obtain the temperature and humidity change rate corresponding to the target temperature and humidity information; the statistical features and each temperature and humidity change rate corresponding to the same target temperature and humidity information set are summarized and processed to obtain the temperature and humidity dimension feature sequence corresponding to the temperature and humidity dimension. If the target feature dimension is a time dimension, then the collection time information corresponding to the target temperature and humidity information in the target temperature and humidity information set is obtained based on a preset meteorological program interface; the collection time information is weighted according to a preset weighting rule to obtain the time weight relationship corresponding to the target temperature and humidity information; the collection time information is extracted according to a preset time feature extraction rule to obtain the time feature corresponding to the target temperature and humidity information; the time weight relationship and time feature corresponding to the same target temperature and humidity information are summarized and processed as the time dimension feature information corresponding to the target temperature and humidity information, and the time dimension feature information corresponding to each target temperature and humidity information in the target temperature and humidity information set is summarized and processed to obtain the time dimension feature sequence corresponding to the time dimension. If the target feature dimension is a process dimension, then the target parameter information is divided into processes based on preset process division rules to determine the process stage set corresponding to the target workshop; the set temperature and humidity data corresponding to the target process stage in the process stage set is determined based on the target temperature and humidity information set and preset data filtering rules; the set temperature and humidity data corresponding to each target process stage in the process stage set are summarized and processed to obtain the process dimension feature sequence corresponding to the process dimension. If the target feature dimension is the environmental dimension, then the indoor and outdoor temperature and humidity difference at the target time is determined based on the relative difference between the target indoor temperature and humidity data and the target outdoor temperature and humidity data at the target time in the target temperature and humidity information set; the impact factor evaluation of the indoor and outdoor temperature and humidity difference is performed based on the preset environmental interaction rules and the target temperature and humidity information set to obtain the environmental coupling feature sequence corresponding to the environmental dimension.

5. The method according to claim 1, characterized in that, The first random forest model is obtained by training a basic random forest model based on a preset grid search method, a preset cross-validation method, a training set, and a validation set, including: Obtain the current hyperparameter combination in the preset hyperparameter set, and train the basic random forest model based on the current hyperparameter combination and the training set to obtain the candidate random forest model corresponding to the current hyperparameter combination; The performance of the candidate random forest models is evaluated based on the validation set and preset evaluation metrics to obtain the performance evaluation results corresponding to the candidate random forest models. Based on the preset evaluation result judgment rules, each performance evaluation result is judged to obtain the target performance evaluation result that satisfies the preset evaluation result judgment rules; Based on the current hyperparameter combination and training set corresponding to the target performance evaluation results, the basic random forest model is trained to obtain the first random forest model.

6. The method according to claim 1, characterized in that, The optimization of the first random forest model based on a preset feature importance analysis strategy to obtain a target random forest model containing a preset number of models includes: Obtain the feature importance scores corresponding to each target feature dimension output by the first random forest model; The importance of the feature importance score results are analyzed based on the preset importance score result analysis rules to generate importance analysis results. Based on the importance analysis results, the training set and validation set are selected for feature filtering to determine the first feature subset and the second feature subset. The basic random forest model is trained based on the preset grid search method, preset cross-validation method, first feature subset and second feature subset to obtain a second random forest model. The second random forest model with a preset number of models is then aggregated to obtain a target random forest model containing the preset number of models.

7. The method according to claim 1, characterized in that, After performing data prediction on the test set based on the target random forest model to obtain the temperature and humidity prediction results and evaluation indicators for the prediction results within a preset time range, the method further includes: Based on a preset process threshold, the temperature and humidity prediction results are judged to generate a threshold judgment result. Based on the threshold judgment result and the preset early warning mechanism, an early warning instruction corresponding to the target workshop is generated, and the early warning instruction is sent to the workshop control system corresponding to the target workshop.

8. A temperature and humidity prediction device based on a random forest model, characterized in that, include: The data acquisition module is used to acquire the target temperature and humidity information set and target parameter information corresponding to the target workshop; wherein, the target temperature and humidity information set includes the target temperature and humidity information corresponding to each time moment; the target temperature and humidity information includes target indoor temperature and humidity data and target outdoor temperature and humidity data; the target parameter information includes target operating parameters and target process parameters; The feature reconstruction module is used to reconstruct the target temperature and humidity information set and target parameter information based on preset feature partitioning rules, obtain the target feature sequence corresponding to the target feature dimension, and combine the target feature sequences corresponding to each target feature dimension to obtain the dataset corresponding to the target workshop; wherein, the dataset includes a training set, a validation set and a test set; The model optimization module is used to train the basic random forest model based on a preset grid search method, a preset cross-validation method, a training set and a validation set to obtain a first random forest model, and to optimize the first random forest model based on a preset feature importance analysis strategy to obtain a target random forest model containing a preset number of models. The data prediction module is used to perform data prediction on the test set based on the target random forest model, and obtain the temperature and humidity prediction results and the prediction result evaluation index within a preset time range.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the temperature and humidity prediction method based on the random forest model according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the temperature and humidity prediction method based on the random forest model as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Dehumidification system humidity prediction method and system based on improved SVR

    CN116415208A

  • Automatic control method and system for outdoor shutter awning

    CN118963099A

  • Intelligent fresh air handling unit self-adaptive environment regulation and control method and system based on Internet of Things

    CN120176266A

  • Intelligent integrated warehouse logistics management method based on electronic tag

    CN120317789A

  • Temperature and humidity prediction method and prediction system for tobacco processing environment

    CN120449114A

Cited By

  • Extreme low temperature season prediction method and system based on time scale separation, and medium

    CN121808652A