uniapp 小程序低功耗蓝牙配网 ble配网 物联网
1.获取蓝牙列表 bleList.vue
<template><view><button @touchstart="startSearch">获取蓝牙列表</button><scroll-view :scroll-top="scrollTop" scroll-y class="content-pop"><viewclass="bluetoothItem"v-for="(item, index) in bluetoohList":key="index"@click="openControl(item)"><view class="textItem">蓝牙:{{ item.name }}</view><view>{{ item.deviceId }}</view></view></scroll-view></view>
</template><script>
export default {data() {return {bluetoohList: [],};},onLoad: function (options) {this.startSearch();},methods: {// 连接蓝牙startSearch() {let that = this;that.$ble.openBluetoothAdapter((res) => {that.$ble.getBluetoothAdapterState((res) => {if (res.available) {if (res.discovering) {that.$ble.stopBluetoothDevicesDiscovery();} else {that.getBluetoothDevices();}that.checkPemission();} else {that.$tip.toast("本机蓝牙不可用");}});},(err) => {that.openSetting();});},openSetting() {let params = {title: "检测到您没打开蓝牙权限,是否去设置打开?",showCancel: true,};this.$tip.showModal(params, (res) => {if (res.confirm) {this.$ble.openSetting();}});},checkPemission() {//android 6.0以上需授权地理位置权限var that = this;const sys = uni.getSystemInfoSync();if (sys.platform == "ios") {that.getBluetoothDevices();} else if (sys.platform == "android") {console.log(app.getSystem().substring(app.getSystem().length - (app.getSystem().length - 8),app.getSystem().length - (app.getSystem().length - 8) + 1));if (app.globalData.getSystem().substring(app.globalData.getSystem().length -(app.globalData.getSystem().length - 8),app.globalData.getSystem().length -(app.globalData.getSystem().length - 8) +1) > 5) {uni.getSetting({success: (res) => {console.log(res);if (!res.authSetting["scope.userLocation"]) {uni.authorize({scope: "scope.userLocation",complete: (res) => {that.getBluetoothDevices();},});} else {that.getBluetoothDevices();}},});}}},//获取蓝牙设备信息getBluetoothDevices() {that.$tip.loading("蓝牙搜索中");this.$ble.getBluetoothDevices((res) => {this.bluetoohList = res;this.$tip.loaded();});},// 连接蓝牙 跳转到连接页面openControl(item) {let params = {list: this.bluetoohList,info: item,};this.$tip.redirectTo("/pages/ble/ble", params);},},
};
</script><style scoped>
.content-pop {width: 100vw;max-height: 55vh;padding: 0 30rpx;
}
.bluetoothItem {padding: 20rpx 0;font-weight: 400;font-size: 28rpx;border-bottom: 1rpx solid #f4f4f4;text-align: left;
}
.textItem {display: block;margin-bottom: 10rpx;
}
</style>
2.选择蓝牙进行连接 ble.vue
<script>
export default {data() {return {bluInfo: {},services: [],bleServiceId: "",serviceId: 0,writeCharacter: false,readCharacter: false,notifyCharacter: false,BLEInformation: {serveiceId: "",config_write_char_id: "",cmd_write_char_id: "",config_read_char_id: "",cmd_read_char_id: "",},};},onLoad(option) {// 接收页面传递的数据this.bluInfo = JSON.parse(decodeURIComponent(option.info));this.bluetooh(this.bluInfo.info.deviceId);},methods: {bluetooh(deviceId) {var that = this;that.$ble.stopBluetoothDevicesDiscovery();that.$ble.createBLEConnection(deviceId,(res) => {that.getSeviceId(deviceId);},(err) => {console.log(err);that.bluetoothFail();});},// 连接成功后保存连接状态getSeviceId(deviceId) {var that = this;that.$ble.getBLEDeviceServices(deviceId,(res) => {that.services = res.services;that.bleServiceId = res.services[0].uuid;this.BLEInformation.serveiceId = res.services[0].uuid;that.getCharacteristics(deviceId);},(err) => {console.log(err);that.bluetoothFail();});},getCharacteristics(deviceId) {var that = this;var list = that.services;var num = that.serviceId;var write = that.writeCharacter;var read = that.readCharacter;var notify = that.notifyCharacter;that.$ble.getBLEDeviceCharacteristics(deviceId,that.bleServiceId,(res) => {for (var i = 0; i < res.characteristics.length; ++i) {var properties = res.characteristics[i].properties;if (!notify) {if (properties.notify) {notify = true;}}if (!write) {if (properties.write) {this.BLEInformation.config_write_char_id =res.characteristics[2].uuid;this.BLEInformation.cmd_write_char_id =res.characteristics[0].uuid;write = true;}}if (!read) {if (properties.read) {this.BLEInformation.config_read_char_id =res.characteristics[3].uuid;this.BLEInformation.cmd_read_char_id =res.characteristics[1].uuid;read = true;}}}if (!write || !notify || !read) {num++;(that.writeCharacter = write),(that.readCharacter = read),(that.notifyCharacter = notify),(that.serviceId = num);if (num == list.length) {// console.log("找不到该读写的特征值")that.bluetoothFail();} else {that.getCharacteristics(deviceId);}} else {that.bluetoothSuccess(res);}},(err) => {console.log(err);that.bluetoothFail();});},// 蓝牙连接打印机bluetoothSuccess(res) {uni.setStorageSync("blefiInfo", this.BLEInformation);let params = {title: "连接成功",confirmText: "继续",showCancel: false,};this.$tip.showModal(params, (res) => {if (res.confirm) {// 蓝牙连接成功this.$tip.redirectTo("/pages/ble/bleWifi");}});},bluetoothFail() {// 蓝牙连接失败this.$tip.redirectTo("/pages/ble/bleFail");},},
};
</script><style scoped>
.zai-box {padding: 0;margin: 0;height: 100%;background-color: #fff;
}.container {padding: 30rpx;margin: 0;font-size: 28rpx;color: #20212b;background-color: #fff;text-align: left;font-weight: 400;
}image {width: 362rpx;height: 362rpx;margin-top: 30rpx;
}.textTitle {display: block;font-size: 36rpx;font-weight: bold;color: #20212b;display: block;margin-bottom: 30rpx;
}.textItem {display: block;font-size: 24rpx;font-weight: 400;color: #999999;line-height: 36rpx;
}
</style>
3. 蓝牙连接WiFi bleWifi.vue
<template><view><text>{{ SSID }}</text><input type="text" placeholder="请输入密码" v-model="password" /><button @click="settiing">连接</button></view></template><script>import APToast from "@/util/APToast.js";export default {data() {return {SSID: "your SSID",password: "",connected: true,wifiCountDown: 0,wifiCountInterval: null, // 定时器blefiInfo: {},};},// 二级页面清除onUnload() {this.$ble.offBLEConnectionStateChange();this.clearIntervalWifi();},onLoad(options) {this.blefiInfo = uni.getStorageSync("blefiInfo");let sys = uni.getStorageSync("phoneInfo");if (sys.platform == "android") {// this.$ble.onBLEMTUChange((res) => {// console.log(res, "androidMTU");// });// this.$ble.getBLEMTU(this.blefiInfo.deviceId, (res) => {// console.log(res, "mtu");// });// 安卓要手动更改MTU值const mtu = 512;this.$ble.setBLEMTU(this.blefiInfo.deviceId,mtu,(res) => {console.log(res);},(err) => {console.log(err);});}this.$ble.getBLEDeviceServices(this.blefiInfo.deviceId, (res) => {this.$ble.getBLEDeviceCharacteristics(this.blefiInfo.deviceId,this.blefiInfo.serveiceId,(res) => {this.$ble.notifyBLECharacteristicValueChange(true,this.blefiInfo.deviceId,this.blefiInfo.serveiceId,this.blefiInfo.readCharId,(res) => {console.log("启用notify成功");});});});this.$ble.onBLEConnectionStateChange((res) => {this.connected = res.connected;if (!res.connected) {this.$tip.loaded();// 蓝牙连接失败,跳转到失败页面this.$tip.redirectTo("/pages/ble/bleFail");}});// 接收配网打印机回传的数据this.$ble.onBLECharacteristicValueChange((res) => {if (!res || res.value.byteLength == 0) return;this.clearIntervalWifi();this.$tip.loaded();let num = new Int32Array(res.value)[0];console.log(num, "NUM");// 失败原因let tip = APToast.find((item) => item.id == num);if (num == 0) {// 连接wifi成功this.$tip.redirectTo("/pages/ble/WifiSuccess");} else {// 连接WiFi失败this.$tip.redirectTo("/pages/ble/WifiFile",tip);}});},methods: {settiing() {this.startSMSTimer("60");this.$tip.loading("连接中");if (this.connected) {this.sendWifi();} else {this.$tip.loaded();// 蓝牙连接失败,跳转到失败页面this.$tip.redirectTo("/pages/ble/bleFail");}},// 转UTF-8sendWifi() {let msg = {event: "network",data: { ssid: this.SSID, password: this.password, authmode: 4 },};let buffer = this.stringToUint8Array(JSON.stringify(msg));this.bleSendWifi(buffer);},// json字符串数据转Uint8ArraystringToUint8Array(str) {// 方法一// var arr = [];// for (var i = 0, j = str.length; i < j; ++i) {// arr.push(str.charCodeAt(i));// }// var tmpUint8Array = new Uint8Array(arr);// return tmpUint8Array.buffer;// 方法二let buffer = new ArrayBuffer(str.length);let dataView = new DataView(buffer);for (var i = 0; i < str.length; i++) {dataView.setUint8(i, str.charCodeAt(i));}return buffer;},bleSendWifi(payload) {if (this.connected) {this.$ble.writeBLECharacteristicValueOnce(this.blefiInfo.deviceId,this.blefiInfo.serveiceId,this.blefiInfo.writecharId,payload);if (this.blefiInfo.readCharId) {this.$ble.readBLECharacteristicValue(this.blefiInfo.deviceId,this.blefiInfo.serveiceId,this.blefiInfo.readCharId);}}},startSMSTimer(val) {this.wifiCountDown = val;this.wifiCountInterval = setInterval(() => {this.wifiCountDown--;// console.log(this.wifiCountDown);if (this.wifiCountDown <= 0) {clearInterval(this.wifiCountInterval);this.wifiCountInterval = null;this.$tip.loaded();// 连接WiFi失败this.$tip.redirectTo("/pages/ble/WifiFile");}}, 1000);},clearIntervalWifi() {this.wifiCountDown = 0;if (this.wifiCountInterval) {clearInterval(this.wifiCountInterval);this.wifiCountInterval = null;}},},};</script>
4. 手机连接蓝牙失败、蓝牙连接WiFi成功/失败(关闭蓝牙连接)
<script>
export default {onLoad() {// 使用完成后在合适的时机断开连接和关闭蓝牙适配器this.$ble.closeBLEConnection(this.deviceId);this.$ble.closeBluetoothAdapter();},
};
</script>
5.ble.js
class ble {openBluetoothAdapter(success, failure) {uni.openBluetoothAdapter({success: (res) => {success(res);},fail: (err) => {failure(err);},});}getBluetoothAdapterState(success) {uni.getBluetoothAdapterState({success: (res) => {success(res);},});}//停止搜寻附近的蓝牙外围设备stopBluetoothDevicesDiscovery() {uni.stopBluetoothDevicesDiscovery();}//获取蓝牙设备信息getBluetoothDevices(success) {// 开始搜寻附近的蓝牙外围设备uni.startBluetoothDevicesDiscovery({success: (res) => {setTimeout(() => {// 获取搜索到的设备信息uni.getBluetoothDevices({success: (res) => {let bluetoohList = [];var num = 0;for (var i = 0; i < res.devices.length; ++i) {if (res.devices[i].name != "未知设备") {bluetoohList[num] = res.devices[i];num++;}}this.stopBluetoothDevicesDiscovery();success(bluetoohList);},});}, 5000);// that.onBluetoothDeviceFound();},});}openSetting() {uni.openSetting({//opensetting是调起设置页面的success: (res) => {if (res.authSetting == true) {//判断res.authsetting的值是true还是falseuni.openBluetoothAdapter();}},});}//断开与低功耗蓝牙设备的连接closeBLEConnection(deviceId) {uni.closeBLEConnection({deviceId: deviceId,});}offBLEConnectionStateChange() {wx.offBLEConnectionStateChange();}//连接低功耗蓝牙设备createBLEConnection(deviceId, success, failure) {uni.createBLEConnection({deviceId: deviceId,success: (res) => {success(res);},fail: (err) => {failure(err);},});}//获取蓝牙设备所有服务getBLEDeviceServices(deviceId, success, failure) {wx.getBLEDeviceServices({deviceId: deviceId,success: (res) => {success(res);},fail(err) {failure(err);},});}//获取蓝牙设备某个服务中所有特征值getBLEDeviceCharacteristics(deviceId, serviceId, success, failure) {wx.getBLEDeviceCharacteristics({deviceId: deviceId,serviceId: serviceId,success: (res) => {success(res);},fail(err) {failure(err);},});}notifyBLECharacteristicValueChange(state,deviceId,serviceId,characteristicId,success) {wx.notifyBLECharacteristicValueChange({state: state,deviceId: deviceId,serviceId: serviceId,characteristicId: characteristicId,success: function (res) {success(res);},});}onBLEConnectionStateChange(success) {wx.onBLEConnectionStateChange((res) => {success(res);});}// 接收配网打印机回传的数据onBLECharacteristicValueChange(success) {wx.onBLECharacteristicValueChange((res) => {success(res);});}//关闭蓝牙模块closeBluetoothAdapter() {wx.closeBluetoothAdapter();}// 不分包写入蓝牙writeBLECharacteristicValueOnce(deviceId,serviceId,characteristicId,value) {wx.writeBLECharacteristicValue({deviceId: deviceId,serviceId: serviceId,characteristicId: characteristicId,value: value,});}readBLECharacteristicValue(deviceId, serviceId, characteristicId) {wx.readBLECharacteristicValue({deviceId: deviceId,serviceId: serviceId,characteristicId: characteristicId,});}getBLEMTU(deviceId, success) {wx.getBLEMTU({deviceId: deviceId,writeType: "write",success(res) {success(res.mtu);},});}onBLEMTUChange(success) {wx.onBLEMTUChange(function (res) {success(res.mtu);});}setBLEMTU(deviceId, mtu, success, failure) {wx.setBLEMTU({deviceId: deviceId,mtu: mtu,success: (res) => {success(res);},fail: (res) => {failure(res);},});}
}
const bleDevice = new ble();
export default bleDevice;
6.APToast.js
const message = [{id:0,type:"WIFI_REASON_SUCCESS",message:"打印机连接成功"},{id:2,type:"WIFI_REASON_AUTH_EXPIRE",message:"身份验证超时"},{id:3,type:"WIFI_REASON_AUTH_LEAVE",message:"连接中断"},{id:8,type:"WIFI_REASON_ASSOC_LEAVE",message:"连接中断"},{id:15,type:"WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT",message:"密码错误"},{id:201,type:"WIFI_REASON_NO_AP_FOUND",message:"未找到可用的网络"},{id:202,type:"WIFI_REASON_AUTH_FAIL",message:"密码错误或身份验证超时"},{id:203,type:"WIFI_REASON_ASSOC_FAIL",message:"设备无法与WiFi成功关联"},{id:204,type:"WIFI_REASON_HANDSHAKE_TIMEOUT",message:"密码错误"},{id:205,type:"WIFI_REASON_CONNECTION_FAIL",message:"连接失败"},
]export default message;
7.tip.js
export default class Tips { /*** 弹出提示框*/static success(title, duration = 1000) {setTimeout(() => {uni.showToast({title: title,icon: "success",mask: true,duration: duration,});}, 300);if (duration > 0) {return new Promise((resolve, reject) => {setTimeout(() => {resolve();}, duration);});}}/*** 弹出加载提示*/static loading(title = "加载中") {if (Tips.isLoading) {return;}Tips.isLoading = true;uni.showLoading({title: title,mask: true,});}/*** 加载完毕*/static loaded() {if (Tips.isLoading) {Tips.isLoading = false;uni.hideLoading();}}/*** 关闭当前页面,跳转到新页面*/static redirectTo(urls, item) {uni.redirectTo({url: item? urls + "?info=" + encodeURIComponent(JSON.stringify(item)): urls, // JSON.parse(decodeURIComponent(option.info));});}/*** 弹出确认窗口*/static showModal(val, success) {uni.showModal({title: val.title ? val.title : "",content: val.content ? val.content : "",showCancel: val.showCancel,confirmText: val.confirmText ? val.confirmText : "确定",cancelText: val.cancelText ? val.cancelText : "取消",cancelColor: "#999999", //取消按钮颜色confirmColor: "#00A0E9", //确定按钮颜色success: (res) => {success(res);},});}
}/*** 静态变量,是否加载中*/
Tips.isLoading = false;
8.main.js
import ble from "./common/util/ble.js";
import tip from "./common/util/tip.js";// ble
Vue.prototype.$ble = ble;
// tip
Vue.prototype.$tip = tip;
相关文章:

uniapp 小程序低功耗蓝牙配网 ble配网 物联网
1.获取蓝牙列表 bleList.vue <template><view><button touchstart"startSearch">获取蓝牙列表</button><scroll-view :scroll-top"scrollTop" scroll-y class"content-pop"><viewclass"bluetoothItem&q…...

服务器防火墙有什么用防护策略
随着互联网的飞速发展,服务器的安全问题日益凸显。为了保护服务器免受网络攻击和恶意入侵的威胁,人们引入了防火墙的概念。服务器防火墙作为保护服务器的第一道防线,具有重要的作用。那么服务器防火墙有什么用? 首先,服…...

27.哀家要长脑子了!
目录 1.316. 去除重复字母 - 力扣(LeetCode) 2. 1209. 删除字符串中的所有相邻重复项 II - 力扣(LeetCode 哎哟 烦死了 刚刚不小心退出又没保存 又要写一遍 烦死了 最近刷题不得劲啊 感觉这脑子没长一点 1.316. 去除重复字母 - 力扣&am…...

Redis实战—验证码登录注册
目录 基于Session Controller层 Service层 ServiceImpl层 编辑校验登录状态 ThreadLocal 登录拦截器 添加拦截器到Config Controller层实现 基于Redis ServiceImpl 新增刷新拦截器 添加拦截器到Config 基于Session Controller层 /*** 发送手机验证码*/PostMappi…...

对话机器人技术解说
一、RAG介绍 如何不通过微调模型来提高LLM性能,检索增强生成(RAG)是未来的发展方向。 Embedding:将文档的句子或单词块转换为数字向量。就向量之间的距离而言,彼此相似的句子应该很近,而不同的句子应该离…...

红黑树底层封装map、set C++
目录 一、框架思考 三个问题 问题1的解决 问题2的解决: 问题3的解决: 二、泛型编程 1、仿函数的泛型编程 2、迭代器的泛型编程 3、typename: 4、/--重载 三、原码 红黑树 map set 一、框架思考 map和set都是使用红黑树底层&…...

压力给到 Google,OpenAI 发布 GPT-4o 来了
北京时间5月14日凌晨1点,OpenAI 开启了今年的第一次直播,根据官方消息,这次旨在演示 ChatGPT 和 GPT-4 的升级内容。在早些时候 Sam Altman 在 X 上已经明确,「我们一直在努力开发一些我们认为人们会喜欢的新东西,对我…...

【SpringSecurity源码】过滤器链加载流程
theme: smartblue highlight: a11y-dark 一、前言及准备 1.1 SpringSecurity过滤器链简单介绍 在Spring Security中,过滤器链(Filter Chain)是由多个过滤器(Filter)组成的,这些过滤器按照一定的顺序对进…...

第9章.Keil5-MDK软件简介
目录 0. 《STM32单片机自学教程》专栏 9.1 主界面 9.2 文本格式编辑 9.3 代码提示&语法检测&代码模版 9.4 其他小技巧 9.4.1 TAB 键的妙用 9.4.2 快速定位函数/变量被定义的地方 9.4.3 快速注释与快速消注释 9.4.4 快速打开头文件 9.4.5 查找替换…...

mysql中utf8字符集中文字节长度统计如何统计到2个字节一个汉字
在 MySQL 的 utf8 字符集中(也被称为 utf8mb3),中文字符实际上并不是用2个字节来表示的,而是使用3个字节。这是 UTF-8 编码的一个特性,它使用1到4个字节来表示一个字符,具体取决于字符的 Unicode 码点。 对…...

如何实现Linux双网卡同时连接内网和外网的配置?
博主猫头虎的技术世界 🌟 欢迎来到猫头虎的博客 — 探索技术的无限可能! 专栏链接: 🔗 精选专栏: 《面试题大全》 — 面试准备的宝典!《IDEA开发秘籍》 — 提升你的IDEA技能!《100天精通鸿蒙》 …...

ASCLL码表以及字符的相加减
ASCLL码表完整版及解释_acssll码-CSDN博客 #include <getopt.h> #include <stdio.h> #include <stdlib.h>#define MAX_PATH 256 char filename[MAX_PATH 5];int isdigit(int c) {if (c > 0 && c < 9)return 1;return 0; }int main(int argc…...

一键修复所有dll缺失,教大家解决丢失的dll文件
修复所有DLL(动态链接库)文件缺失的问题通常不可能通过单一的"一键修复"按钮来实现,因为DLL文件缺失可能由各种不同的原因导致,比如应用程序安装不正确、病毒感染、或系统文件损坏等。 使用内置的系统文件检查器&#x…...

wsl2安装rancher并导入和创建k8s集群
环境准备 安装wsl2点击此文]ubuntu20.04安装docker 点击此文,安装完成后docker镜像仓库改成阿里云镜像加速地址.如果不熟请点击此文 docker 安装rancher 启动wsl,根据官方文档以root身份执行 sudo docker run -d --restartunless-stopped -p 80:80 -p 443:443 --privileged …...

内网环境ubuntu设置静态ip、DNS、路由,不影响网络访问
内网环境通常是有线的,通过服务器的ip、mac、dns地址访问网络才生效的,如果ip地址变了,就不能访问网络了。 如果你的ip地址变了,或者要防止ip变更影响网络访问,就要设置 1、依次点击右上角的电源-设置,在打…...

学习前端第三十七天(静态属性静态方法、类检查、错误处理)
一、静态属性和静态方法 1、静态属性静态方法 在属性和方法前加上static,创建属于类自己的属性和方法 class Person {// 加static,属于类自己的static name "xc"; // 类的name属性static height 183; // 类的height属性static age 20;…...

全网最全的基于电机控制的38类simulink仿真全家桶----新手大礼包
整理了基于电机的38种simulink仿真全家桶,包含多种资料,类型齐全十分适合新手学习使用。包括但是不局限于以下: 1、基于多电平逆变器的无刷直流电机驱动simulink仿真 2、基于负载转矩的感应电机速度控制simulink仿真 3、基于滑膜观测器的永…...

Python使用asyncio包实现异步编程
1. 异步编程 异步编程是一种编程范式,用于处理程序中需要等待异步操作完成后才能继续执行的情况。异步编程允许程序在执行耗时的操作时不被阻塞,而是在等待操作完成时继续执行其他任务。这对于处理诸如文件 I/O、网络请求、定时器等需要等待的操作非常有…...

获取文件夹下的vue文件形成组件,require.context
前言:项目中现有一个文件里面包含所有需要用到的组件,如果一个个的去import,则会非常麻烦,现有require.context去实现, 1、require.context var request require.context(‘./module’, true, /.js$/) require.cont…...

2024软件测试必问的常见面试题1000问!
01、您所熟悉的测试用例设计方法都有哪些?请分别以具体的例子来说明这些方法在测试用例设计工作中的应用。 答:有黑盒和白盒两种测试种类,黑盒有等价类划分法,边界分析法,因果图法和错误猜测法。白盒有逻辑覆盖法&…...

C++列表实现
文章目录 一、listView相关内容主要思想实例全部代码 二、QTreeView 一、listView 相关内容 QAbstractItemModel:一个抽象的类,为数据项模型提供抽象的接口,常见的的数据模型列如:QStringListModel,QStandardItemMode,QDirModel…...

论文合集整理推荐2024.5.15
2012年论文合集:论文入口 2019年论文合集:论文入口 2022年论文合集:论文入口 2023年论文合集:论文入口 2024年论文合集:论文入口...

JavaScript的跳转传参方式
在JavaScript中,页面跳转并传递参数通常可以通过几种不同的方式来实现。下面是一些常见的方法: 1.URL参数(Query String) 这是最常见的方式,通过在URL的末尾添加参数来实现。例如: javascriptwindow.loc…...

非阻塞模式下的读写操作
实现文件IO的非阻塞模式的读写操作 fcntl函数 功能: #include <unistd.h> #include <fcntl.h> int fcntl(int fd, int cmd, ... /* arg */ ); // arg表示可变参数,由cmd决定 fcntl()对打开的文件描述符fd执行下面描述的操作之一。操作由cmd决…...

Google Ads谷歌广告账户被封停怎么办?
跨境出海业务少不了需要做Google Ads推广业务;其中让投手们闻风丧胆的消息就是帐户被暂停。当 Google 检测到任何违反其政策且可能损害用户在线体验的行为时,就会发生这种情况。那么如何在做广告推广的同时,保证账号不被封禁呢?看…...

AI大模型探索之路-训练篇23:ChatGLM3微调实战-基于P-Tuning V2技术的实践指南
系列篇章💥 AI大模型探索之路-训练篇1:大语言模型微调基础认知 AI大模型探索之路-训练篇2:大语言模型预训练基础认知 AI大模型探索之路-训练篇3:大语言模型全景解读 AI大模型探索之路-训练篇4:大语言模型训练数据集概…...

掌握核心概念:Java高级面试难题精解(一)
Java 高级面试问题及答案 问题1: 在Java中,什么是泛型擦除?为什么需要它? 答案: 泛型擦除是Java编译器的一个特性,它在运行时移除泛型类型信息,以确保类型安全。Java的泛型是在J2SE 1.5中引入的ÿ…...

Nagle算法
Nagle算法简介 Nagle算法主要是避免发送小的数据包,要求TCP连接上最多只能有一个未被确认的小分组,在该分组的确认到达之前不能发送其他的小分组。 在默认的情况下,Nagle算法是默认开启的,Nagle算法比较适用于发送方发送大批量的小数据&…...

MPLS小实验
实验图: 实验要求: 要求使用MPLS技术,将实验通,并在实验结束后使用命令:tracert -v -a 看是否基于标签进行转发。 如上:在每台路由器上都有两个环回,一个用于模拟用户网段,一个用于M…...

MongoDB聚合运算符:$week
MongoDB聚合运算符:$week 文章目录 MongoDB聚合运算符:$week语法使用举例 $week聚合运算符返回指定日期日期为一年中第几周的数字值为0到53之间。周从周日开始,第1周从一年的第一个周日开始。一年中第一个星期日之前的日期为第0周。这和 str…...