CN116184891A - Internet of things environment prediction and monitoring method and system - Google Patents

Internet of things environment prediction and monitoring method and system Download PDF

Info

Publication number
CN116184891A
CN116184891A CN202310061924.1A CN202310061924A CN116184891A CN 116184891 A CN116184891 A CN 116184891A CN 202310061924 A CN202310061924 A CN 202310061924A CN 116184891 A CN116184891 A CN 116184891A
Authority
CN
China
Prior art keywords
module
environment
data
cloud server
mcu control
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310061924.1A
Other languages
Chinese (zh)
Inventor
张信义
戴爱虎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hubei University
Original Assignee
Hubei University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hubei University filed Critical Hubei University
Priority to CN202310061924.1A priority Critical patent/CN116184891A/en
Publication of CN116184891A publication Critical patent/CN116184891A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0428Safety, monitoring
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/24Pc safety
    • G05B2219/24024Safety, surveillance

Abstract

The invention belongs to the technical field of environment monitoring of the Internet of things, and particularly discloses a method and a system for predicting and monitoring the environment of the Internet of things, wherein the output end of an environment information acquisition module of the system is connected with the input end of an MCU control module, the output end of the MCU control module is connected with the input end of a water supply unit, the MCU control module is in communication connection with a cloud server through a communication module, and a power supply module supplies power to the environment information acquisition module, the MCU control module and an execution module; inputting the environmental data in the cloud server into a transducer prediction model, and outputting a prediction result of the environmental data of the next time period; the method comprises the following steps: and collecting environment data, sending the environment data to a cloud server, and predicting the environment data by using a transducer prediction model to control a water supply unit. The invention realizes high-precision monitoring and high-precision prediction of environmental data, and simultaneously saves water resources. The invention is suitable for monitoring and predicting the agricultural production environment.

Description

Internet of things environment prediction and monitoring method and system
Technical Field
The invention belongs to the technical field of environment monitoring of the Internet of things, and particularly relates to an environment prediction and monitoring method and system of the Internet of things.
Background
For the plantation and the greenhouse, the growth of crops is closely related to the moisture, the temperature, the air humidity, the concentration of carbon dioxide and the illumination intensity, so that the growth of the crops is seriously influenced by the quality of the plantation and the greenhouse in controlling the temperature, the humidity and the carbon dioxide content.
Most of the proposed prediction methods for the environment of the plantation and the greenhouse are based on weather station data or machine learning, but the prediction methods based on the weather station data depend on weather station monitoring, and cannot be adjusted according to the field conditions; the prediction method based on machine learning usually brings higher calculation cost, so the prediction method is often not suitable for embedded terminals with limited calculation and communication capabilities, and the prediction algorithm usually adopted by machine learning is mainly RNN and lstm algorithm, so the problems of gradient explosion and gradient disappearance and incapability of well parallelizing data processing exist, and the training effect on longer data is not ideal. Therefore, the prediction accuracy of the existing plantation and the greenhouse environment is low. In addition, the existing plantation and greenhouse lack of an effective intelligent irrigation control strategy, and generally adopts a traditional flood irrigation and other extensive irrigation modes, so that serious waste of water resources can be caused, and the agricultural product growth is not facilitated.
Disclosure of Invention
The invention aims to provide an environment prediction and monitoring method and system for the Internet of things, so as to improve the accuracy and precision of the environment prediction and monitoring of agricultural production and reduce the resource waste.
The technical method adopted by the invention for achieving the purpose is as follows:
the environment prediction and monitoring system of the Internet of things comprises an environment data acquisition control terminal and a cloud server, wherein the environment data acquisition control terminal comprises an environment information acquisition module, an MCU control module, an execution module, a communication module and a power supply module, wherein an intelligent control strategy of the execution module is stored in the MCU control module, the execution module comprises a water supply unit, the output end of the environment information acquisition module is connected with the input end of the MCU control module, the output end of the MCU control module is connected with the input end of the water supply unit, the MCU control module is in communication connection with the cloud server through the communication module, and the power supply module supplies power to the environment information acquisition module, the MCU control module and the execution module; the cloud server internally stores a transducer prediction model, the transducer prediction model comprises an encoder module, an attention module and an output full-connection module, environment data in the cloud server is input to the encoder module, an output result of the encoder module is input to the attention module, correlation information among environment data in continuous time periods is extracted through the attention module, an output result of the attention module is input to the output full-connection module, and a prediction result of environment data in the next time period is output through the output full-connection module.
As a limitation: the environment information acquisition module comprises a temperature and humidity sensor, an illuminance sensor and CO 2 Sensor, temperature and humidity sensor output end, illuminance sensor output end and CO 2 The output end of the sensor is connected with the input end of the MCU control module.
As a limitation: the execution module further comprises a ventilation unit, and the input end of the ventilation unit is connected with the output end of the MCU control module; the water supply unit adopts a direct current motor water pump, and the ventilation unit adopts a direct current motor fan.
As a limitation: the environment data acquisition control terminal also comprises a display module, and the input end of the display module is connected with the output end of the MCU control module.
As a limitation: the system for predicting and monitoring the environment of the Internet of things further comprises a mobile phone app end and a remote monitoring host, wherein the mobile phone app end and the remote monitoring host are both in communication connection with the cloud server.
As a limitation: the MCU control module is an STM32F103C8T6 microcontroller, and the communication module is an IoT module.
The invention also provides a prediction and monitoring method of the environment prediction and monitoring system of the Internet of things, which comprises the following steps:
s1, an environmental information acquisition module in an environmental data acquisition control terminal acquires environmental data in a plantation or a greenhouse and sends the environmental data to an MCU control module;
s2, the MCU control module sends the received environment data to the cloud server at regular time through the communication module;
s3, the cloud server stores the received environmental data, inputs the environmental data into an encoder module of a trained transducer prediction model, inputs the output result of the encoder module into an attention module, extracts correlation information among environmental data in continuous time periods through the attention module, inputs the output result of the attention module into an output full-connection module, outputs the prediction result of the environmental data in the next time period through the output full-connection module, and periodically returns the predicted environmental data in the next time period to the MCU control module;
and S4, controlling the irrigation operation of the water supply unit by the MCU control module according to the received environmental data of the next time period predicted by the cloud server and the environmental data of the corresponding time period acquired by the environmental information acquisition module and the intelligent control strategy. As a limitation: the training process of the transducer prediction model is as follows: the cloud server acquires the environmental data uploaded by the environmental data acquisition control terminal, packages the environmental data into a data set according to a time period, and divides the data set into a training set and a testing set; inputting the data of the training set to an encoder module, wherein the encoder module carries out linear transformation and position coding on the data of the training set, and a combined output calculation formula of the linear transformation and the position coding is as follows:
X IE =(X IN ·W 0 +b 0 )+P
in the above, X IN ∈i T×d The data of the training set is input and is a T row and d column matrix; x is X IE Is the combined output of linear transformation and position coding, X IE ∈i T×k A matrix of T rows and k columns; w (W) 0 ∈i d×k Is a first linear transformation matrix which runs through all time intervals and is a matrix of d rows and k columns; b 0 ∈i k Representing a first bias; p epsilon i T×k Is a position coding matrix which is a T row and k column matrix; p and W 0 Randomly initializing an initial value; the data of the combined output of the linear transformation and the position coding are input to an attention module after full connection and normalization, and the normalized output X after full connection FF The method comprises the following steps:
X FF =Norm(X IE +ReLU(X IE ·W 1 +b 1 )·W 1 +b 2 )
in the formula, W 1 ∈i d×k Is a second linear transformation matrix extending through all time intervalsA matrix of d rows and k columns; b 1 ∈i k Representing a second bias; b 2 ∈i k Representing a third bias;
X FF generating three input matrices K, V, Q for the attention module, where K ε i T×k ,V∈i T×k ,Q∈i T×k T rows and k columns are all matrix; then, a softmax activation function is applied to the three input matrixes K, V and Q to obtain the connection matrixes C, C epsilon i of the attention module T×k For the matrix of T rows and k columns, the calculation formula of the connection matrix C of the attention module is as follows:
Figure BDA0004061348670000031
h in the formula is the number of taking multiple attention points, and 8 attention points are taken in the embodiment; then, after normalization processing is carried out on the connection matrix C of the attention module, the predicted value of the full-connection layer is output through a ReLU activation function
Figure BDA0004061348670000032
Namely, the predicted environmental data of the next time period is the environmental data of the next time period according to +.>
Figure BDA0004061348670000041
And the actual environmental data y of the corresponding time period, calculating a loss function value MSE; the loss function value calculation formula is:
Figure BDA0004061348670000042
wherein N is the number of samples, y is the true value,
Figure BDA0004061348670000043
is a predicted value;
judging whether the loss function value reaches a preset value, and if the loss function value is larger than the preset value, adjusting parameters of the position coding matrix P and the linear transformation matrix W; if the loss function value is smaller than or equal to a preset value, a trained transducer prediction model is obtained; and inputting the data of the test set into the trained transducer prediction model, and evaluating the prediction effect of the trained transducer prediction model.
As a further definition: the environment prediction and monitoring system of the Internet of things further comprises a mobile phone app end and a remote monitoring host, the environment data acquisition control terminal in the step S1 further comprises a display module, and the environment information acquisition module comprises a temperature and humidity sensor, an illuminance sensor and a CO 2 A sensor; the environmental data comprises temperature and humidity acquired by a temperature and humidity sensor, illuminance acquired by an illuminance sensor and CO 2 Sensor-captured CO 2 Concentration; the step S2 further comprises the step that the MCU control module sends the received environment data to the display module, and the environment data is displayed in real time; the step S3 further comprises the step that the cloud server sends the received environment data and the predicted environment data of the next time period to the mobile phone app end and the remote monitoring host, and the user checks the environment data information received by the cloud server and the environment data of the next time period predicted by the cloud server through the mobile phone app end and the remote monitoring host.
As a further definition: the execution module further comprises a ventilation unit; step S4 also comprises the step that the MCU control module controls the ventilation operation of the ventilation unit according to the intelligent control strategy according to the environmental data of the next time period predicted by the cloud server and the environmental data of the corresponding time period acquired by the environmental information acquisition module; the intelligent control strategy comprises a water supply control strategy and a ventilation control strategy, and the water supply control strategy is specifically as follows: in each return period of the cloud server, comparing the predicted humidity of the next time period with a preset humidity value, and the humidity of the corresponding time period acquired by the temperature and humidity sensor with the preset humidity value, wherein the MCU control module controls the starting frequency of the water supply unit and the time maintained after each starting according to the comparison result; ventilation control strategy: within each backhaul period of the cloud server, the predicted CO for the next time period is compared 2 Concentration and preset CO 2 Concentration value, CO 2 Sensor-captured CO 2 Concentration and preset CO 2 The MCU control module controls the concentration value according to the comparison resultThe frequency of activation of the ventilation unit and the time that it is maintained after each activation.
By adopting the scheme, compared with the prior art, the invention has the following beneficial effects:
according to the method and the system for predicting and monitoring the environment of the Internet of things, the environment data acquisition control terminal and the cloud server are arranged, the wireless communication technology of the Internet of things and the cloud computing technology are adopted, deployment is simple, energy consumption is low, multi-node deployment is supported, the computing capacity of an embedded MCU is not depended, a transducer prediction model is arranged in the cloud server, the environment data of the next time period is predicted by the transducer prediction model, the predicted data is not depended on monitoring of a weather station, the environment data of the corresponding time period can be adjusted according to the field condition, the environment data of the corresponding time period is acquired by combining the environment information acquisition module, high-precision monitoring and high-precision prediction of the environment data are realized, irrigation is carried out according to the predicted environment data, the acquired environment data and an intelligent control strategy, and water resources are saved; the transducer prediction model is based on a transducer algorithm, so that the problems of gradient explosion and gradient disappearance are avoided, the data parallelization processing effect is good, the attention mechanism is introduced, and the training effect of long data is improved.
The invention is suitable for monitoring and predicting the agricultural production environment.
Drawings
The invention will be described in more detail below with reference to the accompanying drawings and specific examples.
FIG. 1 is a block diagram of an environment prediction and monitoring system for the Internet of things according to an embodiment of the invention;
FIG. 2 is a flowchart of a method for predicting and monitoring an environment of the Internet of things according to an embodiment of the invention;
in the figure: 1. an environmental data acquisition control terminal; 2. an environmental information acquisition module; 3. and executing the module.
Detailed Description
The invention is further described below in connection with the embodiments, but it will be understood by those skilled in the art that the invention is not limited to the following embodiments, and any modifications and equivalent changes based on the specific embodiments of the invention are within the scope of the claims.
Embodiment of method and system for predicting and monitoring environment of Internet of things
The utility model provides an thing networking environment prediction and monitored control system, its structure block diagram is as shown in figure 1, including environmental data acquisition control terminal 1, cloud ware, cell-phone app end and remote monitoring host computer, environmental data acquisition control terminal 1 deploys in plantation or warmhouse booth, environmental data acquisition control terminal includes environmental information acquisition module 2, MCU control module, execution module 3, communication module, display module and power module, MCU control module stores the intelligent control strategy of execution module 3, environmental information acquisition module 2 includes temperature and humidity sensor, illuminance sensor and CO 2 A sensor, the execution module 3 comprising a water supply unit and a ventilation unit; the input end of the MCU control module is respectively connected with the output end of the temperature and humidity sensor, the output end of the illuminance sensor and the CO through an IIC bus 2 The output end of the sensor is connected with the input end of the water supply unit and the input end of the ventilation unit through an IIC bus, the output end of the MCU control module is connected with the input end of the display module through a spi bus, the MCU control module is connected with the communication module through a serial interface, the communication module is connected with the cloud server through a network, the cloud server is in communication connection with the mobile phone app end and the remote monitoring host, and the power supply module supplies power to the environment information acquisition module 2, the MCU control module and the execution module 3; the cloud server internally stores a transducer prediction model, the transducer prediction model comprises an encoder module, an attention module and an output full-connection module, environment data in the cloud server is input to the encoder module, an output result of the encoder module is input to the attention module, correlation information among environment data in continuous time periods is extracted through the attention module, an output result of the attention module is input to the output full-connection module, and a prediction result of environment data in the next time period is output through the output full-connection module.
In this embodiment, the MCU control module is an STM32F103C8T6 microcontroller, the communication module is an IoT module, the temperature and humidity sensor is a DHT11 digital sensor, and the illuminance sensor is a BH1750 illumination sensorDegree sensor, CO 2 The sensor is RBY-CO 2 The air-sensitive sensor, the display module adopts 0.96 cun 7 pin spi bus LCD, the water supply unit adopts the direct current motor water pump, the ventilation unit adopts the direct current motor fan, the power supply module adopts 12V direct current power supply, step down to 5V and 3.3V for environmental information acquisition module 2, MCU control module and executive module 3 power supply through the LDO chip.
The flow chart of the method for predicting and monitoring the environment of the internet of things in the embodiment is shown in fig. 2, and the method comprises the following steps:
s1, an environmental information acquisition module 2 in an environmental data acquisition control terminal 1 acquires environmental data in a plantation or a greenhouse and sends the environmental data to an MCU control module; the environmental data comprises temperature and humidity acquired by a temperature and humidity sensor, illuminance acquired by an illuminance sensor and CO 2 Sensor-captured CO 2 Concentration;
s2, the MCU control module sends the received environment data to the cloud server at regular time through the communication module; the MCU control module sends the received environmental data to the display module, and displays the environmental data in real time;
s3, the cloud server stores the received environmental data, inputs the environmental data into an encoder module of a trained transducer prediction model, inputs the output result of the encoder module into an attention module, extracts correlation information among environmental data in continuous time periods through the attention module, inputs the output result of the attention module into an output full-connection module, outputs the prediction result of the environmental data in the next time period through the output full-connection module, and periodically returns the predicted environmental data in the next time period to the MCU control module, wherein the return period is one hour; the cloud server sends the received environment data and the predicted environment data of the next time period to the mobile phone app end and the remote monitoring host, and a user checks the environment data information received by the cloud server and the environment data of the next time period predicted by the cloud server through the mobile phone app end and the remote monitoring host;
the training process of the transducer prediction model is as follows: the cloud server acquires the environmental data uploaded by the environmental data acquisition control terminal 1, packages the environmental data into a data set according to a time period, uses the first 70% of data for a training set and the last 30% for a test set; inputting the data of the training set to an encoder module, wherein the encoder module carries out linear transformation and position coding on the data of the training set, and a combined output calculation formula of the linear transformation and the position coding is as follows:
X IE =(X IN ·W 0 +b 0 )+P
in the above, X IN ∈i T×d The data of the training set is input and is a T row and d column matrix; x is X IE Is the combined output of linear transformation and position coding, X IE ∈i T×k A matrix of T rows and k columns; w (W) 0 ∈i d×k Is a first linear transformation matrix which runs through all time intervals and is a matrix of d rows and k columns; b 0 ∈i k Representing a first bias; p epsilon i T×k Is a position coding matrix which is a T row and k column matrix; p and W 0 Randomly initializing an initial value; the data of the combined output of the linear transformation and the position coding are input to an attention module after full connection and normalization, and the normalized output X after full connection FF The method comprises the following steps:
X FF =Norm(X IE +ReLU(X IE ·W 1 +b 1 )·W 1 +b 2 )
in the formula, W 1 ∈i d×k The second linear transformation matrix is a matrix of d rows and k columns and penetrates through all time intervals; b 1 ∈i k Representing a second bias; b 2 ∈i k Representing a third bias;
X FF generating three input matrices K, V, Q for the attention module, where K ε i T×k ,V∈i T×k ,Q∈i T×k T rows and k columns are all matrix; then, a softmax activation function is applied to the three input matrixes K, V and Q to obtain the connection matrixes C, C epsilon i of the attention module T×k For the matrix of T rows and k columns, the calculation formula of the connection matrix C of the attention module is as follows:
Figure BDA0004061348670000081
h in the formula is the number of taking multiple attention points, and 8 attention points are taken in the embodiment; then, after normalization processing is carried out on the connection matrix C of the attention module, the predicted value of the full-connection layer is output through a ReLU activation function
Figure BDA0004061348670000082
Namely, the predicted environmental data of the next time period is the environmental data of the next time period according to +.>
Figure BDA0004061348670000083
And the actual environmental data y of the corresponding time period, calculating a loss function value MSE; the loss function value calculation formula is:
Figure BDA0004061348670000084
wherein N is the number of samples, y is the true value,
Figure BDA0004061348670000085
is a predicted value;
judging whether the loss function value reaches a preset value, wherein the preset value of the loss function value is 0.01, and if the loss function value is larger than the preset value, adjusting parameters of the position coding matrix P and the linear transformation matrix W; if the loss function value is smaller than or equal to a preset value, a trained transducer prediction model is obtained; inputting the data of the test set into a trained transducer prediction model, and evaluating the prediction effect of the trained transducer prediction model;
s4, the MCU control module controls irrigation operation of the water supply unit and ventilation operation of the ventilation unit according to the intelligent control strategy according to the received predicted environmental data of the next time period and the environmental data of the corresponding time period acquired by the environmental information acquisition module 2;
the intelligent control strategy comprises a water supply control strategy and a ventilation control strategy, and the water supply control strategy is specifically as follows: in each return period of the cloud server, when predictedWhen the humidity in a period of time is smaller than a preset humidity value of 15RH and the humidity in a corresponding period of time acquired by a temperature and humidity sensor is also smaller than the preset humidity value of 15RH, the MCU control module controls the water supply unit to be started once every 15 minutes and for 5 minutes each time; when the humidity of the predicted next time period is smaller than a preset humidity value of 15RH and the humidity of the corresponding time period acquired by the temperature and humidity sensor is larger than the preset humidity value of 15RH, the MCU control module controls the water supply unit to be started every 15 minutes and every 2 minutes; when the humidity of the next predicted time period and the humidity of the corresponding time period acquired by the temperature and humidity sensor are both larger than a preset humidity value 15RH, the MCU control module does not start the water supply unit. Ventilation control strategy: in each return period of the cloud server, when the cloud server predicts the CO of the next time period 2 The concentration is more or less than 2000ppm, CO 2 Sensor-acquired CO for a corresponding period of time 2 Concentration of CO greater than a predetermined concentration 2 When the concentration value is 2000ppm, the MCU control module controls the ventilation unit to start a first ventilation mode, and ventilation is continued until CO 2 Sensor-captured CO 2 Concentration of CO less than preset 2 The concentration value is 2000ppm, and the MCU control module controls the ventilation unit to stop; CO when predicted next time period 2 Concentration of CO greater than a predetermined concentration 2 Concentration value 2000ppm, CO 2 Sensor-acquired CO for a corresponding period of time 2 Concentration of CO less than preset 2 When the concentration value is 2000ppm, a second ventilation mode is started, and the MCU control module controls the ventilation unit to start every 5 minutes for 1 minute until the CO is predicted 2 Concentration of CO less than preset 2 Concentration value 2000ppm; CO when predicted next time period 2 Concentration and CO 2 Sensor-acquired CO for a corresponding period of time 2 The concentration of CO is smaller than that of preset CO 2 At a concentration value of 2000ppm, the MCU control module does not activate the ventilation unit.
The environmental data predicted by the cloud server and the environmental data of the corresponding moment collected by the environmental information collection module are shown in table 1.
Table 1 environmental data predicted by the cloud server and environmental data at corresponding time collected by the environmental information collection module of this embodiment
Figure BDA0004061348670000091
According to the environmental data in the table 1, at the moment of 13:56:11, the humidity value acquired by the temperature and humidity sensor and the humidity value predicted by the cloud server are both greater than 15RH, and the MCU control module does not start the direct current motor water pump; CO 2 Sensor-captured CO 2 Concentration and cloud server predicted CO 2 The concentration is less than 2000ppm, and the MCU control module does not start the fan of the direct current motor;
at the moment of 14:56:34, the humidity value acquired by the temperature and humidity sensor and the humidity value predicted by the cloud server are both greater than 15RH, and the MCU control module does not start the direct current motor water pump; CO 2 Sensor-captured CO 2 Concentration and cloud server predicted CO 2 The concentration is less than 2000ppm, and the MCU control module does not start the fan of the direct current motor;
at the moment of 17:56:24, the humidity value acquired by the temperature and humidity sensor is larger than 15RH, but the predicted humidity value of the cloud server is smaller than 15RH, and the MCU control module controls the direct current motor water pump to be started every 15 minutes for 2 minutes each time; CO 2 Sensor-captured CO 2 Concentration greater than 2000ppm, CO predicted by cloud server 2 The concentration is less than 2000ppm, the MCU control module controls the fan of the direct current motor to start a first ventilation mode, and ventilation is continued until CO 2 Sensor-captured CO 2 Concentration of CO less than preset 2 Concentration value 2000ppm;
at the moment of 18:56:50, after water is supplied for one hour, the humidity value acquired by the temperature and humidity sensor and the predicted humidity value of the cloud server are both greater than 15RH, and the MCU control module controls the direct current motor water pump to stop water supply; CO 2 Sensor-captured CO 2 Concentration is less than 2000ppm, but the cloud server predicts CO 2 The concentration is still more than 2000ppm, the MCU control module controls the direct current motor fan to start the second ventilation mode, and the direct current motor fan is started every 5 minutes and every 1 minute until the CO is predicted 2 Concentration of CO less than preset 2 The concentration value was 2000ppm.
According to the embodiment, the environment data of the next time period is predicted through the transducer prediction model, the predicted data is not dependent on monitoring of a weather station, can be adjusted according to the on-site situation, and the environment data of the corresponding time period is collected by combining the environment information collection module, so that high-precision monitoring and high-accuracy prediction of the environment data are realized, irrigation is carried out according to the predicted environment data, the collected environment data and an intelligent control strategy, and water resources are saved.

Claims (10)

1. The environment prediction and monitoring system of the Internet of things is characterized by comprising an environment data acquisition control terminal and a cloud server, wherein the environment data acquisition control terminal comprises an environment information acquisition module, an MCU control module, an execution module, a communication module and a power supply module, wherein an intelligent control strategy of the execution module is stored in the MCU control module, the execution module comprises a water supply unit, the output end of the environment information acquisition module is connected with the input end of the MCU control module, the output end of the MCU control module is connected with the input end of the water supply unit, the MCU control module is in communication connection with the cloud server through the communication module, and the power supply module supplies power to the environment information acquisition module, the MCU control module and the execution module; the cloud server internally stores a transducer prediction model, the transducer prediction model comprises an encoder module, an attention module and an output full-connection module, environment data in the cloud server is input to the encoder module, an output result of the encoder module is input to the attention module, correlation information among environment data in continuous time periods is extracted through the attention module, an output result of the attention module is input to the output full-connection module, and a prediction result of environment data in the next time period is output through the output full-connection module.
2. The internet of things environment prediction and monitoring system of claim 1, wherein the environmental information collection module comprises a temperature and humidity sensor, an illuminance sensor and CO 2 Sensor, temperature and humidity sensor output end, illuminance sensor output end and CO 2 The output end of the sensor is connected with the input end of the MCU control module.
3. The system for predicting and monitoring the environment of the internet of things according to claim 1, wherein the execution module further comprises a ventilation unit, and an input end of the ventilation unit is connected with an output end of the MCU control module; the water supply unit adopts a direct current motor water pump, and the ventilation unit adopts a direct current motor fan.
4. The system for predicting and monitoring the environment of the internet of things according to claim 1, wherein the environment data acquisition control terminal further comprises a display module, and an input end of the display module is connected with an output end of the MCU control module.
5. The system for predicting and monitoring the environment of the internet of things according to claim 1, wherein the system for predicting and monitoring the environment of the internet of things further comprises a mobile phone app end and a remote monitoring host, and the mobile phone app end and the remote monitoring host are both in communication connection with the cloud server.
6. The internet of things environment prediction and monitoring system of claim 1, wherein the MCU control module is an STM32F103C8T6 microcontroller and the communication module is an IoT module.
7. A method for predicting and monitoring an environment of an internet of things according to any one of claims 1-6, comprising the steps of:
s1, an environmental information acquisition module in an environmental data acquisition control terminal acquires environmental data in a plantation or a greenhouse and sends the environmental data to an MCU control module;
s2, the MCU control module sends the received environment data to the cloud server at regular time through the communication module;
s3, the cloud server stores the received environmental data, inputs the environmental data into an encoder module of a trained transducer prediction model, inputs the output result of the encoder module into an attention module, extracts correlation information among environmental data in continuous time periods through the attention module, inputs the output result of the attention module into an output full-connection module, outputs the prediction result of the environmental data in the next time period through the output full-connection module, and periodically returns the predicted environmental data in the next time period to the MCU control module;
and S4, controlling the irrigation operation of the water supply unit by the MCU control module according to the received environmental data of the next time period predicted by the cloud server and the environmental data of the corresponding time period acquired by the environmental information acquisition module and the intelligent control strategy.
8. The method of claim 7, wherein the training process of the transducer prediction model is: the cloud server acquires the environmental data uploaded by the environmental data acquisition control terminal, packages the environmental data into a data set according to a time period, and divides the data set into a training set and a testing set; inputting the data of the training set to an encoder module, wherein the encoder module carries out linear transformation and position coding on the data of the training set, and a combined output calculation formula of the linear transformation and the position coding is as follows:
X IE =(X IN ·W 0 +b 0 )+P
in the above, X IN ∈i T×d The data of the training set is input and is a T row and d column matrix; x is X IE Is the combined output of linear transformation and position coding, X IE ∈i T×k A matrix of T rows and k columns; w (W) 0 ∈i d×k Is a first linear transformation matrix which runs through all time intervals and is a matrix of d rows and k columns; b 0 ∈i k Representing a first bias; p epsilon i T×k Is a position coding matrix which is a T row and k column matrix; p and W 0 Randomly initializing an initial value; the data of the combined output of the linear transformation and the position coding are input to an attention module after full connection and normalization, and the normalized output X after full connection FF The method comprises the following steps:
X FF =Norm(X IE +ReLU(X IE ·W 1 +b 1 )·W 1 +b 2 )
in the formula, W 1 ∈i d×k Is to extend through all time zonesThe second linear transformation matrix is a matrix of d rows and k columns; b 1 ∈i k Representing a second bias; b 2 ∈i k Representing a third bias;
X FF generating three input matrices K, V, Q for the attention module, where K ε i T×k ,V∈i T×k ,Q∈i T×k T rows and k columns are all matrix; then, a softmax activation function is applied to the three input matrixes K, V and Q to obtain the connection matrixes C, C epsilon i of the attention module T×k For the matrix of T rows and k columns, the calculation formula of the connection matrix C of the attention module is as follows:
Figure FDA0004061348650000031
h in the formula is the number of taking multiple attention points, and 8 attention points are taken in the embodiment; then, after normalization processing is carried out on the connection matrix C of the attention module, the predicted value of the full-connection layer is output through a ReLU activation function
Figure FDA0004061348650000034
Namely, the predicted environmental data of the training set data in the next time period is the predicted environmental data in the next time period +.>
Figure FDA0004061348650000035
And the actual environmental data y of the corresponding time period, calculating a loss function value MSE; the loss function value calculation formula is:
Figure FDA0004061348650000032
wherein N is the number of samples, y is the true value,
Figure FDA0004061348650000033
is a predicted value;
judging whether the loss function value reaches a preset value, and if the loss function value is larger than the preset value, adjusting parameters of the position coding matrix P and the linear transformation matrix W; if the loss function value is smaller than or equal to a preset value, a trained transducer prediction model is obtained; and inputting the data of the test set into the trained transducer prediction model, and evaluating the prediction effect of the trained transducer prediction model.
9. The prediction and monitoring method according to claim 7 or 8, wherein the internet of things environment prediction and monitoring system further comprises a mobile phone app end and a remote monitoring host, the environmental data acquisition control terminal in step S1 further comprises a display module, and the environmental information acquisition module comprises a temperature and humidity sensor, an illuminance sensor and a CO 2 A sensor; the environmental data comprises temperature and humidity acquired by a temperature and humidity sensor, illuminance acquired by an illuminance sensor and CO 2 Sensor-captured CO 2 Concentration; the step S2 further comprises the step that the MCU control module sends the received environment data to the display module, and the environment data is displayed in real time; the step S3 further comprises the step that the cloud server sends the received environment data and the predicted environment data of the next time period to the mobile phone app end and the remote monitoring host, and the user checks the environment data information received by the cloud server and the environment data of the next time period predicted by the cloud server through the mobile phone app end and the remote monitoring host.
10. The prediction and monitoring method of claim 9, wherein the execution module further comprises a ventilation unit; step S4 also comprises the step that the MCU control module controls the ventilation operation of the ventilation unit according to the intelligent control strategy according to the environmental data of the next time period predicted by the cloud server and the environmental data of the corresponding time period acquired by the environmental information acquisition module; the intelligent control strategy comprises a water supply control strategy and a ventilation control strategy, and the water supply control strategy is specifically as follows: in each return period of the cloud server, comparing the predicted humidity of the next time period with a preset humidity value, and the humidity of the corresponding time period acquired by the temperature and humidity sensor with the preset humidity value, wherein the MCU control module controls the starting frequency and each starting of the water supply unit according to the comparison resultTime maintained after the movement; ventilation control strategy: within each backhaul period of the cloud server, the predicted CO for the next time period is compared 2 Concentration and preset CO 2 Concentration value, CO 2 Sensor-captured CO 2 Concentration and preset CO 2 And the MCU control module controls the starting frequency of the ventilation unit and the time maintained after each starting according to the concentration value.
CN202310061924.1A 2023-01-15 2023-01-15 Internet of things environment prediction and monitoring method and system Pending CN116184891A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310061924.1A CN116184891A (en) 2023-01-15 2023-01-15 Internet of things environment prediction and monitoring method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310061924.1A CN116184891A (en) 2023-01-15 2023-01-15 Internet of things environment prediction and monitoring method and system

Publications (1)

Publication Number Publication Date
CN116184891A true CN116184891A (en) 2023-05-30

Family

ID=86451753

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310061924.1A Pending CN116184891A (en) 2023-01-15 2023-01-15 Internet of things environment prediction and monitoring method and system

Country Status (1)

Country Link
CN (1) CN116184891A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116582597A (en) * 2023-07-13 2023-08-11 湖北省林业科学研究院 Intelligent monitoring method and system for olive seedling raising environment data

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116582597A (en) * 2023-07-13 2023-08-11 湖北省林业科学研究院 Intelligent monitoring method and system for olive seedling raising environment data
CN116582597B (en) * 2023-07-13 2023-09-08 湖北省林业科学研究院 Intelligent monitoring method and system for olive seedling raising environment data

Similar Documents

Publication Publication Date Title
CN105045234A (en) Intelligent household energy management method based on intelligent wearable equipment behavior perception
CN106910144B (en) Large building time-by-time energy consumption online prediction method based on time-division actual energy consumption coefficient
CN116184891A (en) Internet of things environment prediction and monitoring method and system
KR20210090394A (en) management system for smart-farm machine learning
CN111735178A (en) Air conditioner energy-saving system based on elite meaning and SVR regression algorithm and optimization method
CN109618301B (en) Data processing method of wireless sensor network, readable storage medium and terminal
CN104570873A (en) Aquaculture monitoring system and communication method based on Internet of Things embedded platform
CN112914141B (en) Intelligent tobacco leaf baking and collecting system based on Internet of things
CN114297907A (en) Greenhouse environment spatial distribution prediction method and device
CN110471301A (en) A kind of smart home service recommendation system and method based on user behavior
CN114997508A (en) Greenhouse electricity utilization optimization method and system based on multi-energy complementation
CN111179108A (en) Method and device for predicting power consumption
CN116974230A (en) Intelligent control method and system for equipment operation mode based on Internet of things
CN102156407A (en) Predictive control method and device for ARM (advanced RISC machines)-based embedded type model
CN113111419A (en) Method and system for establishing and predicting air-conditioning load prediction model in office building
CN116582034A (en) Low-energy-consumption permanent magnet outer rotor roller motor control system
CN200950292Y (en) Low-power consumption multi-index field soil moisture content remote monitoring system
CN106896898B (en) System-level energy-saving method applied to large-lag system based on comprehensive monitoring
CN114818059A (en) Building energy-saving strategy optimization control method, device, equipment and readable storage medium
CN113748893A (en) Method for predicting working time of actuating mechanism based on intelligent seedling raising control system
CN114489200A (en) Warmhouse booth environmental control system
CN114548575A (en) Self-adaptive building day-ahead load prediction method based on transfer learning
CN103329758B (en) Production monitoring method based on reconfigurable technology for agricultural greenhouse
CN110826808A (en) Flexible load short-term load prediction method considering demand response
Li et al. A low-power water quality monitoring system and prediction model

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination