接受来自GSM设备的消息并定期更新表
GSM 设备每 3 秒发送一次数据。 100 个这样的设备正在发送消息,并且有一个设备接受这些消息。我想使用 php 每 5 分钟将这些消息插入 mysql 表中。
A gsm device sends data in each 3 seconds. 100 such devices are sending messages and there is a device to accept these messages. I want to insert these messages in mysql table in each 5 minutes using php.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 cronjob 每 5 分钟执行一个 php 脚本,该脚本将在数据库中引入日期。 PHP 脚本在网络服务器中执行,没有持久性,这不是一个以一定时间间隔执行自身的 php 作业。有些事情可以在 PHP 中完成,而其他事情则可以使用其他工具。
或者,您可以使用 javascript 和 setTimeout 函数来调用 php 脚本,但 Js 是客户端执行的,对于您想要的东西来说不够可靠。
Use cronjob to execute each 5 minutes a php script that will introduce the date in your db. Php scripts are executed in the webserver without persistence and this is not a php job to execute itself at some intervals. Some things can be done in PHP and for others are other tools available.
Alternatively you could use javascript and setTimeout function to call for a php script but Js is client executed and is not reliable enough for what you want.