Disclosure of Invention
In order to solve the problems, the invention provides a data acquisition method and a data acquisition system for thermal adaptation behaviors of residents in a building, and the specific technical scheme is as follows:
a data acquisition method for thermal adaptation behaviors of residents in a building comprises the following steps:
s1: the method comprises the following steps that a host machine is in communication connection with a plurality of slave machines through a data transmission module, the slave machines are connected with a plurality of behavior data acquisition modules, and thermal adaptive behavior data of residents in a building room are acquired through the behavior data acquisition modules; the host collects temperature and humidity data and time data in a corresponding room; the data transmission unit sets a specific slave networking address for different behavior data acquisition modules;
s2: the plurality of behavior data acquisition modules transmit the acquired thermal adaptation behavior data to the corresponding slave machines, and the slave machines transmit the acquired thermal adaptation behavior data to the host machines through the data transmission modules;
s3: after receiving the thermal adaptation behavior data sent from the host, the host stores the collected temperature and humidity data, the thermal adaptation behavior data, and the time point and the time period of occurrence of the thermal adaptation behavior so as to be read by the computer.
Preferably, the behavior data acquisition module comprises a personnel acquisition module, a door and window switch acquisition module and a power consumption acquisition module, wherein the personnel acquisition module is arranged at an entrance and an exit in a building room and is used for acquiring the movement condition and the number condition of personnel in the building room; the door and window switch acquisition module is arranged at the door and door frame, the window and the window frame and is used for acquiring the door and window switch state data; the power consumption acquisition module is connected with heating and refrigerating equipment in the building room and used for acquiring the on-off state of the heating and refrigerating equipment in the building room and the power consumption of the heating and refrigerating equipment; the personnel acquisition module, the door and window switch acquisition module and the power consumption acquisition module are respectively connected with the corresponding host.
Preferably, the personnel acquisition module comprises a camera, a two-dimensional coordinate system is set for a fixed view under the camera, taking the intersection point position of the diagonal lines of the rectangular door frame as an origin (0,0), wherein the outdoor part of the fixed view is positioned in the y-axis positive half-axis area of the coordinate system, the indoor part is positioned in the y-axis negative half-axis area of the coordinate axis, when the human face appears in the fixed view, the movement of each face in the fixed view is assigned with a dynamic coordinate value (x, y), the camera judges the movement of the person by detecting the change of the y value in the (x, y) coordinate value of the face in the coordinate system, when a person is in a fixed view outdoors, the y value in the dynamic coordinate values (x, y) to which the person is given at this time is a positive value, when the y value is changed from a positive value to a negative value, a signal that people enter the room is transmitted, and the number of people in the room is the sum of the number of people in the room of the current building and the number of the people entering the room; on the contrary, when the people are in the fixed view of the indoor, the y value in the dynamic coordinate value (x, y) assigned to the people at the moment is a negative value, when the y value is changed from the negative value to a positive value, a signal that the people go out of the indoor is transmitted, and the number of the indoor people is the number of the people in the current building room minus the number of the faces going out of the building room, so that the number of the people in the building room is determined.
Preferably, personnel collection module includes two infrared sensor, is first infrared sensor and second infrared sensor respectively, and wherein first infrared sensor installs in the gate outside, and second infrared sensor installs inside the gate, and two infrared sensor are connected with the host computer respectively, and the host computer judges according to the order that first infrared sensor and second infrared sensor detected the signal and judges the indoor personnel of judgement building and remove the condition and the indoor number of people of building. When people enter, the first infrared sensor detects signals firstly, the second infrared sensor detects signals later, the host respectively receives the signals of the first infrared sensor and the second infrared sensor, and judges that the people enter according to the sequence of the signals, and the number of the indoor people is the number of the indoor people in the current building plus the number of the signals transmitted by the second infrared sensor received by the host processing module; when people leave the room, the second infrared sensor detects signals firstly, the first infrared sensor detects signals later, the host machine receives the signals of the second infrared sensor and the first infrared sensor respectively, and judges that the people leave according to the sequence of the signals, and the number of the indoor people is the number of the indoor people in the current building minus the number of the signals transmitted by the first infrared sensor.
Preferably, the door and window switch acquisition module comprises a first door magnetic induction switch installed at a window and a second door magnetic induction switch installed at a door frame; the slave machine judges whether the door is opened or closed or opened or closed by detecting the interface level of the first door magnetic induction switch and the second door magnetic induction switch.
Preferably, the power consumption collection module comprises an ammeter, the ammeter is respectively connected with the heating and cooling equipment and the slave machine, the slave machine judges whether the heating and cooling equipment is opened or not through collecting current data of the ammeter, and the power consumption data of the ammeter is collected to judge the power consumption condition of the heating and cooling equipment.
Preferably, the master stores the collected data of the slave, the temperature and humidity data, and the time point and the time period when the behavior occurs in the SD card.
Preferably, the host writes the collected data of the slave, the collected temperature and humidity data, and the time point and the time period when the behavior occurs into the SD card in an Excel format through the FatFs file system.
A data acquisition system for thermal adaptation behaviors of residents in a building comprises a host and a plurality of slave machines; the plurality of slave machines are respectively communicated with the host machine and realize data interaction;
the slave machine comprises a personnel acquisition module, a door and window switch acquisition module, a power consumption acquisition module, a slave machine processing module and a slave machine communication module; the personnel acquisition module, the door and window switch acquisition module, the power consumption acquisition module and the slave communication module are respectively connected with the slave processing module; the power consumption acquisition module is connected with indoor heating and refrigerating equipment of the building;
the personnel acquisition module is used for acquiring the movement condition and the number condition of personnel in the building and transmitting the acquired data to the slave computer processing module; the door and window switch acquisition module is used for acquiring state data of doors and windows in the building and transmitting the acquired data to the slave processing module; the power consumption acquisition module is used for acquiring the on-off state of heating and refrigerating equipment in the building and the power consumption of the heating and refrigerating equipment and transmitting the acquired data to the slave processing module; the slave processing module is used for judging the movement condition of personnel in a building room and the number of people in the building room through the data collected by the personnel collecting module, judging whether doors and windows are opened or closed through the data collected by the door and window opening and closing collecting module and judging whether heating and refrigerating equipment in the building room is opened or closed and power consumption data through the power consumption collecting module, and transmitting the collected data and the judgment result to the host through the slave communication module;
the host comprises a host communication module, a clock module, a temperature and humidity acquisition module, a host processing module and an SD card; the host communication module, the clock module and the temperature and humidity acquisition module are respectively connected with the host processing module;
the host communication module is used for communicating with the slave communication module and receiving data sent by the slave and a judgment result; the clock module is used for providing a clock source for the host processing module; the temperature and humidity acquisition module is used for acquiring temperature and humidity data in a building room and transmitting the acquired data to the host processing module; and the host module is used for storing the time point and the time period of the occurrence of the thermal adaptation behavior, the temperature and humidity data, the data collected from the slave and the judgment result into the SD card.
Preferably, the host computer further comprises a display screen, and the display screen is connected with the host computer processing module and used for displaying data and processing results acquired by the host computer.
The invention has the beneficial effects that: the slave machine integrates and upgrades different sensors into one data acquisition system, and can realize the unified acquisition of the heat and humidity environmental parameters, the heat adaptation behaviors and the movement condition data of people in the building; the life style and energy consumption regulation behaviors of residents in the building are depicted and reflected by opening/closing various heating and refrigerating mechanical equipment data of doors, windows and people, so that the data acquisition of behavior energy-saving research and green intelligent building design is guaranteed; the system provided by the invention is simple to operate, high in acquisition efficiency and guaranteed in data reliability, and avoids the complex operation of separate and independent testing of multiple instruments and errors generated in data integration of different testing systems; and the data are exported in the same system, so that the statistical analysis of the data at a later stage is facilitated.
Detailed Description
For a better understanding of the present invention, reference is made to the following detailed description taken in conjunction with the accompanying drawings in which:
a data acquisition method for thermal adaptation behaviors of residents in a building comprises the following steps:
s1: the method comprises the following steps that a host machine is in communication connection with a plurality of slave machines through a data transmission module, the slave machines are connected with a plurality of behavior data acquisition modules, and thermal adaptive behavior data of residents in a building room are acquired through the behavior data acquisition modules; the host collects temperature and humidity data and time data in a corresponding room; the data transmission unit sets a specific slave networking address for different behavior data acquisition modules.
S2: the plurality of behavior data acquisition modules transmit the acquired thermal adaptation behavior data to the corresponding slave machines, and the slave machines transmit the acquired thermal adaptation behavior data to the host machines through the data transmission modules; the behavior data acquisition module comprises a personnel acquisition module, a door and window switch acquisition module and a power consumption acquisition module, wherein the personnel acquisition module is arranged at an entrance and an exit in a building room and is used for acquiring the movement condition and the number condition of personnel in the building room; the door and window opening and closing acquisition module is arranged at the door, the door frame, the window and the window frame and is used for acquiring opening and closing state data of the door and the window; the power consumption acquisition module is connected with heating and refrigerating equipment in the building room and used for acquiring the on-off state of the heating and refrigerating equipment in the building room and the power consumption of the heating and refrigerating equipment; the personnel acquisition module, the door and window switch acquisition module and the power consumption acquisition module are respectively connected with the corresponding host.
The personnel acquisition module comprises a camera, a two-dimensional coordinate system is set for a fixed view under the camera, taking the intersection point position of the diagonal lines of the rectangular door frame as an origin (0,0), wherein the outdoor part of the fixed view is positioned in the y-axis positive half-axis area of the coordinate system, the indoor part is positioned in the y-axis negative half-axis area of the coordinate axis, when the human face appears in the fixed view, the movement of each face in the fixed view is assigned with a dynamic coordinate value (x, y), the camera judges the movement of the person by detecting the change of the y value in the (x, y) coordinate value of the face in the coordinate system, when a person is in a fixed view outdoors, the y value in the dynamic coordinate values (x, y) to which the person is given at this time is a positive value, when the y value is changed from a positive value to a negative value, a signal that people enter the room is transmitted, and the number of people in the room is the sum of the number of people in the room of the current building and the number of the people entering the room; on the contrary, when the people are in the fixed view of the indoor, the y value in the dynamic coordinate value (x, y) assigned to the people at the moment is a negative value, when the y value is changed from the negative value to a positive value, a signal that the people go out of the indoor is transmitted, and the number of the indoor people is the number of the people in the current building room minus the number of the faces going out of the building room, so that the number of the people in the building room is determined.
The door and window switch acquisition module comprises a first door magnetic induction switch arranged at a window and a second door magnetic induction switch arranged at a door frame; the slave machine judges whether the door is opened or closed or opened or closed by detecting the interface level of the first door magnetic induction switch and the second door magnetic induction switch. The first door magnetic induction switch and the second door magnetic induction switch are respectively MC-53 door magnetic induction switches, the MC-53 door magnetic induction switches are led out to form two input lines, a slave computer judges whether to open a window or close the door by detecting an interface level of the door magnetic induction switches, one of the two input lines is connected with an IO port of the slave computer, the other input line is grounded, the input line connected with the IO port is pulled up to be a high level by default, when a magnet on the window (door) is close to the IO port, the IO port is pulled down to be a low level, and when the singlechip detects that the IO port is the high level, the window (door) is opened, and when the IO port is the low level, the window (door) is closed.
The power consumption acquisition module comprises an RS-485 ammeter, the ammeter is respectively connected with the heating and refrigerating equipment and the slave machine, the slave machine judges whether the heating and refrigerating equipment is opened or not by acquiring current data of the ammeter, and the power consumption data of the ammeter is acquired to judge the power consumption condition of the heating and refrigerating equipment. The power plug of the heating and refrigerating equipment is connected with the RS-485 electric meter, the slave single chip microcomputer is communicated with the RS-485 electric meter through RS485, the communication adopts a national grid DLT645-2007 protocol, and the RS-485 electric meter is connected with the slave single chip microcomputer through a slave 485-to-serial port circuit module. The 485 serial port circuit adopts SP3485 chip, can realize the transmission rate of highest 2.5Mbps, and the singlechip reads power consumption and the on-off state of equipment through sending the read data request to the ammeter.
The single chip microcomputer sends a power consumption and current reading instruction to the RS-485 electric meter device at the frequency of once a second, and the RS-485 electric meter sends the current power consumption and current to the single chip microcomputer after receiving the instruction. When the read current is 0, the information fed back to the single chip microcomputer is that the equipment is in a closed state, and on the contrary, when the current is greater than 0, the information fed back to the single chip microcomputer is that the equipment is in an open state. When the equipment state changes, the singlechip compares the power consumption read at the closing moment with the power consumption read at the opening moment, and the difference of the two readings is the power consumption of the heating and refrigerating equipment at the stage; therefore, the data acquisition of the power consumption of the heating and refrigerating equipment and the real-time monitoring of the switching state of the heating and refrigerating equipment are realized.
The data transmission module selects one of the Bluetooth module, the 4G/5G module, the GPRS module and the WIFI module which are matched with each other. In this embodiment, the slave communication module and the host communication module select the JDY-24M bluetooth communication module, the working voltage is 1.9-3.6V, and the maximum MESH networking number supports 65536 device networking. The host communication module sets a specific networking address for different behavior data acquisition node single-chip microcomputers, and the data transmission principle of the host and the slave is as follows: the Bluetooth networking address of the main board is set to be 0001, the address of the camera node is 0002, the addresses of the two door magnetic induction switch nodes are 0003 and 0004, and the address of the heating and refrigerating equipment node is 0005. The node sends data to the host in an array form, the sending format is 41542 b 4d 45534800 + host address + data +0d 0a, and the data format received by the host is f1 dd + data length + slave address + host address + data +0d 0 a. The master monitors the nodes through the address and the data content of the received slave data.
S3: after receiving the thermal adaptation behavior data sent from the host, the host stores the collected temperature and humidity data, the thermal adaptation behavior data, and the time point and the time period of occurrence of the thermal adaptation behavior so as to be read by the computer. And the host writes the acquired data, the temperature and humidity data of the slave and the time point and the time period of behavior occurrence into the SD card in an Excel format through the FatFs file system.
A data acquisition system for thermal adaptation behaviors of residents in a building comprises a host and a plurality of slave machines; the plurality of slave machines are respectively communicated with the host machine and realize data interaction;
the slave machine comprises a personnel acquisition module, a door and window switch acquisition module, a power consumption acquisition module, a slave machine processing module and a slave machine communication module; the personnel acquisition module, the door and window switch acquisition module, the power consumption acquisition module and the slave communication module are respectively connected with the slave processing module; the power consumption acquisition module is connected with the indoor heating and refrigerating equipment of the building.
The personnel acquisition module is used for acquiring the movement condition and the number condition of personnel in the building and transmitting the acquired data to the slave computer processing module; the door and window switch acquisition module is used for acquiring the state data of doors and windows in the building and transmitting the acquired data to the slave processing module; the power consumption acquisition module is used for acquiring the on-off state of heating and refrigerating equipment in the building and the power consumption of the heating and refrigerating equipment and transmitting the acquired data to the slave processing module; the slave processing module is used for judging the movement condition of personnel in the building and the number of people in the building through the data collected by the personnel collecting module, judging whether doors and windows are opened or closed through the data collected by the door and window opening and closing collecting module, judging whether heating and refrigerating equipment in the building is opened or closed and power consumption data through the power consumption collecting module, and transmitting the collected data and the judgment result to the host through the slave communication module;
the host comprises a host communication module, a clock module, a temperature and humidity acquisition module, a host processing module and an SD card; the host communication module, the clock module and the temperature and humidity acquisition module are respectively connected with the host processing module;
the host communication module is used for communicating with the slave communication module and receiving data sent by the slave and a judgment result; the clock module is used for providing a clock source for the host processing module; the temperature and humidity acquisition module is used for acquiring temperature and humidity data in a building room and transmitting the acquired data to the host processing module; the host module is used for storing the time point and the time period of the occurrence of the thermal adaptation behavior, the temperature and humidity data, the data collected from the slave and the judgment result into the SD card.
The host computer also comprises a display screen which is connected with the host computer processing module and used for displaying the data collected by the host computer and the processing result.
The host subsystem comprises a host communication module, a clock module, a temperature and humidity acquisition module, a host processing module and an SD card; the host communication module, the clock module and the temperature and humidity acquisition module are respectively connected with the host processing module;
the host communication module is used for communicating with the slave communication module and receiving data sent by the slave and a judgment result; the clock module is used for providing a clock source for the host processing module; the temperature and humidity acquisition module is used for acquiring temperature and humidity data in a building room and transmitting the acquired data to the host processing module; the host module is used for storing the time point and the time period of the occurrence of the personnel behavior, the temperature and humidity data, the data collected from the slave subsystem and the judgment result into the SD card.
The host processing module adopts a single chip microcomputer minimum system and is used for receiving sensor signals transmitted back from the slave in real time and displaying the sensor signals in a display screen, and the SD card adopts a FatFs file system for reading and writing, so that different data are effectively classified and counted.
The host machine further comprises a host machine expansion power supply module, a host machine indicator lamp module, a host machine crystal oscillator module, a host machine expansion serial port module, a host machine self-locking switch module, a host machine expansion IO port module, a host machine voltage reduction circuit, a host machine USB-to-serial port circuit, a host machine key module, a host machine reset circuit and a host machine download circuit.
The host expansion power supply module can be externally connected with a power supply to provide a working power supply for the host. The host indicator light module comprises two red indicator lights, wherein the LED1 indicator light is on when the host works normally, and the LED2 can be used for abnormal debugging. The host machine crystal oscillator module comprises a crystal oscillator with the frequency of 8MHz, a serial port can be added to the host machine expansion serial port module, a plurality of external serial port devices are connected, the host machine self-locking switch module is used for keeping the host machine powered on after the self-locking switch is pressed down, the host machine starts to work, and after the self-locking switch is pressed down again, the host machine is powered off and stops working. Host computer extension IO bush piece can increase the IO mouth of host computer, connects a plurality of external device, for example temperature and humidity sensor etc. can adopt two temperature and humidity sensor mutual calibration, gets the average value according to the data that two temperature and humidity sensors gathered, improves data acquisition's accuracy. The host voltage reduction circuit mainly converts a 5V external power supply into a 3.3V power supply voltage to provide a working power supply for the host. The host USB-to-serial port module can realize the communication between the host and the computer. The key module is divided into a reset key and a debugging key, the system is reset after the reset key is pressed down, and the debugging key can be used for debugging programs. The SD card storage module can be inserted into an SD card to store data.
The slave processing module and the host processing module select the minimum system of the single chip microcomputer, the host processing module selects the minimum system of STM32F103RET6, and the slave processing module selects the minimum system ofSTM32F103C8T 6. The clock module includes a DS1302 clock chip. The temperature and humidity acquisition module selects a DHT22 temperature and humidity sensor module, the working voltage is 3.3V-5V, the humidity measurement range is 0-100% RH, and the humidity measurement error is as follows: . + -. 2% RH. The temperature measurement range is 0-80 ℃, the temperature measurement error is +/-0.5 ℃, and the output form is digital output. The host subsystem further comprises a display screen, and the display screen is connected with the host processing module and used for displaying data acquired by the host and processing results.
The slave machine also comprises a slave machine self-locking switch module, a slave machine extension pin header module, a slave machine downloading circuit module, a slave machine USB to serial port module, a slave machine voltage reduction circuit module, a slave machine key module, a slave machine indicator lamp module, a slave machine crystal oscillator module, a slave machine reset circuit module, a slave machine extension IO port module, a slave machine extension peripheral interface module, a slave machine lithium battery charging and power supply protection module and a slave machine voltage boosting module.
And the slave lithium battery charging and power supply protection module adopts TP4056 to charge the battery, when the battery is charged by adopting a USB, the red light is turned on, and after the charging is finished, the red light is turned off and the green light is turned on. The power protection module adopts a DW01 and FS8205A chip combination circuit to prevent the loss of the battery caused by overcharge during charging and overdischarge during use. The boost module uses an SX1308x chip to boost the nominal 4.2V to 5V battery voltage to power the circuit.
Example 2:
a personnel collection module adopted in the step S2 of the data collection method for the thermal adaptation behaviors of residents in a building room comprises two infrared sensors, namely a first infrared sensor and a second infrared sensor, wherein the first infrared sensor is installed outside a doorway, the second infrared sensor is installed inside the doorway, the two infrared sensors are connected with a host respectively, and the host judges and judges the movement condition of the personnel in the building room and the number of people in the building room according to the sequence of signals detected by the first infrared sensor and the second infrared sensor. When people enter, the first infrared sensor detects signals firstly, the second infrared sensor detects signals later, the host respectively receives the signals of the first infrared sensor and the second infrared sensor, and judges that the people enter according to the sequence of the signals, and the number of the indoor people is the number of the indoor people in the current building plus the number of the signals transmitted by the second infrared sensor received by the host processing module; when people leave the room, the second infrared sensor detects signals firstly, the first infrared sensor detects signals later, the host machine receives the signals of the second infrared sensor and the first infrared sensor respectively, and judges that the people leave according to the sequence of the signals, and the number of the indoor people is the number of the indoor people in the current building minus the number of the signals transmitted by the first infrared sensor. The rest is the same as example 1.
The present invention is not limited to the above embodiments, which are merely preferred embodiments of the present invention, and the present invention is not limited thereto, and any modifications, equivalents and improvements made within the spirit and principle of the present invention should be included in the protection scope of the present invention.