A prefabricated cabin temperature and humidity prediction method and system based on multi-source data fusion

By using a multi-source data fusion prediction method, combined with the temperature and humidity inside and outside the prefabricated cabin and the status of HVAC equipment, and employing an LSTM model and unified complex plane coding rules, the problems of lagging temperature and humidity control and independent operation of equipment in the prefabricated cabin substation were solved, thus achieving stable cabin environment and coordinated equipment control.

CN121901685BActive Publication Date: 2026-05-29QINGDAO TGOOD ELECTRIC

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
QINGDAO TGOOD ELECTRIC
Filing Date
2026-03-20
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

The existing prefabricated substations lack advanced sensing capabilities for temperature and humidity control, resulting in control lag. Furthermore, the independent operation of HVAC equipment lacks a collaborative control mechanism, making it difficult to ensure the stable operation of power equipment.

Method used

A prediction method based on multi-source data fusion is adopted, which combines the temperature and humidity inside and outside the prefabricated cabin with the operating status of HVAC equipment. The LSTM model is used to predict temperature and humidity, and the impact of the start-up and shutdown combination of HVAC equipment on temperature and humidity is learned through unified complex plane coding rules to achieve coordinated control.

Benefits of technology

It enables advanced sensing and timely and accurate control of temperature and humidity inside the prefabricated cabin, improving the stability of the cabin environment and enhancing the coordinated control effect of HVAC equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121901685B_ABST
    Figure CN121901685B_ABST
Patent Text Reader

Abstract

The application relates to the field of temperature and humidity prediction, and discloses a prefabricated cabin temperature and humidity prediction method and system based on multi-source data fusion, which comprises the following steps: obtaining a historical data set; obtaining a test set, a verification set and a training set; constructing a time series temperature and humidity prediction model, initializing model parameters, constructing an optimizer and a callback function; training the initialized time series temperature and humidity prediction model by using the training set and the verification set; evaluating the temperature and humidity prediction model on the test set by using evaluation indexes, and outputting the temperature and humidity prediction model after the evaluation indexes are met; and predicting the future cabin temperature and humidity sequence by using the temperature and humidity prediction model. The application can fuse multi-source data to realize accurate prediction of the temperature and humidity in a prefabricated cabin.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of temperature and humidity monitoring technology for prefabricated substations, specifically to a method and system for predicting temperature and humidity in prefabricated substations based on multi-source data fusion. Background Technology

[0002] Prefabricated substations, as a modular power facility solution, have been widely applied across various complex environments nationwide, including strong winds and sandstorms, high salt spray, high humidity and heat, strong typhoons, extreme cold, and conventional climates. Under these conditions, the stability of temperature and humidity inside the prefabricated substation directly affects the operating efficiency and service life of the power equipment. Due to the variable external environment, the operating environment inside the substation also fluctuates, easily leading to a series of problems, such as accelerated aging of electronic components in secondary equipment, increased probability of partial discharge due to moisture in the insulating medium, and electrochemical corrosion caused by condensation. These issues not only increase maintenance costs but also pose a threat to power grid safety.

[0003] Currently, the temperature control strategies commonly used in prefabricated cabins are mostly based on fixed thresholds to control the start and stop of HVAC equipment (such as air conditioners, fans, dehumidifiers, and electric heaters). These strategies lack the ability to anticipate environmental changes, resulting in poor real-time performance and control lag. In addition, various HVAC equipment within the cabin typically operate independently, lacking a coordinated control mechanism, making it difficult to ensure the stable operation of automated devices within the prefabricated cabin.

[0004] In recent years, the development of deep learning technology, especially in time series prediction, has provided new possibilities for temperature and humidity control in prefabricated substations. Among them, Long Short-Term Memory (LSTM) networks have attracted widespread attention in power system state prediction due to their excellent prediction performance and low algorithm complexity of O(n). However, traditional prediction methods based on LSTM models mostly only consider the single feature of historical temperature and humidity, which cannot truly reflect the actual operating conditions of the various types of HVAC equipment in prefabricated substations, nor can they combine the actual operating status of HVAC equipment, thus making it difficult to provide effective guidance for subsequent equipment coordinated control. Summary of the Invention

[0005] To address the aforementioned technical problems, one objective of this invention is to provide a prefabricated cabin temperature and humidity prediction method based on multi-source data fusion. This method accurately predicts the cabin temperature and humidity based on multi-source data including external temperature and humidity, internal temperature and humidity, and the operating status of various HVAC equipment. Furthermore, the prediction results can provide advanced guidance for the coordinated control of various HVAC equipment, thereby improving the accuracy and timeliness of cabin temperature and humidity control.

[0006] To address the aforementioned technical problems, the present invention proposes the following technical solution:

[0007] This application relates to a method for predicting the temperature and humidity of prefabricated cabins based on multi-source data fusion, including:

[0008] S1: Obtain historical datasets;

[0009] The historical dataset includes the temperature and humidity inside the prefabricated cabin, the temperature and humidity outside the prefabricated cabin, the dimensional features of different types of HVAC equipment, and the encoded time features. The time features are periodically encoded to obtain the encoded time features. The status encoding of the same type of HVAC equipment is specifically as follows:

[0010] Different phase angles are assigned to similar HVAC equipment in a fixed sequence;

[0011] The states of similar HVAC equipment are mapped to the amplitude of a complex vector. When the operating states of HVAC equipment are not limited to the on / off state, the corresponding phase angle and / or amplitude are modulated according to other different operating states of similar HVAC equipment.

[0012] After summing the complex vectors of similar HVAC equipment, the real and imaginary parts are obtained and used as the dimensional features of the similar HVAC equipment.

[0013] S2: Divide the historical dataset into test set, validation set and training set;

[0014] S3: Construct a time-series temperature and humidity prediction model and initialize the model parameters, and construct the optimizer and callback function;

[0015] S4: Use the training set and validation set to train the initialized time series temperature and humidity prediction model. During the training process, continuously use the optimizer and callback function to optimize the model until the time series temperature and humidity prediction model converges, which is then used as the target temperature and humidity prediction model.

[0016] S5: Evaluate the target temperature and humidity prediction model on the test set using evaluation metrics, and output the target temperature and humidity prediction model after the evaluation metrics are met.

[0017] S6: Obtain the temperature and humidity inside the prefabricated cabin, the temperature and humidity outside the prefabricated cabin, the dimensional features of all HVAC equipment, and the encoded time features, and input them into the target temperature and humidity prediction model to predict and output the future temperature and humidity sequence inside the cabin.

[0018] In some embodiments of this application, the HVAC equipment includes a fan, and / or an air conditioner, and / or a dehumidifier, and / or an electric heater;

[0019] When the HVAC equipment is a fan, the fan status code is... ,

[0020] Where N is the total number of wind turbines. The phase angle represents the operating state of the i-th wind turbine. This indicates the i-th wind turbine, when it is started. It is either 0 or 1, when the device is turned off. It is the other one between 0 and 1;

[0021] When the HVAC equipment is an air conditioner, the air conditioner status code is... , amplitude A i =power1 i ×f temp (T set,i );

[0022] in, Total number of air conditioners, phase angle This indicates that when the i-th air conditioner is turned on, power1... i It is either 0 or 1, and power1 is used when the device is off. i For the other of 0 and 1, T set,i The set temperature for the i-th air conditioner, and the amplitude scaling factor f used to modulate the amplitude. temp (T) = (TT) min ) / (T max -T min ), T min and T max These are the minimum and maximum values ​​of the specified operating temperature, used for the phase shift of the modulated phase angle. This represents the different operating modes of the i-th air conditioner;

[0023] When the HVAC equipment is a dehumidifier, the dehumidifier status code is... Amplitude B i =power2 i ×(1-f humidity (H set,i ));

[0024] in, Total number of dehumidifiers, phase angle This indicates that when the i-th dehumidifier is turned on, power2... i It is either 0 or 1, when power is off, power2 i H is the other one between 0 and 1. set,i The set humidity for the i-th dehumidifier, and the amplitude scaling factor 1-f used to modulate the amplitude. humidity (H) = 1 - (HH) min ) / (H max -H min ), H min and H max These are the minimum and maximum humidity values ​​specified for the work operation, respectively.

[0025] When the heating and ventilation equipment is an electric heater, the electric heater status code is: ;

[0026] in, P represents the total number of electric heaters. i The phase angle represents the operating state of the i-th electric heater. P represents the i-th electric heater, when it is turned on. i P is either 0 or 1 when the device is powered off. i It is the other one between 0 and 1;

[0027] Where j represents an imaginary number.

[0028] In some embodiments of this application, the prefabricated cabin temperature and humidity prediction method further includes:

[0029] The process of pre-treating the temperature and humidity inside and outside the prefabricated cabin before using them.

[0030] In some embodiments of this application, the pretreatment process for temperature and humidity inside the prefabricated cabin is as follows:

[0031] Multiple temperature and humidity data were collected from multiple temperature and humidity sensors located at different key positions within the prefabricated cabin.

[0032] Multiple temperature and humidity outliers were detected and processed to obtain the corresponding T values. i and H i Where i represents the sensor number, i=1,2,...,n, n≥3, T i and H i These are the temperature and humidity corresponding to the i-th temperature and humidity sensor, respectively;

[0033] The equivalent temperature T and equivalent humidity H inside the prefabricated cabin are calculated as follows:

[0034] A three-dimensional rectangular coordinate system is established within the prefabricated cabin, defining the spatial coordinates (x, y) of each temperature and humidity sensor within this system. i ,y i ,z i );

[0035] Set the target point (x0, y0, z0);

[0036] Calculate the three-dimensional Euclidean distance d between each temperature and humidity sensor and the target point. i ;

[0037] Obtain the weights of each temperature and humidity sensor. Where p is a preset positive real number;

[0038] Calculate equivalent temperature and equivalent humidity ;

[0039] The equivalent temperature T and equivalent humidity H inside the prefabricated cabin are used as the temperature and humidity inside the prefabricated cabin.

[0040] In some embodiments of this application, periodic encoding of the time feature specifically involves:

[0041] Periodically encode the hourly features at each time point, and / or periodically encode the daily features at each time point, and / or periodically encode the monthly features at each time point.

[0042] In some embodiments of this application, the time-series temperature and humidity prediction model is an encoder-decoder architecture;

[0043] In the encoder-decoder architecture, the encoder includes a bidirectional LSTM module and a layer normalization module connected in sequence.

[0044] The encoder-decoder architecture includes a vector copying module, an LSTM network, a second-layer normalization module, and a time-distributed fully connected layer connected in sequence.

[0045] In some embodiments of this application, the historical dataset Z is divided into a test set, a validation set, and a training set, specifically as follows:

[0046] For a historical dataset Z, a sliding window is used to slide one time step t along the length of the time series each time. The data in the sliding window includes the input dataset and the target dataset required for training. As a sample, a sliding window includes multiple time steps.

[0047] Obtain the test set, training set, and validation set for each month, where the test set for month m is... Training set and verification set The following is how to obtain it:

[0048] For all samples, obtain the number of time steps belonging to month m. Calculate the number of reference time steps for the test samples belonging to month m. ;in, Preset the proportion of the test sample;

[0049] For all time steps belonging to month m, block sampling is performed, and the number of test sample blocks extracted is... ,in, The number of blocks is less than or equal to the preset number of blocks num, and the number of time steps contained in each block is . And the number of time steps between adjacent blocks is ;

[0050] Get the starting position of the k-th test sample block, start_loc k and the time step index B within the k-th test sample block k ;

[0051] The test sample set is obtained by taking the union of all sampled test sample blocks. The remaining data will be used as the training set. ;

[0052] Test sample set Randomly select a first preset number as the validation set The remaining part is the test set. ;

[0053] The test set, training set, and validation set for each month are combined to obtain the test set I. test Validation set I val and training set I train .

[0054] In some embodiments of this application, the prefabricated cabin temperature and humidity prediction method further includes:

[0055] Set up periodic prediction tasks and timed tasks for dynamic model optimization;

[0056] When the time interval reaches the first time interval, the periodic prediction task is executed, which specifically involves: periodically receiving the temperature and humidity inside the prefabricated cabin, the temperature and humidity outside the prefabricated cabin, the dimensional features of all HVAC equipment and the encoded time features according to the preset running time, and outputting the predicted temperature and humidity values ​​for future periods through the target temperature and humidity prediction model.

[0057] At the second time interval, a model dynamic optimization timed task is executed. Specifically, the newly acquired data within the time interval is used to optimize the currently used target temperature and humidity prediction model. If the optimized target temperature and humidity prediction model is better than the currently used target temperature and humidity prediction model, the currently used target temperature and humidity prediction model is updated; otherwise, the currently used target temperature and humidity prediction model is retained.

[0058] Compared with existing technologies, the prefabricated cabin temperature and humidity prediction method based on multi-source data fusion proposed in this application has the following advantages and beneficial effects:

[0059] (1) The multi-source data of temperature and humidity inside the cabin, temperature and humidity outside the cabin and the operating status of HVAC equipment are fused together, and the temperature and humidity inside the prefabricated cabin are predicted by using a time series temperature and humidity prediction model, so as to perceive the environment inside the prefabricated cabin in advance and thus effectively control the environment inside the cabin.

[0060] (2) The operating status of all HVAC equipment adopts a unified complex plane coding rule, and the status of the same type of HVAC equipment is encoded into a point on the complex plane. The different effects of different HVAC equipment start-stop combinations on temperature and humidity are learned. Each type of HVAC equipment is kept in a 2-dimensional feature dimension to avoid the problem of difficulty in processing when the feature dimension increases linearly due to the expansion of each operating status of each HVAC equipment into input features.

[0061] (3) By combining temperature and humidity control with the operating status of multiple HVAC equipment, the output predicted temperature and humidity values ​​can provide advanced guidance for the coordinated control of multiple HVAC equipment, and timely and accurate control of the temperature and humidity inside the cabin, which is conducive to achieving a stable environment inside the cabin.

[0062] In some embodiments of this application, this application also relates to a prefabricated cabin temperature and humidity prediction system based on multi-source data fusion, comprising:

[0063] The historical data acquisition module is used to acquire historical datasets, which include prefabricated cabin interior temperature and humidity, prefabricated cabin exterior temperature and humidity, dimensional features of different types of HVAC equipment, and encoded time features. Specifically, the time features are periodically encoded to obtain encoded time features. The status encoding of the same type of HVAC equipment is as follows:

[0064] Different phase angles are assigned to similar HVAC equipment in a fixed sequence;

[0065] The states of similar HVAC equipment are mapped to the amplitude of a complex vector. When the operating states of HVAC equipment are not limited to the on / off state, the corresponding phase angle and / or amplitude are modulated according to other different operating states of similar HVAC equipment.

[0066] After summing the complex vectors of similar HVAC equipment, the real and imaginary parts are obtained and used as the dimensional features of the similar HVAC equipment.

[0067] The dataset partitioning module is used to partition the historical dataset to obtain a test set, a validation set, and a training set.

[0068] The model building module includes a model initialization unit, a model training unit, and a model evaluation unit. The model initialization unit constructs a time-series temperature and humidity prediction model, initializes model parameters, and builds an optimizer and callback functions. The model training unit trains the initialized time-series temperature and humidity prediction model using a training set and a validation set. During training, the optimizer and callback functions are continuously used to optimize the model until it converges, becoming the target temperature and humidity prediction model. The model evaluation unit evaluates the target temperature and humidity prediction model on a test set using evaluation metrics, and outputs the target temperature and humidity prediction model after the evaluation metrics are met.

[0069] The model prediction module acquires the temperature and humidity inside the prefabricated cabin, the temperature and humidity outside the prefabricated cabin, the dimensional features of all HVAC equipment, and the encoded temporal features, and inputs them into the target temperature and humidity prediction model to predict and output the future temperature and humidity sequence inside the cabin.

[0070] In some embodiments of this application, the prefabricated cabin temperature and humidity prediction system further includes:

[0071] The periodic prediction module is used to perform a periodic prediction task every time the time interval reaches the first time interval. Specifically, it periodically receives the temperature and humidity inside the prefabricated cabin, the temperature and humidity outside the prefabricated cabin, the dimensional features of all HVAC equipment and the encoded time features according to the preset running time, and outputs the predicted temperature and humidity values ​​for future periods through the target temperature and humidity prediction model.

[0072] The model dynamic optimization module is used to execute a model dynamic optimization timed task every time the time interval reaches the second time interval. Specifically, it uses the newly acquired data within the time interval to optimize the currently used target temperature and humidity prediction model. If the optimized target temperature and humidity prediction model is better than the currently used target temperature and humidity prediction model, the currently used target temperature and humidity prediction model is updated; otherwise, the currently used target temperature and humidity prediction model is retained.

[0073] Other features and advantages of the present invention will become clearer after reading the detailed embodiments of the invention in conjunction with the accompanying drawings. Attached Figure Description

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

[0075] Figure 1 This is a flowchart of the model training and evaluation process in the prefabricated cabin temperature and humidity prediction method based on multi-source data fusion proposed in this invention.

[0076] Figure 2 This is a schematic diagram illustrating the acquisition of historical datasets in the prefabricated cabin temperature and humidity prediction method based on multi-source data fusion proposed in this invention.

[0077] Figure 3 This is a schematic diagram of a sliding window in the prefabricated cabin temperature and humidity prediction method based on multi-source data fusion proposed in this invention.

[0078] Figure 4This is an architecture diagram of the time series temperature and humidity prediction model in the prefabricated cabin temperature and humidity prediction method based on multi-source data fusion proposed in this invention.

[0079] Figure 5 The comparison curve between the measured temperature and the predicted temperature in the historical window within the first time interval is provided by the prefabricated cabin temperature and humidity prediction method based on multi-source data fusion proposed in this invention.

[0080] Figure 6 The comparison curve between measured humidity and predicted humidity in the prefabricated cabin based on multi-source data fusion proposed in this invention is shown in the first time interval historical window.

[0081] Figure 7 The curve showing the comparison between the multi-step predicted temperature and the historical measured temperature in the future window within the second time interval of the prefabricated cabin temperature and humidity prediction method based on multi-source data fusion proposed in this invention.

[0082] Figure 8 The curve showing the comparison between the multi-source data fusion-based prefabricated cabin temperature and humidity prediction method proposed in this invention and the historical measured humidity in the second time interval during the multi-step predicted humidity of the future window.

[0083] Figure 9 The curve showing the comparison between measured and predicted temperatures in the historical window within the third time interval for the prefabricated cabin temperature and humidity prediction method based on multi-source data fusion proposed in this invention.

[0084] Figure 10 The curve showing the comparison between measured humidity and predicted humidity in the historical window within the third time interval of the prefabricated cabin temperature and humidity prediction method based on multi-source data fusion proposed in this invention is as follows:

[0085] Figure 11 The curve showing the comparison between the multi-step predicted temperature and the historical measured temperature in the future window within the fourth time interval of the prefabricated cabin temperature and humidity prediction method based on multi-source data fusion proposed in this invention.

[0086] Figure 12 The curves showing the comparison between the multi-step predicted humidity of the prefabricated cabin and the historical measured temperature and humidity in the fourth time interval of the multi-source data fusion-based temperature and humidity prediction method proposed in this invention are as follows:

[0087] Figure 13 The curve showing the comparison between measured and predicted temperatures in the historical window within the fifth time interval for the prefabricated cabin temperature and humidity prediction method based on multi-source data fusion proposed in this invention.

[0088] Figure 14The curve showing the comparison between measured humidity and predicted humidity in the historical window within the fifth time interval for the prefabricated cabin temperature and humidity prediction method based on multi-source data fusion proposed in this invention.

[0089] Figure 15 The curve showing the comparison between the multi-step predicted temperature and the historical measured temperature in the future window within the sixth time interval of the prefabricated cabin temperature and humidity prediction method based on multi-source data fusion proposed in this invention.

[0090] Figure 16 The curve showing the comparison between the multi-step predicted humidity of the prefabricated cabin and the historical measured humidity in the sixth time interval of the multi-source data fusion-based temperature and humidity prediction method proposed in this invention;

[0091] Figure 17 This is a comparison table of the evaluation indicators involved in the prefabricated cabin temperature and humidity prediction method based on multi-source data fusion proposed in this invention, obtained at three different time intervals. Detailed Implementation

[0092] 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.

[0093] Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without inventive effort are within the scope of protection of this invention. In the description of this invention, it should be understood that the terms "center," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings and are only for the convenience of describing this invention and simplifying the description, and are not intended to indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this invention.

[0094] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "joining" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0095] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, unless otherwise stated, "a plurality of" means two or more.

[0096] To achieve advanced prediction of the temperature and humidity environment in prefabricated substations with multiple HVAC equipment (e.g., fans, air conditioners, dehumidifiers, electric heaters), this application proposes a prefabricated substation temperature and humidity prediction method and system based on multi-source data fusion. The prefabricated substation temperature and humidity prediction method is implemented based on the prefabricated substation temperature and humidity prediction system. Therefore, the following description of the prefabricated substation temperature and humidity prediction method will be combined with the prefabricated substation temperature and humidity prediction system.

[0097] The prefabricated cabin temperature and humidity prediction method is based on the constructed time-series temperature and humidity prediction model. First, based on historical data, a time-series temperature and humidity prediction model is constructed (see...). Figure 1 After obtaining the time series temperature and humidity prediction model, the system then uses historical input data to output the predicted temperature and humidity for the future.

[0098] See Figure 1 The process of establishing the target temperature and humidity prediction model is shown in steps S1 to S5 below.

[0099] S1: Obtain historical datasets.

[0100] The acquisition of historical datasets is achieved using the historical data acquisition module (not shown) in the prefabricated cabin temperature and humidity prediction system.

[0101] Multiple HVAC equipment, such as fans, air conditioners, dehumidifiers, and electric heaters, are installed in the prefabricated cabin. Therefore, the operating status of the HVAC equipment (e.g., on / off, operating mode, set temperature and humidity) will affect the temperature and humidity in the prefabricated cabin. Thus, in order to coordinate the control of multiple HVAC equipment to achieve temperature and humidity control in the prefabricated cabin, the operating status of the HVAC equipment needs to be taken into account when constructing the time series temperature and humidity prediction model.

[0102] In some embodiments of this application, when a fan is present, the operating state of the fan may include an on / off state; when an air conditioner is present, the operating state of the air conditioner may include an on / off state, an operating mode (cooling, heating, ventilation, dehumidification, automatic, etc.), and a set temperature; when a dehumidifier is present, the operating state of the dehumidifier may include an on / off turntable and a set humidity; when an electric heater is present, the operating state of the electric heater may include an on / off state.

[0103] The temperature and humidity outside the prefabricated cabin will affect the control of multiple heating and ventilation devices inside the prefabricated cabin, thus affecting the temperature and humidity inside the prefabricated cabin. Therefore, when constructing a time series temperature and humidity prediction model, the temperature and humidity outside the prefabricated cabin also need to be taken into account.

[0104] Therefore, historical data includes the temperature and humidity inside the prefabricated cabin, the operating status of the HVAC equipment, and the temperature and humidity outside the prefabricated cabin.

[0105] In some embodiments of this application, multiple temperature and humidity sensors can be arranged at multiple different key locations inside the prefabricated cabin, and at least one temperature and humidity sensor can be arranged outside the prefabricated cabin.

[0106] To accurately obtain the temperature and humidity inside and outside the prefabricated cabin, please refer to... Figure 2 It is necessary to detect and process any anomalies in the acquired temperature and humidity data, including abnormal data caused by sensor malfunctions (such as being offline or errors in the data acquisition process).

[0107] In some embodiments of this application, anomaly detection and handling are divided into detection and imputation. First, the existing IQR (Interquartile Range) algorithm is used to calculate upper and lower bound thresholds; data above the upper bound threshold and below the lower bound threshold are considered outliers. Second, a sliding window mean is used to imput the outliers.

[0108] In some embodiments of this application, in order to accurately monitor the temperature and humidity inside the prefabricated cabin, the equivalent temperature T and equivalent humidity H inside the prefabricated cabin are calculated using IDW (Inverse Distance Weighting). The core of this method is to assign weights based on the spatial distance between the location of each temperature and humidity sensor inside the prefabricated cabin and the target point, thereby achieving a spatial weighted average of temperature and humidity at multiple measurement points and accurately reflecting the overall environmental state inside the prefabricated cabin.

[0109] For example, i temperature and humidity sensors (i=1,2,...,n, n≥3) are evenly deployed in the prefabricated cabin. These temperature and humidity sensors are installed in multiple different key locations in the prefabricated cabin, such as the top center, the middle equipment area, the bottom power distribution area, the left equipment area, and the right equipment area, to ensure coverage of the three-dimensional space inside the cabin.

[0110] As described above, after performing outlier detection and processing on the multiple temperature and humidity readings detected by the i-th temperature and humidity sensor, the temperature T corresponding to the i-th temperature and humidity sensor after processing is obtained. i and humidity H i .

[0111] Then, using the IDW algorithm, see [link to relevant documentation]. Figure 2 Calculate the equivalent temperature T and equivalent humidity H inside the prefabricated cabin.

[0112] (1) Establish a three-dimensional rectangular coordinate system in the prefabricated cabin, and define the spatial coordinates (x, y, y) of each temperature and humidity sensor in the three-dimensional rectangular coordinate system. i ,y i ,z i ).

[0113] In some embodiments of this application, a three-dimensional rectangular coordinate system can be established with the lower left corner of the prefabricated cabin as the origin O (0,0,0), the x-axis along the length of the prefabricated cabin, the y-axis along the width of the prefabricated cabin, and the z-axis along the height of the prefabricated cabin. The spatial coordinates (x, y, z) of each temperature and humidity sensor in the three-dimensional rectangular coordinate system can then be defined. i ,y i ,z i ).

[0114] (2) Set the target point (x0, y0, z0).

[0115] In some embodiments of this application, the target point (x0, y0, z0) can be set as the geometric center of the prefabricated cabin, that is, x0=L / 2, y0=W / 2, z0=H / 2, where L is the length of the prefabricated cabin, W is the width of the prefabricated cabin, and H is the height of the prefabricated cabin.

[0116] (3) Calculate the three-dimensional Euclidean distance d between each temperature and humidity sensor and the target point. i .

[0117] The spatial distance between the location of each temperature and humidity sensor in the prefabricated cabin and the target point is calculated using the following Euclidean distance formula.

[0118]

[0119] (4) Using three-dimensional Euclidean distance Assign weights w to the temperature and humidity detected by i temperature and humidity sensors. i .

[0120]

[0121] Where p is the distance exponent of IDW, used to adjust the rate at which the weights decay with distance. p is a positive real number; the larger p is, the higher the weight of the temperature and humidity sensor closer to the target point, and the faster the weight decay of the temperature and humidity sensor farther from the target point. In engineering implementation, the value of p can be determined based on historical data verification results or on-site calibration; for example, p=2.

[0122] (5) Calculate the equivalent temperature T and equivalent humidity H.

[0123] Using the weights w of each temperature and humidity sensor calculated above i and T i Using the formula Calculate the equivalent temperature T, which is used as the temperature inside the prefabricated cabin.

[0124] Using the weights w of each temperature and humidity sensor calculated above i and H i Using the formula Calculate the equivalent temperature and humidity H, which is used as the humidity inside the prefabricated cabin.

[0125] In the task of temperature and humidity prediction in prefabricated substations, the operating status of various HVAC equipment within the substation collectively affects the temperature and humidity trends. However, engineering sites commonly present a situation of "multiple HVAC equipment of the same type + multi-dimensional operating status (on / off, operating mode, operating setpoints, etc.)". If each operating status of each HVAC device is individually expanded into input features, the feature dimension will increase linearly with the number of devices, leading to increased model training sample requirements, difficulties in cross-site transfer, and a heavier burden on online inference. On the other hand, simply aggregating the "number of on / off ratio / average" of multiple HVAC devices will lose information on "which HVAC devices are on and in what combination they are on," making it difficult for the model to learn the differentiated effects of different combinations of HVAC equipment on temperature and humidity.

[0126] Therefore, in order to clearly describe the operating status and combination of HVAC equipment, it is necessary to encode the status of all HVAC equipment.

[0127] In some embodiments of this application, a unified complex plane encoding rule for the operating states of all HVAC equipment is described: (1) different phase angles are assigned to HVAC equipment of the same type in a fixed order; (2) the state of HVAC equipment is mapped to the amplitude of a complex vector. When the operating state of HVAC equipment is not only the on / off state, the corresponding phase angle and / or amplitude are modulated according to other different operating states of the same type of HVAC equipment (for example, phase offset is introduced to modulate the phase angle, and a set value amplitude is introduced to modulate the amplitude); (3) after summing the complex vectors of the same type of HVAC equipment, the real part and the imaginary part are obtained as the dimensional features of the same type of HVAC equipment.

[0128] This method encodes the state of similar HVAC equipment into a point on a complex plane, effectively increasing the learnable information of the model and facilitating model understanding.

[0129] In some embodiments of this application, the HVAC equipment status coding shares the following core framework:

[0130]

[0131] Where N is the total number of HVAC equipment of the same type, and i is the equipment index. This represents the operating state of the i-th HVAC equipment. The state mapping function is used to map its operating state to an amplitude, where j represents an imaginary number and the phase angle is... This represents the i-th HVAC equipment.

[0132] The following describes the status codes of fans, air conditioners, dehumidifiers, and electric heaters as examples.

[0133] As mentioned above, the operating status of the wind turbine includes on / off, and its status code can be represented as follows:

[0134] (1).

[0135] Where N is the total number of wind turbines. The operating state of the i-th wind turbine is given by amplitude and phase angle. This indicates the i-th wind turbine in the powered-on state. =1, when the device is off. =0 (or when the device is powered on) =0, when the device is off. =1).

[0136] For example, at a certain sampling time, a total of 3 fans are deployed in the prefabricated cabin (numbered as fan 0, fan 1, and fan 2 according to the control point sequence), and fan 0 and fan 2 are in the on state. =1 and =1), Fan 1 is in the off state ( =0), and the complex vector can be obtained using formula (1). The real part is 0.1667 and the imaginary part is -0.2887.

[0137] That is, the dimensional characteristics of the wind turbine are 0.1667 and -0.2887.

[0138] When considering other operating states of the fan (such as gear position, operating set wind speed), its amplitude and / or phase angle can be modulated accordingly.

[0139] As mentioned above, the operating status of an air conditioner includes on / off, operating mode, and set temperature, and its status code can be represented as follows:

[0140] A i =power1 i ×f temp (T set,i (2)

[0141] in, Total number of air conditioners, phase angle Let A represent the i-th air conditioner. i The amplitude is measured by power1 when the device is powered on.i =1, power1 is in the off state i =0,T set,i The set temperature for the i-th air conditioner, and the amplitude scaling factor f used to modulate the amplitude. temp (T) = (TT) min ) / (T max -T min ), T min and T max These are the minimum and maximum values ​​of the specified operating temperature, used for the phase shift of the modulated phase angle. This represents the different operating modes of the i-th air conditioner.

[0142] In some embodiments of this application, =0° indicates cooling mode. =180° indicates the heating mode. =90° indicates the air supply mode. =270° indicates dehumidification mode. =45° indicates automatic mode.

[0143] For example, taking the same sampling time as an example, a total of 3 air conditioners are deployed in the prefabricated cabin (numbered as air conditioner 0, air conditioner 1, and air conditioner 2 according to the control point sequence), and all three air conditioners are in the on state; air conditioner 0 is in cooling mode ( =0°) and the set temperature is 18°, air conditioner 1 is in heating mode ( =180°) and the set temperature is 28℃, air conditioner 2 is in dehumidification mode ( =270°) and the set temperature is 22°C, the minimum value of the specified operating temperature range T min =16℃ and maximum value T max =30℃.

[0144] The complex vector can be obtained using formula (2). The real part is 0.0668 and the imaginary part is -0.1759.

[0145] That is, the dimensional features of the air conditioner are 0.0668 and -0.1759.

[0146] As mentioned above, the operating status of a dehumidifier includes on / off and humidity setting, and its status codes can be represented as follows:

[0147] B i =power2 i ×(1-f humidity (H set,i )) (3)

[0148] in, Total number of dehumidifiers, phase angle Let B represent the i-th dehumidifier. i The amplitude is measured in power2 when the device is powered on. i =1, power2 is in the off state. i =0, H set,i The set humidity for the i-th dehumidifier, and the amplitude scaling factor 1-f used to modulate the amplitude. humidity (H) = 1 - (HH) min ) / (H max -H min ), H min and H max These are the minimum and maximum values ​​of the specified humidity range, respectively.

[0149] For example, taking the same sampling time as an example, a total of 2 dehumidifiers are deployed in the prefabricated cabin (numbered as dehumidifier 0 and dehumidifier 1 according to the control point sequence), and both are in the on state; the set humidity of dehumidifier 0 is 40%, and the set humidity of dehumidifier 1 is 70%, with the minimum value H of the specified operating humidity range. min =30% and the maximum value H max =80%.

[0150] The complex vector can be obtained using formula (3). The real part is 0.3000 and the imaginary part is 0.0000.

[0151] That is, the dimensional features of the dehumidifier are 0.3000 and 0.0000.

[0152] As mentioned above, the operating states of an electric heater include on / off, and its state codes can be represented as follows:

[0153] (4)

[0154] in, P represents the total number of electric heaters. i The operating state of the i-th electric heater is given by amplitude and phase angle. P represents the i-th electric heater in the powered-on state. i =1, P is in the power-off state i =0.

[0155] For example, at the same sampling time, a total of 2 electric heaters are deployed in the prefabricated cabin (numbered as electric heater 0 and electric heater 1 according to the control point sequence), of which electric heater 0 is turned on (P0=1) and electric heater 1 is turned off (P1=1).

[0156] The complex vector can be obtained using formula (4). The real part is 0.5000 and the imaginary part is 0.0000.

[0157] That is, the dimensional features of the electric heater are 0.5000 and 0.5000.

[0158] Similarly, when considering other operating states of the electric heater (such as the specified operating temperature), its amplitude and / or phase angle can be modulated accordingly.

[0159] In this way, the status coding of all HVAC equipment is completed.

[0160] By adopting the above coding rules, each type of HVAC equipment can be kept stable in the feature dimension (2D) while retaining the distribution pattern information of equipment start-stop combinations as much as possible. This makes it easier to input the operating status of HVAC equipment and the temperature and humidity inside and outside the prefabricated cabin as input data into the constructed time series temperature and humidity prediction model, so as to realize the advanced perception of future temperature and humidity and more usable collaborative control guidance of HVAC equipment.

[0161] In some embodiments of this application, since time series are involved, it is necessary to periodically encode the time features.

[0162] In some embodiments of this application, a time feature can be selected, which can be an hourly feature, a daily feature, and / or a monthly feature.

[0163] By periodically encoding the time features, the temperature and humidity changes learned by the temperature and humidity prediction model have periodic characteristics.

[0164] In some embodiments of this application, the hours, days, and months at each point in time are mapped to periodic sin and cos functions.

[0165] The mathematical expressions corresponding to the periodic encoding of hour features are: hour-sin=sin(2π×hour / 24), hour-cos=cos(2π×hour / 24).

[0166] The mathematical expressions corresponding to the periodic encoding of the day feature are: day-sin=sin(2π×day / 7), day-cos=cos(2π×day / 7).

[0167] The mathematical expressions corresponding to the periodic encoding of the monthly feature are: month-sin=sin(2π×month / 12), month-cos=cos(2π×month / 12).

[0168] In this way, the periodic codes at each time point are obtained.

[0169] See here. Figure 2 The historical dataset Z is formed by combining the temperature and humidity inside the prefabricated cabin, the temperature and humidity outside the prefabricated cabin, the dimensional features of different types of HVAC equipment, and the encoded time features.

[0170] The historical dataset Z forms a data matrix [In, F], where In is the time series length of the historical dataset Z and F is the feature dimension of the historical dataset Z.

[0171] S2: Divide the historical dataset Z into two parts to obtain the test set I. test Validation set I val and training set I train .

[0172] Test set I was obtained using the dataset partitioning module (not shown) in the prefabricated cabin temperature and humidity prediction system. test Validation set I val and training set I train .

[0173] After obtaining the historical dataset Z, it needs to be divided into a test set, a validation set, and a training set. The validation set and training set are used for model training, while the test set is used to evaluate the model using metrics such as root mean square error (RMSE), mean absolute error (MAE), and coefficient of determination (R²). 2 The training effect of the trained model is evaluated using the mean absolute percentage error (MAPE) and accuracy.

[0174] The historical dataset Z includes the input dataset and the target dataset required to train the model. Therefore, when dividing the historical dataset Z into training samples (including the training set) and test samples (including the validation set and the test set), both the training samples and the test samples also include the input dataset and the target dataset.

[0175] In some embodiments of this application, in order to enhance the accuracy of model training, a method of "uniform monthly coverage + sliding window block sampling" is adopted to obtain training samples and test samples, so that the training samples and test samples are more evenly distributed in the monthly dimension, thereby more objectively evaluating the predictive performance of the model under different seasons and different working conditions.

[0176] S21: For the historical dataset Z, use a sliding window to slide one time step t along the length of the time series each time. The data in the sliding window includes the input dataset X required for training. t and target dataset Y t As a sample, a sliding window includes multiple time steps.

[0177] Suppose a sliding window has a time series length of N, and the input dataset X is located within this sliding window.t The input sequence length is L, and the target dataset is Y. t The target sequence length is H. The mathematical expression for the sliding window dataset partitioning is as follows:

[0178]

[0179]

[0180] Where T is the target dataset Y t The feature dimensions.

[0181] For example, dividing the time step into 5-minute intervals, the input dataset X t You can select historical data for the past 24 hours, target dataset Y t The data includes the pre-fabricated cabin temperature and humidity data for the 6 hours following the 24 hours in the past. Thus, L=288, H=72, and the sliding window includes 360 time steps.

[0182] See Figure 3 This indicates that it includes a set of X t and Y t A sliding window that slides for time steps t each time along the sliding direction.

[0183] For a given historical dataset Z, there are multiple samples corresponding to multiple sliding windows, representing the time series length.

[0184] As shown below, multiple samples will need to be divided into a training set and a test set, where the test set includes a validation set and a test set.

[0185] S22: Obtain the test set, training set, and validation set for each month.

[0186] In some embodiments of this application, for clarity, the acquisition of monthly test sets, training sets, and validation sets is described first. Then, the test samples of all months are merged to obtain the test set, training set, and validation set required by the model.

[0187] The following is used to obtain the test set for month m. Training set and verification set Let's take an example to illustrate.

[0188] S221: For all samples, obtain the number of time steps belonging to month m. Calculate the number of reference time steps for the test samples belonging to month m. .

[0189] To ensure even coverage of each test sample monthly, a reference number of test samples for each month needs to be calculated.

[0190] For month m, the set of time steps contained in that month is: in, This is a timestamp. Therefore, the number of time steps contained in this month is... .

[0191] The percentage of time steps extracted each month out of the total time steps, for example, =20%.

[0192] Therefore, the number of reference time steps belonging to the test sample in month m can be calculated. .

[0193] S222: Perform block sampling on all time steps belonging to month m, and the number of test sample blocks extracted. The number of time steps contained in each block is And the number of time steps between adjacent blocks is .

[0194] Among them, the preset number of blocks num is greater than or equal to For example, num=3.

[0195] Sampling is performed in blocks for each month, with a maximum of num blocks extracted per month. The size of each block is at least the size of a sliding window, and the minimum interval between adjacent blocks is the size of a sliding window. This ensures that the sampling is uniform across months.

[0196] As mentioned above, mathematical symbols This means rounding down and returning the largest integer value that is not greater than the given value X.

[0197] S223: Get the starting position of the k-th test sample block, start_loc k and the time step index B within the k-th test sample block k .

[0198] starting position start_loc k The following information was obtained:

[0199] .

[0200] Time step index B within the k-th test sample block k The following information was obtained:

[0201] .

[0202] S224: Obtain the test sample set by taking the union of all sampled test sample blocks. The remaining data will be used as the training set. .

[0203] Test sample set Including validation set and test set .

[0204] S225: Test sample set Randomly select a first preset number as the validation set The remaining part is the test set. .

[0205] As mentioned above, in In the case of 20%, a test set can be selected. and verification set Each of them accounts for 10% of the total sample size.

[0206] As shown in S521 to S525 above, the test set for month m is completed. Training set and verification set .

[0207] S23: The corresponding months , and Taking the union of each set, we get I. test Validation set I val and training set I train .

[0208] Validation set I val and training set I train Used for training the model, test set I test Used to evaluate the model.

[0209] The processes S3 to S5 below are implemented based on the model building module (not shown) in the prefabricated cabin temperature and humidity prediction system. See also... Figure 1 The description is as follows.

[0210] S3: Build a time series temperature and humidity prediction model and initialize the model parameters, and build the optimizer and callback function.

[0211] In some embodiments of this application, the time series temperature and humidity prediction model can be selected from various conventional techniques. It can be an encoder-decoder structure, in which both the encoder and the decoder use a single-layer LSTM network. Alternatively, an attention mechanism can be introduced into a bidirectional LSTM network, and the output can be predicted after processing by a fully connected layer.

[0212] In some embodiments of this application, see Figure 4 The time series temperature and humidity prediction model was chosen to be an encoder-decoder architecture.

[0213] The encoder consists of a bidirectional LSTM module and a layer normalization module connected in sequence. The bidirectional LSTM model outputs a context vector, and the layer normalization module is used to normalize the context vector, enabling the encoder to learn the complex nonlinear features of the input sequence, learn the bidirectional feature associations between different time steps, and learn the complex relationship between temperature and humidity values ​​and HVAC equipment status within the same time step. Finally, the output is a context vector containing the global dependencies and local correlations of the input sequence.

[0214] The decoder consists of a vector copying module, an LSTM network, a layer normalization module, and a time-distributed fully connected layer connected in sequence. The vector copying module is used to copy and expand the normalized context vector according to the length of the prediction time step to form the sequence input of the decoder. The LSTM network is used to decode the state of the future time step step by step and output the decoded hidden state sequence corresponding to each prediction time step. The time-distributed fully connected layer is used to map the decoded hidden state sequence step by step according to the time step and output the temperature and humidity prediction value sequence for the future period.

[0215] Building an optimizer and callback functions are necessary for subsequent model training. The optimizer is responsible for updating model parameters to minimize the loss function, while the callback function is used to dynamically adjust the learning rate and stop training early during training to prevent overfitting.

[0216] S4: Train the initialized time series temperature and humidity prediction model using the training and validation sets.

[0217] This process will use the training set I extracted in blocks as described above. train and verification set I val The model is trained and continuously optimized using optimizers and callback functions until the time series temperature and humidity prediction model converges. This convergence serves as the target temperature and humidity prediction model, enabling the model to more accurately predict temperature and humidity under different seasons and working conditions.

[0218] S5: Evaluate the target temperature and humidity prediction model on the test set using evaluation metrics, and output the target temperature and humidity prediction model after the evaluation metrics are met.

[0219] The evaluation indicators can be selected from the common indicators used in the evaluation model as described above: RMSE, MAE, R 2 MAPE, Accuracy, etc.

[0220] At this point, the target temperature and humidity prediction model is obtained and can be stored in the prefabricated cabin system, such as in a smart gateway or server. It can be called up or updated and optimized in a timely manner when needed, so that the model has adaptability and can accurately reflect the real environment inside the prefabricated cabin.

[0221] S6: Obtain the temperature and humidity inside the prefabricated cabin, the temperature and humidity outside the prefabricated cabin, the dimensional features of all HVAC equipment, and the encoded temporal features, and input them into the target temperature and humidity prediction model to predict and output the future temperature and humidity sequence inside the cabin.

[0222] S6 is achieved through the model prediction module (not shown) in the prefabricated cabin temperature and humidity prediction system.

[0223] The input data obtained in S6 is still obtained using the data processing method described above, which will not be repeated here.

[0224] The temperature and humidity inside the prefabricated cabin, the temperature and humidity outside the prefabricated cabin, the operating status codes of all HVAC equipment, and the periodic codes of time features are concatenated to form the input data feature matrix [In,F], where In is the length of the time series and F is the feature dimension.

[0225] After the target temperature and humidity prediction model is used for prediction, the future cabin temperature and humidity sequence [Out,2] is output, where Out is the length of the future time series and 2 refers to temperature and humidity.

[0226] In some embodiments of this application, the prediction method further includes a periodic prediction task and a model dynamic optimization timed task. The periodic prediction module is used to execute the periodic prediction task, and the model dynamic optimization module is used to execute the model dynamic optimization timed task.

[0227] In the periodic prediction task, the historical input data feature matrix within a set running time (e.g., 24 hours) is periodically acquired, and the future (e.g., 6 hours) temperature and humidity sequence is predicted and output through the existing target temperature and humidity prediction model.

[0228] To improve the model's adaptability, during the model dynamic optimization timed task, the system also gathers new data within a preset optimization time interval (e.g., initially 15 days), fine-tunes and optimizes the model based on the existing model weights, and conducts model evaluation. When the optimized model performs better than the existing model, the existing model parameters are replaced; otherwise, the existing model is used. This ensures that the model maintains its adaptability to actual working conditions and meets the prediction accuracy requirements in the long term.

[0229] Figures 5 to 16 The visualization comparison curves of three independent test intervals are shown to intuitively demonstrate the accuracy and stability of the temperature and humidity prediction method involved in this application on real data.

[0230] Figures 5 to 16 The curves in the graphs all use temperature or humidity as the vertical axis and time step as the horizontal axis to show the measured sequence and the predicted sequence.

[0231] It should be noted that, Figures 5 to 16The solid blue lines represent measured temperature or humidity, while the dashed orange lines represent predicted temperature or humidity.

[0232] Figure 5 The medium curve is a comparison curve between the measured temperature and the predicted temperature within the historical window in the first time interval; Figure 6 The curve in the middle is a comparison curve between the measured humidity and the predicted humidity in the historical window within the first time interval.

[0233] Figure 7 The middle curve is a comparison curve between the measured temperature in the historical window and the multi-step predicted temperature in the future window within the second time interval; Figure 8 The curve in the middle is a comparison curve between the measured humidity in the historical window and the multi-step predicted humidity in the future window within the second time interval.

[0234] Figure 9 The middle curve is a comparison curve between the measured temperature and the predicted temperature within the historical window in the third time interval; Figure 10 The curve in the middle is a comparison curve between the measured humidity and the predicted humidity in the historical window within the third time interval.

[0235] Figure 11 The middle curve is a comparison curve between the measured temperature in the historical window and the multi-step predicted temperature in the future window within the fourth time interval; Figure 12 The curve in the middle is a comparison curve between the measured humidity in the historical window and the multi-step predicted humidity in the future window within the fourth time interval.

[0236] Figure 13 The middle curve is a comparison curve between the measured temperature and the predicted temperature within the historical window in the fifth time interval; Figure 14 The curve in the middle is a comparison curve between the measured humidity and the predicted humidity in the historical window within the fifth time interval.

[0237] Figure 15 The middle curve is a comparison curve between the measured temperature in the historical window and the multi-step predicted temperature in the future window within the sixth time interval; Figure 16 The curve in the middle is a comparison curve between the measured humidity in the historical window and the multi-step predicted humidity in the future window within the sixth time interval.

[0238] pass Figure 5 , Figure 6 , Figure 9 , Figure 10 , Figure 13 and Figure 14The model was verified to follow the overall trend and cyclical fluctuations of different historical data: the predicted curve changed in the same phase and direction as the measured curve over a long period of time, and maintained a good degree of overlap with the main fluctuation cycle, peak and trough positions and change direction. This indicates that the model has learned the key factors affecting temperature and humidity changes and their coupling relationship, and the model has a stable fitting ability for data in different time periods.

[0239] pass Figure 7 , Figure 8 , Figure 11 , Figure 12 , Figure 15 and Figure 16 The stability of the model in a multi-step prediction scenario in the future window is verified after a given historical input window: when the predicted curve can maintain the same direction of change as the measured curve in the future window (i.e., the model meets the accuracy requirements of "advanced perception" for engineering applications) and maintains a small deviation near the key peaks and valleys, it shows that the model has a certain robustness to the uncertainty caused by the advancement of time steps.

[0240] And through Figure 15 and Figure 16 The multi-step prediction effect is displayed from the perspective of the future window to observe whether the error accumulates significantly as the prediction step size increases. If the predicted curve can still maintain the same trend and phase as the measured curve and the amplitude difference is small within this independent sixth time interval, it can be said that the model has stable accuracy across intervals and meets the requirements of engineering applications.

[0241] Figure 17 The figures show the RMSE, MAE, and R calculated for the first, third, and fifth time intervals respectively. 2 A numerical comparison table of MAPE and Accuracy is provided to quantify the above visual comparison results in the form of data indicators.

[0242] The smaller the RMSE and MAE, the lower the prediction error; R 2 The closer to 1, the stronger the model's ability to explain measured fluctuations; the smaller the MAPE, the lower the relative error; Accuracy is used to represent the prediction hit rate under a set error tolerance threshold ε (used for accuracy expression readable by the engineering side, ε can be configured as a temperature threshold or a humidity threshold according to the acceptable error of the operation and maintenance side).

[0243] pass Figure 17 As can be seen, the RMSE range for the three time intervals is approximately 2.37–2.53, and the MAE range is approximately 1.72–1.81. 2The range is approximately 0.72 to 0.75, the MAPE range is approximately 11.13% to 13.54%, and the accuracy range is approximately 86.46% to 88.87%, indicating that the temperature and humidity prediction method involved in this application achieves relatively consistent prediction accuracy performance in different test time intervals, which can meet the engineering application requirements of temperature and humidity advance sensing and HVAC equipment collaborative control.

[0244] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for predicting temperature and humidity in prefabricated cabins based on multi-source data fusion, characterized in that, include: S1: Obtain historical datasets; The historical dataset includes prefabricated cabin interior temperature and humidity, prefabricated cabin exterior temperature and humidity, dimensional features of different types of HVAC equipment, and encoded time features. The time features are periodically encoded to obtain encoded time features. Specifically, the status encoding of the same type of HVAC equipment is as follows: Different phase angles are assigned to similar HVAC equipment in a fixed sequence; The states of similar HVAC equipment are mapped to the amplitude of a complex vector. When there are other operating states of HVAC equipment besides the on / off state, the corresponding phase angle and / or amplitude are modulated according to the other different operating states of similar HVAC equipment. After summing the complex vectors of similar HVAC equipment, the real and imaginary parts are obtained and used as the dimensional features of the similar HVAC equipment. S2: Divide the historical dataset into test set, validation set and training set; S3: Construct a time-series temperature and humidity prediction model and initialize the model parameters, and construct the optimizer and callback function; S4: Use the training set and validation set to train the initialized time series temperature and humidity prediction model. During the training process, continuously use the optimizer and callback function to optimize the model until the time series temperature and humidity prediction model converges, which is then used as the target temperature and humidity prediction model. S5: Evaluate the target temperature and humidity prediction model on the test set using evaluation metrics, and output the target temperature and humidity prediction model after the evaluation metrics are met. S6: Obtain the temperature and humidity inside the prefabricated cabin, the temperature and humidity outside the prefabricated cabin, the dimensional features of all HVAC equipment, and the encoded time features, and input them into the target temperature and humidity prediction model to predict and output the future temperature and humidity sequence inside the cabin.

2. The method for predicting temperature and humidity in prefabricated cabins based on multi-source data fusion according to claim 1, characterized in that, The heating, ventilation and air conditioning equipment includes fans, and / or air conditioners, and / or dehumidifiers, and / or electric heaters; When the HVAC equipment is a fan, the fan status code is... ; Where N is the total number of wind turbines. The phase angle represents the operating state of the i-th wind turbine. This indicates that when the i-th wind turbine is started... It is either 0 or 1, when the device is turned off. It is the other one between 0 and 1; When the HVAC equipment is an air conditioner, the air conditioner status code is... , amplitude A i =power1 i ×f temp (T set,i ); in, Total number of air conditioners, phase angle This indicates that when the i-th air conditioner is turned on, power1... i It is either 0 or 1, and power1 is used when the device is off. i For the other of 0 and 1, T set,i The set temperature for the i-th air conditioner, and the amplitude scaling factor f used to modulate the amplitude. temp (T) = (TT) min ) / (T max -T min ), T min and T max These are the minimum and maximum values ​​of the specified operating temperature, used for the phase shift of the modulated phase angle. This represents the different operating modes of the i-th air conditioner; When the HVAC equipment is a dehumidifier, the dehumidifier status code is... Amplitude B i =power2 i ×(1-f humidity (H set,i )); in, Total number of dehumidifiers, phase angle This indicates that when the i-th dehumidifier is turned on, power2... i It is either 0 or 1, when power is off, power2 i H is the other one between 0 and 1. set,i The set humidity for the i-th dehumidifier, and the amplitude scaling factor 1-f used to modulate the amplitude. humidity (H) = 1 - (HH) min ) / (H max -H min ), H min and H max These are the minimum and maximum humidity values ​​specified for the work operation, respectively. When the heating and ventilation equipment is an electric heater, the electric heater status code is: ; in, P represents the total number of electric heaters. i The phase angle represents the operating state of the i-th electric heater. P represents the i-th electric heater, when it is turned on. i P is either 0 or 1 when the device is powered off. i It is the other one between 0 and 1; Where j represents an imaginary number.

3. The method for predicting temperature and humidity in prefabricated cabins according to claim 1, characterized in that, The method for predicting the temperature and humidity of the prefabricated cabin also includes: The process of pre-treating the temperature and humidity inside and outside the prefabricated cabin before using them.

4. The method for predicting temperature and humidity in prefabricated cabins according to claim 3, characterized in that, The pretreatment process for temperature and humidity inside the prefabricated cabin is as follows: Multiple temperature and humidity data were collected from multiple temperature and humidity sensors located at different key positions within the prefabricated cabin. Multiple temperature and humidity outliers were detected and processed to obtain the corresponding T values. i and H i , i represents the sensor number, i=1,2,...,n, n≥3, T i and H i These are the temperature and humidity corresponding to the i-th temperature and humidity sensor, respectively; The equivalent temperature T and equivalent humidity H inside the prefabricated cabin are calculated as follows: A three-dimensional rectangular coordinate system is established within the prefabricated cabin, defining the spatial coordinates (x, y) of each temperature and humidity sensor within this system. i ,y i ,z i ); Set the target point (x0, y0, z0); Calculate the three-dimensional Euclidean distance d between each temperature and humidity sensor and the target point. i ; Obtain the weights of each temperature and humidity sensor. Where p is a preset positive real number; Calculate equivalent temperature and equivalent humidity ; The equivalent temperature T and equivalent humidity H inside the prefabricated cabin are used as the temperature and humidity inside the prefabricated cabin.

5. The method for predicting temperature and humidity in prefabricated cabins according to claim 1, characterized in that, The periodic encoding of the time features specifically involves: periodically encoding the hourly features at each time point, and / or periodically encoding the dayly features at each time point, and / or periodically encoding the monthly features at each time point.

6. The method for predicting temperature and humidity in prefabricated cabins according to claim 1, characterized in that, The time-series temperature and humidity prediction model is an encoder-decoder architecture; In the encoder-decoder architecture, the encoder includes a bidirectional LSTM module and a layer normalization module connected in sequence. The encoder-decoder architecture includes a vector copying module, an LSTM network, a layer normalization module, and a time-distributed fully connected layer connected in sequence.

7. The method for predicting temperature and humidity in prefabricated cabins according to claim 1, characterized in that, Divide the historical dataset Z into two parts to obtain the test set I. test Validation set I val and training set I train Specifically: For a historical dataset Z, a sliding window is used to slide one time step t along the length of the time series each time. The data in the sliding window includes the input dataset and the target dataset required for training. As a sample, a sliding window includes multiple time steps. Obtain the test set, training set, and validation set for each month, where the test set for month m is... Training set and verification set The following is how to obtain it: For all samples, obtain the number of time steps belonging to month m. Calculate the number of reference time steps for the test samples belonging to month m. , Preset the proportion of the test sample; For all time steps belonging to month m, block sampling is performed, and the number of test sample blocks extracted is... ,in, The number of blocks is less than or equal to the preset number of blocks (num), and the number of time steps in each block is [number missing]. And the number of time steps between adjacent blocks is ; Get the starting position of the k-th test sample block, start_loc k and the time step index B within the k-th test sample block k ; The test sample set is obtained by taking the union of all sampled test sample blocks. The remaining data will be used as the training set. ; Test sample set Randomly select a first preset number as the validation set The remaining part is the test set. ; The test set, training set, and validation set for each month are combined to obtain the test set I. test Validation set I val and training set I train .

8. The method for predicting temperature and humidity in prefabricated cabins according to claim 1, characterized in that, The method for predicting the temperature and humidity of the prefabricated cabin also includes: Set up periodic prediction tasks and model dynamic optimization timed tasks; When the time interval reaches the first time interval, the periodic prediction task is executed, which specifically involves: periodically receiving the temperature and humidity inside the prefabricated cabin, the temperature and humidity outside the prefabricated cabin, the dimensional features of all HVAC equipment and the encoded time features according to the preset running time, and outputting the predicted temperature and humidity values ​​for future periods through the target temperature and humidity prediction model. At the second time interval, a model dynamic optimization timed task is executed. Specifically, the newly acquired data within the time interval is used to optimize the currently used target temperature and humidity prediction model. If the optimized target temperature and humidity prediction model is better than the currently used target temperature and humidity prediction model, the currently used target temperature and humidity prediction model is updated; otherwise, the currently used target temperature and humidity prediction model is retained.

9. A prefabricated cabin temperature and humidity prediction system based on multi-source data fusion, characterized in that, include: The historical data acquisition module is used to acquire historical datasets, which include prefabricated cabin interior temperature and humidity, prefabricated cabin exterior temperature and humidity, dimensional features of different types of HVAC equipment, and encoded time features. Specifically, the time features are periodically encoded to obtain encoded time features. The status encoding of the same type of HVAC equipment is as follows: Different phase angles are assigned to similar HVAC equipment in a fixed sequence; The states of similar HVAC equipment are mapped to the amplitude of a complex vector. When there are other operating states of HVAC equipment besides the on / off state, the corresponding phase angle and / or amplitude are modulated according to the other different operating states of similar HVAC equipment. After summing the complex vectors of similar HVAC equipment, the real and imaginary parts are obtained and used as the dimensional features of the similar HVAC equipment. The dataset partitioning module is used to partition the historical dataset to obtain a test set, a validation set, and a training set. The model building module includes: The model initialization unit is used to build a time series temperature and humidity prediction model, initialize model parameters, and build the optimizer and callback functions. The model training unit uses the training set and validation set to train the initialized time series temperature and humidity prediction model. During the training process, the optimizer and callback function are continuously used to optimize the model until the time series temperature and humidity prediction model converges, which is then used as the target temperature and humidity prediction model. The model evaluation unit is used to evaluate the target temperature and humidity prediction model on the test set using evaluation indicators, and outputs the target temperature and humidity prediction model after the evaluation indicators are met. The model prediction module acquires the temperature and humidity inside the prefabricated cabin, the temperature and humidity outside the prefabricated cabin, the dimensional features of all HVAC equipment, and the encoded temporal features, and inputs them into the target temperature and humidity prediction model to predict and output the future temperature and humidity sequence inside the cabin.

10. The prefabricated cabin temperature and humidity prediction system according to claim 9, characterized in that, The prefabricated cabin temperature and humidity prediction system also includes: The periodic prediction module is used to perform a periodic prediction task every time the time interval reaches the first time interval. Specifically, it periodically receives the temperature and humidity inside the prefabricated cabin, the temperature and humidity outside the prefabricated cabin, the dimensional features of all HVAC equipment and the encoded time features according to the preset running time, and outputs the predicted temperature and humidity values ​​for future periods through the target temperature and humidity prediction model. The model dynamic optimization module is used to execute a model dynamic optimization timed task every time the time interval reaches the second time interval. Specifically, it uses the newly acquired data within the time interval to optimize the currently used target temperature and humidity prediction model. If the optimized target temperature and humidity prediction model is better than the currently used target temperature and humidity prediction model, the currently used target temperature and humidity prediction model is updated; otherwise, the currently used target temperature and humidity prediction model is retained.