Bees play a crucial role in terrestrial ecosystems. However, beekeepers are unable to monitor the state of beehives (bees and environment) all the time, which often results in bees escaping or even dying. Currently, some researchers provided the scheme of intelligent beehive monitoring system equipped with the Internet of Things (IoT), There remain two challenges: accurately monitor the environmental status around the hive and accurately track and monitor bees in real time. With the development of the IoT and computer vision algorithms, we hope to provide an automated and efficient system to meet the above challenges. In this paper, we proposed a hive monitoring system, and build a visualization module in the cloud to monitor the activity of bee colonies and the environmental dynamic changes. (1) We proposed a multi-bee tracking algorithm to solve the problem of monitoring bees at the door of the hive; (2) we constructed a dataset containing various complex scenes, named BEE22, for training and testing the performance of our algorithm; (3) we designed a bee counting rule, based on results of multi-bee tracking algorithm, to reasonably count the bees entering or leaving the beehive; (4) we have deployed multiple sensors around(center, margin, door, and environment) the hive to accurately reflect the changes in the environment around the hive. Experimental results demonstrate the effectiveness and excellence of our system. In particular, the tracking performance of the multi-bee tracking algorithm reaches 83.5 % ± 0.7 % Multiple Object Tracking Accuracy (MOTA) and 77.3 %±0.2 % Multiple Object Tracking Precision (MOTP), speeds up to 16 frames per second, compared with other algorithms, MOTA and Identity F1 Score (IDF1) are improved by 5.4 % and 8.2 % respectively. Moreover, our counting algorithm also achieved excellent results, with root mean square error (RMSE) of 1.3 ± 0.1, 0.2 ± 0.0, and 1.6 ± 0.1 in counting the number of bees current, entry, and out scene in an episode, respectively. After that, the system will be deployed and monitored for a long time in the actual scenario, it was found that the activity of bees decreased significantly under heavy rainfall conditions. Additionally, the activity of the bee colony will also increase accordingly, when the amplitude is 500 dB to 2000 dB, the temperature of the center of the beehive is 25 °C to 37 °C, and the humidity is 48 % to 67 %. In summary, our system can provide valuable information for bee farmers to make control decisions on hives.