当前位置: 首页 > news >正文

网站门户建设流程推广产品的方式有哪些

网站门户建设流程,推广产品的方式有哪些,在安庆哪里可以做公司网站,滁州网站开发数据采集 我们可以通过HTTP/gRPC与deviceShifu进行通信,deviceShifu会将我们发送的请求转换成设备所支持协议的形式,并发送给设备。 当设备接收到指令之后,数据会传输到deviceShifu中,之后deviceShifu将数据作为我们请求的返回值…

数据采集

我们可以通过HTTP/gRPC与deviceShifu进行通信,deviceShifu会将我们发送的请求转换成设备所支持协议的形式,并发送给设备。

当设备接收到指令之后,数据会传输到deviceShifu中,之后deviceShifu将数据作为我们请求的返回值进行返回,从而实现数据的采集。

实现自动化数据采集

1.首先,我们可编写以下程序来实现自动采集数据。该程序用于对之前运行的edgedevice-thermometer设备进行实时数据采集,将温度数据进行解析并输出。该程序可以通过任意语言、任意形式进行编写,您可以将数据存入您的数据库中,或者存入文件中。

package main  import (  "log"   "io/ioutil"   "net/http"   "strconv"   "time"
)  func main() {  targetUrl := "http://edgedevice-thermometer/read_value"req, _ := http.NewRequest("GET", targetUrl, nil)for{res, _ := http.DefaultClient.Do(req)body, _ := ioutil.ReadAll(res.Body)temperature, _ := strconv.Atoi(string(body))     if temperature > 20 {log.Println("High temperature:", temperature)} else if temperature > 15 {log.Println("Normal temperature:", temperature)} else {log.Println("Low temperature:", temperature)}res.Body.Close()time.Sleep(2 * time.Second)}
}

2.使用go mod init high-temperature-detecto生成go.mod文件。

3.对于上述程序,我们可以将其打包成docker image并加载到集群中,以便其能更好的与deviceShifu进行通信。创建以下Dockerfile文件:

# syntax=docker/dockerfile:1  FROM golang:1.17-alpine  
WORKDIR /app  
COPY go.mod ./  
RUN go mod download  
COPY *.go ./  
RUN go build -o /high-temperature-detector  
EXPOSE 11111  
CMD [ "/high-temperature-detector" ]

4.使用Dockerfile文件生成docker image,需执行以下命令:

docker build --tag high-temperature-detector:v0.0.1

5.之后我们将docker image加载到集群中,需执行以下命令:

kind load docker-image high-temperature-detector:v0.0.1

6.运行我们编写的数据采集程序 ,需执行以下命令:

kubectl run high-temperature-detector --image=high-temperature-detector:v0.0.1

7.最后我们查看该程序的日志信息获取数据,需执行以下命令:

kubectl logs high-temperature-detector -f

得到的数据结果如下:

2021/10/18 10:35:35 High temperature: 24  
2021/10/18 10:35:37 High temperature: 23  
2021/10/18 10:35:39 Low temperature: 15  
2021/10/18 10:35:41 Low temperature: 11  
2021/10/18 10:35:43 Low temperature: 12  
2021/10/18 10:35:45 High temperature: 28  
2021/10/18 10:35:47 Low temperature: 15  
2021/10/18 10:35:49 High temperature: 30  
2021/10/18 10:35:51 High temperature: 30  
2021/10/18 10:35:53 Low temperature: 15

本文由边无际授权发布

http://www.zhongyajixie.com/news/38201.html

相关文章:

  • 网站制作例子百度识图搜索引擎
  • 网站开发实施计划免费域名解析网站
  • 烟台网站建设优化seo方案
  • 服务网站 建设原则此网站三天换一次域名
  • 河北建设机械协会网站seo品牌推广方法
  • 深圳专业网站建设制作全球疫情最新数据统计
  • 怎么做集合网站seo是什么职位
  • 快速一体化网站建设搜索引擎 磁力吧
  • 免费注册网seo网站关键词优化哪家好
  • 服务器托管运营商英文外链seo兼职在哪里找
  • 人和兽做的网站视频全网营销推广方案外包
  • 免费做图片链接网站广州头条今日头条新闻
  • 北京旅游网站建设seo关键词排行优化教程
  • 用手机做网站的软件常用的营销策略
  • 大连网站建设公司哪家好无忧seo
  • 在线教学的网站开发方案清博大数据舆情监测平台
  • wordpress 文件大小限制网站排名优化多少钱
  • 工具网站有哪些婚恋网站排名前十名
  • 在北京网站建设的岗位站长统计app软件下载
  • 徐州网站建设的特点2345浏览器导航页
  • 大连网站建设找哪家好促销方法100种
  • 手机搭建免费网站关于普通话的手抄报
  • 网站首次备案搜索引擎优化的主要策略
  • 学做美食网站郑州网站seo服务
  • 做钢管网站品牌策划设计
  • 网站建设沟通话术永久免费域名申请
  • shopex网站经常出错市场营销在线课程
  • 网站搬家教程互联网电商平台
  • 太原市建设局网站首页信息流优化师
  • 网站维护中页面模板凤凰军事新闻最新消息