PyQT——蓝牙收发数据(上位机案例-小车控制器)

实现功能

由于本人水平有限,仅用了最简单的进行实现,主要功能:

  • 蓝牙设备扫描以及刷新
  • 蓝牙连接
  • 蓝牙数据发送
  • 蓝牙数据接收
页面实现效果

代码目录结构
代码案例
  • 代码已经全部添加注释,故不再做单独解释。
Main.py 
ble_control_widget.py
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
import sys
import threading
sys.path.append('..')
from ui.Ui_ble_control_widget import *
from drivers.driver_bluetooth import BluetoothDataTransferclass BleControlWidget(QWidget):# 信号定义# 蓝牙列表刷新refresh_signal = pyqtSignal()receive_data_signal = pyqtSignal(bytes)update_connection_signal = pyqtSignal()def __init__(self, parent=None):super().__init__(parent)self.ui = Ui_BleControlWidget()self.ui.setupUi(self)# 按钮槽函数调用self.init_ui()# 实例化属性便于全局调用self.device_list = [] # 蓝牙设备列表self.bd = None# 进入界面默认调用# 刷新蓝牙列表self.refreshBtn_subthread()def init_ui(self):'''按钮与槽函数连接'''# 刷新按钮槽函数绑定self.ui.refreshBtn.clicked.connect(self.refreshBtn_slot)# 连接蓝牙槽函数绑定self.ui.connectBtn.clicked.connect(self.connectBtn_slot)# 蓝牙列表更新信号与槽函数连接self.refresh_signal.connect(self.refresh_signal_slot)# 接收到的数据展示信号与槽函数连接self.receive_data_signal.connect(self.receive_data_signal_slot)# 更新蓝牙的状态槽函数绑定self.update_connection_signal.connect(self.update_connection_signal_slot)# 各控制按钮槽函数绑定self.ui.buzzerOnBtn.clicked.connect(self.contorl_btn_slot)self.ui.distanceBtn.clicked.connect(self.contorl_btn_slot)self.ui.downBtn.clicked.connect(self.contorl_btn_slot)self.ui.leftBtn.clicked.connect(self.contorl_btn_slot)self.ui.lightOffBtn.clicked.connect(self.contorl_btn_slot)self.ui.lightOnBtn.clicked.connect(self.contorl_btn_slot)self.ui.rightBtn.clicked.connect(self.contorl_btn_slot)self.ui.rotateBtn.clicked.connect(self.contorl_btn_slot)self.ui.stopBtn.clicked.connect(self.contorl_btn_slot)self.ui.trackOffBtn.clicked.connect(self.contorl_btn_slot)self.ui.trackOnBtn.clicked.connect(self.contorl_btn_slot)self.ui.upBtn.clicked.connect(self.contorl_btn_slot)def contorl_btn_slot(self):if not self.bp:QMessageBox.warning(self, "蓝牙未连接", "请先连接蓝牙")returnsender = self.sender()if sender is self.ui.buzzerOnBtn:res,msg = self.bd.send_data(b"\x01")elif sender is self.ui.distanceBtn:res,msg = self.bd.send_data(b"\x02")elif sender is self.ui.downBtn:res,msg = self.bd.send_data(b"\x03")elif sender is self.ui.leftBtn:res,msg = self.bd.send_data(b"\x04")elif sender is self.ui.lightOffBtn:res,msg = self.bd.send_data(b"\x05")elif sender is self.ui.lightOnBtn:res,msg = self.bd.send_data(b"\x06")elif sender is self.ui.rightBtn:res,msg = self.bd.send_data(b"\x07")elif sender is self.ui.rotateBtn:res,msg = self.bd.send_data(b"\x08")elif sender is self.ui.stopBtn:res,msg = self.bd.send_data(b"\x09")elif sender is self.ui.trackOffBtn:res,msg = self.bd.send_data(b"\x0a")elif sender is self.ui.trackOnBtn:res,msg = self.bd.send_data(b"\x0b")elif sender is self.ui.upBtn:res,msg = self.bd.send_data(b"\x0c")if res:QMessageBox.information(self, '提示', msg)else:QMessageBox.warning(self, '警告', msg)def update_connection_signal_slot(self):self.ui.connectBtn.setText("已连接")self.ui.connectBtn.setIcon(QIcon(":/icon/disc"))def receive_data_signal_slot(self, data):QMessageBox.information(self, '提示', f'接收到数据:{data}')def refresh_signal_slot(self):if len(self.device_list)>0:for addr,bluetooth in self.device_list:self.ui.comboBox.addItem(bluetooth)def refreshBtn_slot(self):# 如果在刷新前有数据,清空下拉列表,否则会增加多倍数据在下拉框中导致索引超出if self.device_list:self.ui.comboBox.clear()self.device_list = []'''刷新按钮槽函数定义'''# 刷新很耗时间,需要开子线程处理,否则页面卡死t = threading.Thread(target=self.refreshBtn_subthread,daemon=True)t.start()def refreshBtn_subthread(self):'''搜索蓝牙并展示在选择下拉列表中'''self.device_list = BluetoothDataTransfer.scan_devices()# 展示在下拉列表中需要用到信号,子线程中无法直接更新ui页面,会报错print(self.device_list)# 发送信号self.refresh_signal.emit()def connectBtn_slot(self):if self.bd:self.bd.disconnect()self.bd = []self.ui.connectBtn.setText("连接蓝牙")self.ui.connectBtn.setIcon(QIcon(":/icon/connect"))return'''连接蓝牙按钮槽函数定义'''# 连接很耗时间,需要开子线程处理,否则页面卡死t = threading.Thread(target=self.connectBtn_subthread,daemon=True)t.start()def connectBtn_subthread(self):# 获取蓝牙选项index = self.ui.comboBox.currentIndex()address = self.device_list[index][0]name = self.ui.comboBox.currentText()# 连接蓝牙self.bd = BluetoothDataTransfer(address, name)  # 替换为目标设备的蓝牙地址和端口号flag = self.bd.connect()print(flag)if not flag:return# 更新蓝牙连接状态文字和图标self.update_connection_signal.emit()# 开始接受数据while True:data = self.bd.receive_data(1024)if data:# 发送数据到页面弹窗显示print(data)#self.receive_data_signal.emit(data)if __name__ == '__main__':app = QApplication(sys.argv)widget = BleControlWidget()widget.show()sys.exit(app.exec_())
driver_bluetooth.py(来自开源工具)
import bluetooth# 扫描所有设备
class BluetoothDataTransfer:def __init__(self, target_address, target_name, port=1):self.target_address = target_addressself.target_name = target_nameself.port = portself.socket = Nonedef connect(self):"""连接蓝牙设备:return:"""try:self.socket = bluetooth.BluetoothSocket(bluetooth.RFCOMM)self.socket.connect((self.target_address, self.port))print("Connected successfully. {} ({})".format(self.target_name, self.target_address))return Trueexcept (bluetooth.BluetoothError, OSError) as e:self.socket = Noneprint("Connection failed:", str(e))return Falsedef disconnect(self):"""断开蓝牙连接:return:"""if self.socket is not None:self.socket.close()print("Disconnected.")def send_data(self, data):"""发送数据:param data::return:"""if self.socket is not None:try:self.socket.send(data)print("Data sent:", data)return True,"sent succeed"except bluetooth.BluetoothError as e:print("Failed to send data:", str(e))return False,str(e)else:print("Not connected.")return False,"Not connected."def receive_data(self, buffer_size=2048):"""接收数据:param buffer_size::return:"""if self.socket is None:print("Not connected.")returntry:data = self.socket.recv(buffer_size)# print("Data received:", data.decode())return dataexcept bluetooth.BluetoothError as e:print("Failed to receive data:", str(e))@staticmethoddef scan_devices():"""扫描所有蓝牙设备:return:"""devices = bluetooth.discover_devices()print("Scanning devices...")device_list = []for addr in devices:name = bluetooth.lookup_name(addr)print("Found device:", name, "(", addr, ")")device_list.append((addr, name))return device_listif __name__ == '__main__':# print("=========================================开始扫描")# devices = BluetoothDataTransfer.scan_devices()# for device in devices:#     print(device)# print("=========================================结束扫描")# 示例用法bd = BluetoothDataTransfer("FA:34:0A:92:71:42", 'JDY-33-SPP-kkkkkkk')  # 替换为目标设备的蓝牙地址和端口号flag = bd.connect()print(flag)if flag:# bd.send_data("Hello, Bluetooth!")  # 发送数据bd.send_data(b"\x12")  # 发送数据recv_data = bd.receive_data()  # 接收数据print("接收到的数据:", recv_data)bd.disconnect()
Ui_ble_control_widget.py(由QT页面编译而成)
# -*- coding: utf-8 -*-# Form implementation generated from reading ui file 'c:\Users\Windows10\Desktop\02上课代码步骤\小车实战 copy\ui\ble_control_widget.ui'
#
# Created by: PyQt5 UI code generator 5.15.9
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again.  Do not edit this file unless you know what you are doing.from PyQt5 import QtCore, QtGui, QtWidgetsclass Ui_BleControlWidget(object):def setupUi(self, BleControlWidget):BleControlWidget.setObjectName("BleControlWidget")BleControlWidget.resize(411, 276)self.verticalLayout_2 = QtWidgets.QVBoxLayout(BleControlWidget)self.verticalLayout_2.setObjectName("verticalLayout_2")self.setLayout = QtWidgets.QHBoxLayout()self.setLayout.setObjectName("setLayout")self.label = QtWidgets.QLabel(BleControlWidget)font = QtGui.QFont()font.setFamily("Agency FB")font.setPointSize(10)font.setBold(True)font.setWeight(75)self.label.setFont(font)self.label.setObjectName("label")self.setLayout.addWidget(self.label)self.comboBox = QtWidgets.QComboBox(BleControlWidget)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.comboBox.sizePolicy().hasHeightForWidth())self.comboBox.setSizePolicy(sizePolicy)self.comboBox.setMinimumSize(QtCore.QSize(0, 25))self.comboBox.setObjectName("comboBox")self.setLayout.addWidget(self.comboBox)self.refreshBtn = QtWidgets.QPushButton(BleControlWidget)self.refreshBtn.setText("")icon = QtGui.QIcon()icon.addPixmap(QtGui.QPixmap(":/icon/refresh"), QtGui.QIcon.Normal, QtGui.QIcon.Off)self.refreshBtn.setIcon(icon)self.refreshBtn.setFlat(True)self.refreshBtn.setObjectName("refreshBtn")self.setLayout.addWidget(self.refreshBtn)self.connectBtn = QtWidgets.QPushButton(BleControlWidget)icon1 = QtGui.QIcon()icon1.addPixmap(QtGui.QPixmap(":/icon/connect"), QtGui.QIcon.Normal, QtGui.QIcon.Off)self.connectBtn.setIcon(icon1)self.connectBtn.setObjectName("connectBtn")self.setLayout.addWidget(self.connectBtn)self.setLayout.setStretch(0, 1)self.setLayout.setStretch(1, 4)self.setLayout.setStretch(2, 1)self.setLayout.setStretch(3, 2)self.verticalLayout_2.addLayout(self.setLayout)self.frame = QtWidgets.QFrame(BleControlWidget)self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel)self.frame.setFrameShadow(QtWidgets.QFrame.Raised)self.frame.setObjectName("frame")self.verticalLayout = QtWidgets.QVBoxLayout(self.frame)self.verticalLayout.setContentsMargins(0, 0, 0, 0)self.verticalLayout.setSpacing(0)self.verticalLayout.setObjectName("verticalLayout")self.btnLayout = QtWidgets.QGridLayout()self.btnLayout.setSpacing(10)self.btnLayout.setObjectName("btnLayout")self.lightOnBtn = QtWidgets.QPushButton(self.frame)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.lightOnBtn.sizePolicy().hasHeightForWidth())self.lightOnBtn.setSizePolicy(sizePolicy)font = QtGui.QFont()font.setFamily("Agency FB")font.setPointSize(22)self.lightOnBtn.setFont(font)self.lightOnBtn.setObjectName("lightOnBtn")self.btnLayout.addWidget(self.lightOnBtn, 4, 0, 1, 1)self.upBtn = QtWidgets.QPushButton(self.frame)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.upBtn.sizePolicy().hasHeightForWidth())self.upBtn.setSizePolicy(sizePolicy)font = QtGui.QFont()font.setFamily("Agency FB")font.setPointSize(22)self.upBtn.setFont(font)self.upBtn.setObjectName("upBtn")self.btnLayout.addWidget(self.upBtn, 0, 1, 1, 1)self.stopBtn = QtWidgets.QPushButton(self.frame)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.stopBtn.sizePolicy().hasHeightForWidth())self.stopBtn.setSizePolicy(sizePolicy)font = QtGui.QFont()font.setFamily("Agency FB")font.setPointSize(22)self.stopBtn.setFont(font)self.stopBtn.setObjectName("stopBtn")self.btnLayout.addWidget(self.stopBtn, 2, 1, 1, 1)self.leftBtn = QtWidgets.QPushButton(self.frame)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.leftBtn.sizePolicy().hasHeightForWidth())self.leftBtn.setSizePolicy(sizePolicy)font = QtGui.QFont()font.setFamily("Agency FB")font.setPointSize(22)self.leftBtn.setFont(font)self.leftBtn.setObjectName("leftBtn")self.btnLayout.addWidget(self.leftBtn, 2, 0, 1, 1)self.rotateBtn = QtWidgets.QPushButton(self.frame)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.rotateBtn.sizePolicy().hasHeightForWidth())self.rotateBtn.setSizePolicy(sizePolicy)font = QtGui.QFont()font.setFamily("Agency FB")font.setPointSize(22)self.rotateBtn.setFont(font)self.rotateBtn.setObjectName("rotateBtn")self.btnLayout.addWidget(self.rotateBtn, 5, 1, 1, 1)self.downBtn = QtWidgets.QPushButton(self.frame)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.downBtn.sizePolicy().hasHeightForWidth())self.downBtn.setSizePolicy(sizePolicy)font = QtGui.QFont()font.setFamily("Agency FB")font.setPointSize(22)self.downBtn.setFont(font)self.downBtn.setObjectName("downBtn")self.btnLayout.addWidget(self.downBtn, 4, 1, 1, 1)self.lightOffBtn = QtWidgets.QPushButton(self.frame)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.lightOffBtn.sizePolicy().hasHeightForWidth())self.lightOffBtn.setSizePolicy(sizePolicy)font = QtGui.QFont()font.setFamily("Agency FB")font.setPointSize(22)self.lightOffBtn.setFont(font)self.lightOffBtn.setObjectName("lightOffBtn")self.btnLayout.addWidget(self.lightOffBtn, 4, 2, 1, 1)self.trackOffBtn = QtWidgets.QPushButton(self.frame)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.trackOffBtn.sizePolicy().hasHeightForWidth())self.trackOffBtn.setSizePolicy(sizePolicy)font = QtGui.QFont()font.setFamily("Agency FB")font.setPointSize(22)self.trackOffBtn.setFont(font)self.trackOffBtn.setObjectName("trackOffBtn")self.btnLayout.addWidget(self.trackOffBtn, 5, 2, 1, 1)self.trackOnBtn = QtWidgets.QPushButton(self.frame)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.trackOnBtn.sizePolicy().hasHeightForWidth())self.trackOnBtn.setSizePolicy(sizePolicy)font = QtGui.QFont()font.setFamily("Agency FB")font.setPointSize(22)self.trackOnBtn.setFont(font)self.trackOnBtn.setObjectName("trackOnBtn")self.btnLayout.addWidget(self.trackOnBtn, 5, 0, 1, 1)self.rightBtn = QtWidgets.QPushButton(self.frame)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.rightBtn.sizePolicy().hasHeightForWidth())self.rightBtn.setSizePolicy(sizePolicy)font = QtGui.QFont()font.setFamily("Agency FB")font.setPointSize(22)self.rightBtn.setFont(font)self.rightBtn.setObjectName("rightBtn")self.btnLayout.addWidget(self.rightBtn, 2, 2, 1, 1)self.distanceBtn = QtWidgets.QPushButton(self.frame)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.distanceBtn.sizePolicy().hasHeightForWidth())self.distanceBtn.setSizePolicy(sizePolicy)font = QtGui.QFont()font.setFamily("Agency FB")font.setPointSize(22)self.distanceBtn.setFont(font)self.distanceBtn.setObjectName("distanceBtn")self.btnLayout.addWidget(self.distanceBtn, 0, 2, 1, 1)self.buzzerOnBtn = QtWidgets.QPushButton(self.frame)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.buzzerOnBtn.sizePolicy().hasHeightForWidth())self.buzzerOnBtn.setSizePolicy(sizePolicy)font = QtGui.QFont()font.setFamily("Agency FB")font.setPointSize(22)self.buzzerOnBtn.setFont(font)self.buzzerOnBtn.setObjectName("buzzerOnBtn")self.btnLayout.addWidget(self.buzzerOnBtn, 0, 0, 1, 1)self.verticalLayout.addLayout(self.btnLayout)self.verticalLayout_2.addWidget(self.frame)self.verticalLayout_2.setStretch(0, 1)self.verticalLayout_2.setStretch(1, 3)self.retranslateUi(BleControlWidget)QtCore.QMetaObject.connectSlotsByName(BleControlWidget)def retranslateUi(self, BleControlWidget):_translate = QtCore.QCoreApplication.translateBleControlWidget.setWindowTitle(_translate("BleControlWidget", "小车蓝牙控制器"))self.label.setText(_translate("BleControlWidget", "蓝牙选择:"))self.connectBtn.setText(_translate("BleControlWidget", "连接蓝牙"))self.lightOnBtn.setText(_translate("BleControlWidget", "开灯"))self.upBtn.setText(_translate("BleControlWidget", "上"))self.stopBtn.setText(_translate("BleControlWidget", "停止"))self.leftBtn.setText(_translate("BleControlWidget", "左"))self.rotateBtn.setText(_translate("BleControlWidget", "旋转"))self.downBtn.setText(_translate("BleControlWidget", "下"))self.lightOffBtn.setText(_translate("BleControlWidget", "关灯"))self.trackOffBtn.setText(_translate("BleControlWidget", "关寻迹"))self.trackOnBtn.setText(_translate("BleControlWidget", "开寻迹"))self.rightBtn.setText(_translate("BleControlWidget", "右"))self.distanceBtn.setText(_translate("BleControlWidget", "测距"))self.buzzerOnBtn.setText(_translate("BleControlWidget", "开喇叭"))
from ui import resource_rc

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/666446.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

大数据信用报告在线查询平台哪个好?

随着大数据技术在金融风控的运用,大数据信用越来越被人熟知,由于线下没有查询大数据信用的地方,想要查询大数据信用报告只有在线上查询,那大数据信用报告在线查询平台哪个好呢?本文贷你一起去了解市面上比较好的三个平台。 大数据…

【Springcloud篇】学习笔记九(十五、十六章):Cloud Alibaba介绍、Nacos服务注册、服务配置中心

第十五章_Cloud Alibaba简介 1.出现SpringCloud Alibaba的原因 SpringCloud Netflix项目进入维护模式 技术的发展 2.SpringCloud Alibaba简介 2.1是什么 2.2能干嘛 2.3去哪下 阿里巴巴中文文档下载网站: spring-cloud-alibaba/README-zh.md at 2022.x alibaba…

学成在线:采用XXL-JOB任务调度方案使用FFmpeg处理视频转码业务

分片技术方案 概述 XXL-JOB并不直接提供数据处理的功能,它只会给所有注册的执行器分配好分片序号,在向执行器下发任务调度的同时携带分片总数和当前分片序号等参数 设计作业分片方案保证多个执行器之间不会查询到重复的任务,保证任务不会重复执行 任…

由于误删了node依赖,导致这后面的一系列操作

文章目录 1. 事发原因:Delete select files2. Delete select files引起的cross-env报错3. cross-env是node_modules的依赖工具4. 那么Delete selected files到底是什么操作5. 重装node_modules依赖包,也报错6. 报错:cb() never called!7. 算了…

JSR303参数校验-SpringMVC

文章目录 JSR303技术标准简介JSR303标准几个具体实现框架validation-apijakarta.validation-apihibernate-validatorspring-boot-starter-validation Spring Validationjavax.validation.constraints包下提供的注解org.hibernate.validator.constraints包扩展的注解校验注解默认…

内衣洗衣机是不是鸡肋?好用的小型洗衣机全自动推荐

随着大家工作的压力越来越大,下了班之后只能想躺平,在洗完澡之后看着还需要手洗的内衣裤真的很头疼。有些小伙伴还有会攒几天再丢进去洗衣机里面一起,而且这样子是非常不好的,用过的内衣裤长时间不清洗容易滋生细菌,而…

无人机遥感技术在地质灾害监测应用分析,多旋翼无人机应急救援技术探讨

地质灾害是指在地球的发展演变过程中, 由各种自然地质作用和人类活动所形成的灾害性地质事件。给人民的生命和财产安全带来严重威胁,因此有必要开展地质灾害预测预报、灾害应急和风险区划 遥感技术的快速发展为我们提供了一种获取实时灾害信息的可靠手段…

陪女朋友学习计算机二级之数据库笛卡尔积和自然连接

数据库中的基本关系运算 交 和数学中的交集类似,但是需要相同的表模式 如果俩个表有相同的关系模式如表1为(ID,姓名,学号)表2为ID,姓名,学号) 表1 表2 交之后就可以变成 并 和数…

水面漂浮物监测识别摄像机

水面漂浮物监测识别摄像机是一种用于监测水域表面上漂浮物的设备,可以帮助环保部门或海洋研究机构快速发现和识别水中的浮游物,有助于保护水质和生态环境。这种摄像机通常具有以下功能和特点: 高分辨率摄像头:配备高清晰度摄像头&…

【数据分享】1929-2023年全球站点的逐日降雪深度数据(Shp\Excel\免费获取)

气象数据是在各项研究中都经常使用的数据,气象指标包括气温、风速、降水、能见度等指标,说到气象数据,最详细的气象数据是具体到气象监测站点的数据! 之前我们分享过1929-2023年全球气象站点的逐日平均气温数据、逐日最高气温数据…

学习spring第十四天

Spring注解方式整合第三方框架 xml整合MyBatis方式,如下 用注解方式代替xml方式如下 : 在配置类上加上 MapperScan("com.itheima.mapper") MapperScan("com.itheima.mapper") //MyMapperScan 在配置类里写入代码如下 Beanpublic DataSource dataSourc…

风控安全产品系统设计

风控业务架构 我把风控业务架构的分层分为6层,分别是组件层、业务层、决策层、能力层、计算层、可视层。 以下基建为基础安全产品的简称。 组件层 组件层的职责是:数据收集与行为反制。 从接口、设备、行为三个维度进行数据收集,接收决策层的指令进行行为反制。为了保证…

Go语言深度解析:探索 crypto/md5 标准库的强大功能

Go语言深度解析:探索 crypto/md5 标准库的强大功能 引言Go语言和MD5的基础知识MD5算法简介Go语言概述Go中的MD5实现 crypto/md5 库的使用方法基本用法处理大型数据安全注意事项 实际案例分析示例1:文件的MD5校验示例2:网络数据的MD5哈希示例3…

【C++】运算符重载详解

&#x1f497;个人主页&#x1f497; ⭐个人专栏——C学习⭐ &#x1f4ab;点击关注&#x1f929;一起学习C语言&#x1f4af;&#x1f4ab; 目录 导读 1. 为什么需要运算符重载 2. 运算符重载概念 3. 运算符重载示例 3.1 运算符重载 3.2 >或<运算符 4. 运算符重…

面试数据结构与算法总结分类+leetcode目录【基础版】

&#x1f9e1;&#x1f9e1;&#x1f9e1;算法题目总结&#xff1a; 这里为大家总结数据结构与算法的题库目录&#xff0c;如果已经解释过的题目会标注链接更新&#xff0c;方便查看。 数据结构概览 Array & String 大家对这两类肯定比较清楚的&#xff0c;同时这也是面试…

SVDiff: Compact Parameter Space for Diffusion Fine-Tuning——【论文笔记】

本文发表于ICCV 2023 论文地址&#xff1a;ICCV 2023 Open Access Repository (thecvf.com) 官方代码&#xff1a;mkshing/svdiff-pytorch: Implementation of "SVDiff: Compact Parameter Space for Diffusion Fine-Tuning" (github.com) 一、Introduction 最近几…

java反射详解

动态代理 什么是动态代理&#xff1f; 特点&#xff1a;无侵入式的给代码增加额外的功能 对象有什么方法想要被代理&#xff0c;代理就一定要有对应的方法 对象和代理需要实现同一个接口&#xff0c;接口中就是被代理的方法 调用者通过代理&#xff0c;调用代理中的方法&#x…

高级FPGA开发之基础协议PCIe

基础协议之PCIe部分 一、TLP包的包头 在PCIe的系统中&#xff0c;tlp包的包头的结构有许多部分是相似的&#xff0c;通过掌握这些常规的包头&#xff0c;能帮助理解在PCIe总线上各个设备之间如何进行数据的收发。 通用的字段 通用字段作用Fmt决定了包头是3DW还是3DW&#xff…

2V2无人机红蓝对抗仿真

两架红方和蓝方无人机分别从不同位置起飞&#xff0c;蓝方无人机跟踪及击毁红方无人机 2020a可正常运行 2V2无人机红蓝对抗仿真资源-CSDN文库