接受来自GSM设备的消息并定期更新表

发布于 2024-09-06 10:16:23 字数 89 浏览 1 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

前事休说 2024-09-13 10:16:23

使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文