高德地图——轨迹回放和电子围栏

image.png

功能点

  • 地图的初始化
  • 显示电子围栏(先初始化在调接口显示电子围栏)
  • 显示定位
  • 显示轨迹
  • 轨迹回放 (回放速度无法控制是因为高德地图的版本问题,不要设置版本,使用默认的即可生效)
  • 获取当前城市及天气情况
  • 设置地图样式
  • 坐标拾取器

重点

  • 默认当前城市

1710834347993.png

  • 地图加载完成的生命周期
 this.map.on('complete', () => {})
  • 清除地图上所有图形(若不想清除电子围栏,可以全部清除后重新显示电子围栏)
this.map.clearMap();
  • 自动适配到合适视野范围(无参数,默认包括所有覆盖物的情况)
this.map.setFitView();
  • 设置地图中心点
  • 下拉框和时间选择框样式的修改

image.png

image.png

this.map.setCenter([point.longitude, point.latitude]); 
<template><div class="w100 h100 white relative"><!-- 地图区域 --><div id="container" class="w100 h100"></div><!-- 搜索框 --><div class="absolute" style="left: .2rem; top: .5rem;z-index: 9; "><div class="bg-com white pdRem-20 sizeRem-30"><div class="bold w100"><div class="item pdRem-20">正在监测人员:共{{ olderArr.length }}</div><div class="item pdRem-20">护理院<el-select v-model="info.orgId" class="w100 mtRem-20" @change="changeOrgId" :popper-append-to-body="false":teleported="false"><el-option v-for="item in roomArr" :key="item.id" :label="item.label" :value="item.id"></el-option></el-select></div><div class="item pdRem-20">老人姓名<el-select v-model="info.syncUserId" class="w100 mtRem-20" filterable :filter-method="remoteMethod":popper-append-to-body="false" :teleported="false"><el-option v-for="item in olderArr" :key="item.syncUserId" :label="item.userName":value="item.syncUserId"></el-option></el-select></div><div class="item pdRem-20"><div class="mbRem-20">开始时间</div><el-date-picker v-model="info.dateRange" @change="handleDateRange" style="width: 100%;" type="datetimerange"range-separator="" start-placeholder="开始日期" end-placeholder="结束日期" align="right"popper-class="popperClass-my" class="picker" :popper-append-to-body="false"></el-date-picker></div><div class="item pdRem-20"><el-tag class="btn-time" @click="getTime(0)">当天</el-tag><el-tag class="btn-time mlrRem-20" @click="getTime(3)">3</el-tag><el-tag class="btn-time" @click="getTime(7)">7</el-tag></div></div><!-- 按钮 --><div class="center mtRem-80"><el-button size="medium" class="block btn-bg" @click="submit(1)">实时定位</el-button><el-button size="medium" class="block mlRem-40 btn-bg" @click="submit(2)">轨迹回放</el-button></div></div></div><!-- 告警 --><div class="absolute" style="right: 1.5rem; top: .5rem;z-index: 9; "><div v-for="(alarmInfo, index) in alarmList" :key="index" class="item-bg pdRem-30 sizeRem-26"><div class="flex_r"><el-tag type="warning" effect="dark" size="mini">{{ alarmInfo.alarmLevelName }}</el-tag></div><div class="flex1"><div style="width: 90%;"><div class="">{{ alarmInfo.alarmContent }}</div></div><div style="width:10%"><img :src="require('./components/img/alarm-icon.png')" alt="" style="width:0.4rem;height: 0.4rem;"></div></div></div></div></div>
</template><script>
import { selectCompanyList, userInfoList, fenceList, userLocation, trajectory } from './components/js/api'import AMapLoader from '@amap/amap-jsapi-loader';
import redIcon from "./components/img/point-red1.png";
import originIcon from "./components/img/origin.png";
import endIcon from "./components/img/end.png";
import olderManIcon from "./components/img/olderMan.png";
window._AMapSecurityConfig = {securityJsCode: "bc0077d71423eedb1d25df186610f740",
};
export default {props: ['alarmList'], //告警列表data() {return {isOrgId: true, //true是卫健委账号  fase机构账号map: null,trackLineArr: [],fenceArr: [], //电子围栏数据// 搜索框num: 0,info: {orgId: '',syncUserId: '',dateRange: [],},roomArr: [],//护理院-下拉olderArr: [],//老人-下拉olderArrCopy: [],//老人-下拉}},watch: {"info.dateRange"(newVal) {if (newVal == null) {this.info.dateRange = [];}},},mounted() {console.log('mounted', 33333333333)this.isOrgId = localStorage.getItem("isOrgId") == 'true' ? true : false;this.initAMap();},beforeDestroy() {this.map.destroy();},methods: {// 机构改变changeOrgId() {console.log('changeOrgId', this.info.orgId)// 老人下拉userInfoList({orgId: this.info.orgId}).then(res => {this.olderArr = res.data;this.olderArrCopy = res.data;this.$set(this.info, 'syncUserId', res.data.length ? res.data[0].syncUserId : '')})// 电子围栏fenceList({orgId: this.info.orgId}).then(res => {console.log('电子围栏', res.rows)this.fenceArr = res.rows;this.getFenceInfoList(res.rows)})},remoteMethod(query) {if (query) {console.log('query', query)this.olderArr = this.olderArrCopy.filter(item => {console.log(item.userNamePingYin.includes(query), '999', item.userNamePingYin);return item.userNamePingYin.toLowerCase().includes(query.toLowerCase()) || item.userName.includes(query);});} else {this.olderArr = this.olderArrCopy;}},formatDate(date) {const year = date.getFullYear();const month = String(date.getMonth() + 1).padStart(2, '0');const day = String(date.getDate()).padStart(2, '0');const hours = String(date.getHours()).padStart(2, '0');const minutes = String(date.getMinutes()).padStart(2, '0');const seconds = String(date.getSeconds()).padStart(2, '0');return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;},getTime(day) {this.info.dateRange = ['', '']const now = new Date();const startOfDay = new Date(now.getFullYear(), now.getMonth(), now.getDate())this.info.dateRange[1] = now;this.info.dateRange[0] = day == 0 ? startOfDay : new Date(now.getTime() - day * 24 * 60 * 60 * 1000);},// 时间段筛选handleDateRange() {if (this.info.dateRange) {const minDate = new Date(this.info.dateRange[0]).getTime();const maxDate = new Date(this.info.dateRange[1]).getTime();if (maxDate - minDate > 7 * 24 * 60 * 60 * 1000) {this.msgError("选择的时间范围不能超过7天");// 清空日期范围选择器this.info.dateRange = [];}} else {this.info.dateRange = [];}},submit(type) {//1实时定位 2轨迹回放console.log(type, this.info, 999);if (type == 1) {if (!this.info.syncUserId) {this.msgError('请选择老人');} else {userLocation({syncUserId: this.info.syncUserId,}).then(res => {this.createMarker(res.data)})}} else {if (!this.info.syncUserId) {this.msgError('请选择老人');} else if (this.info.dateRange.length == 0) {this.msgError('请选择时间');} else {trajectory({syncUserId: this.info.syncUserId,startTime: this.formatDate(this.info.dateRange[0]),endTime: this.formatDate(this.info.dateRange[1]),}).then(res => {if (res.data.length == 0) {this.msgError('未查询到轨迹数据');} else {this.handleTrack(2, res)// setTimeout(() => {//   this.handleTrack(2, res)// }, 2000)}})}}},// 地图initAMap() {AMapLoader.load({key: "d3e34dd987d36d98958ea35f97303089", // 申请好的Web端开发者Key,首次调用 load 时必填// version: "v1.4.15", // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15plugins: ["AMap.ControlBar","AMap.ToolBar",'AMap.Weather','AMap.CitySearch','AMap.Marker',"AMap.MouseTool","AMap.PolyEditor","AMap.Driving","AMap.Polyline","AMap.Geolocation","AMap.GraspRoad","AMap.Geocoder","AMap.GeometryUtil.ringArea","AMap.DistrictSearch","AMap.MoveAnimation",], // 需要使用的的插件列表,如比例尺'AMap.Scale'等}).then((AMap) => {this.map = new AMap.Map("container", {// 设置地图容器idrotateEnable: true,pitchEnable: true,zoom: 17,pitch: 50,rotation: -15,viewMode: '3D', //开启3D视图,默认为关闭zooms: [2, 20],center: [116.930096, 34.758164],mapStyle: "amap://styles/blue", //设置地图的显示样式});// 工具条var controlBar = new AMap.ControlBar({position: {right: '10px',top: '10px'}});this.map.addControl(controlBar)// var toolBar = new AMap.ToolBar({//   position: {//     right: '40px',//     top: '110px'//   }// });// this.map.addControl(toolBar)this.map.on('complete', () => {let idObj = JSON.parse(localStorage.getItem('formJx'))// 机构下拉selectCompanyList({orgId: this.isOrgId ? '-1' : idObj.orgId,groupId: idObj.groupId,}).then(res => {this.roomArr = res.data;this.$set(this.info, 'orgId', res.data[0].id)this.changeOrgId()})})}).catch((e) => {console.log(e);});},// 获取当前定位城市——获取天气getWeather() {const city = new AMap.CitySearch()city.getLocalCity((status, result) => {if (status === 'complete' && result.info === 'OK') {console.log('当前城市:', result.city);// 天气// 创建天气实例const weather = new AMap.Weather();// 获取指定城市(例如:北京)的实时天气weather.getLive(result.city, (error, data) => {if (error) {console.error('获取天气失败:', error);} else {console.log('实时天气数据:', data, `天气${data.weather} 温度${data.temperature}℃ 风向${data.windDirection}`);this.$emit('getWeather', `天气${data.weather} 温度${data.temperature}℃ 风向${data.windDirection}`)// 数据结构中通常包含如下信息// data.city: 城市名称// data.weather: 天气状况描述// data.temperature: 温度// data.windDirection: 风向// data.windPower: 风力等级等其他气象参数}});} else {console.error('获取当前城市失败:', result.info);}});},// 创建两个点标记createMarker(arr = []) {if (arr.length != 0) {// 清除地图上所有图形this.map.clearMap();this.getFenceInfoList(this.fenceArr)arr.map((item) => {var marker = new AMap.Marker({position: new AMap.LngLat(item.longitude, item.latitude),icon: new AMap.Icon({image: redIcon,imageSize: new AMap.Size(28, 28),}),// offset: new AMap.Pixel(-13, -30),// label: {//   content: "<div class='infos'>张三</div>",//   direction: 'bottom' //文本标注方位 可选值:'top'|'right'|'bottom'|'left'|'center',默认值: 'right'// }});this.map.add(marker);});//自动适配到合适视野范围//无参数,默认包括所有覆盖物的情况this.map.setFitView();} else {this.msgError('未有相关定位消息');}},//获取接口返回的电子围栏数据getFenceInfoList(arr = []) {if (arr.length == 0) {// 清除地图上所有图形this.map.clearMap();// 使用 setCenter 方法将地图中心移动到新的位置let point = this.roomArr.filter(item => item.id == this.info.orgId)[0]console.log(point, this.roomArr, 99999999999)// 设置地图中心点this.map.setCenter([point.longitude, point.latitude]);return;}let arr1 = [];for (let i = 0; i < arr.length; i++) {if (arr[i].fenceType == 0) {if (arr[i].useFence) {arr1.push({radius: arr[i].radius,center: arr[i].point,fillColor: "#16d46b",fillOpacity: 0.35,strokeColor: "#16d46b",strokeOpacity: 0.8,strokeStyle: "solid",zIndex: 10,});} else {arr1.push({radius: arr[i].radius,center: arr[i].point,fillColor: "#1791fc",fillOpacity: 0.5,strokeStyle: "solid",strokeColor: "#FF33FF",strokeOpacity: 0.8,zIndex: 10,});}} else if (arr[i].fenceType == 1) {if (arr[i].useFence) {arr1.push({path: arr[i].optimal,fillColor: "#16d46b",fillOpacity: 0.35,strokeColor: "#16d46b",strokeOpacity: 0.8,strokeStyle: "solid",zIndex: 10,});} else {arr1.push({path: arr[i].optimal,fillColor: "#1791fc",fillOpacity: 0.5,strokeColor: "#FF33FF",strokeOpacity: 0.8,strokeStyle: "solid",zIndex: 10,});}} else {for (let j = 0; j < arr[i].optimal.length; j++) {if (arr[i].useFence) {arr1.push({path: arr[i].optimal[j],fillColor: "#16d46b",fillOpacity: 0.35,strokeColor: "#16d46b",strokeOpacity: 0.8,strokeStyle: "solid",zIndex: 10,});} else {arr1.push({path: arr[i].optimal[j],fillColor: "#1791fc",fillOpacity: 0.5,strokeColor: "#FF33FF",strokeOpacity: 0.8,strokeStyle: "solid",zIndex: 10,});}}}}this.handleDrawPolygon(arr1);},// 获取接口返回的绘制图形handleDrawPolygon(data) {for (let i = 0; i < data.length; i++) {let polygon = null;if (data[i].radius) {polygon = new AMap.Circle(data[i]);} else {polygon = new AMap.Polygon(data[i]);}this.map.add(polygon);// 定位到绘制图形的位置this.map.setFitView();}},// type 1查询轨迹 2轨迹播放handleTrack(type, res) {// 清除地图上所有图形this.map.clearMap();this.getFenceInfoList(this.fenceArr)this.trackLineArr = res.data.map(item => {return {x: parseFloat(item.longitude),y: parseFloat(item.latitude),createTime: item.createTime,address: item.address,sp: 0,ag: 0,tm: 6}});// console.log(444, '接口获取的数据', this.trackLineArr)let lineArr = res.data.map(item => [item.longitude, item.latitude])this.handleGraspRoad(lineArr, type)},// 轨迹纠偏(因为最多只能纠偏500个点,所以只能采用循环方式进行处理)handleGraspRoad(graspArr, type) {// 起点let marker1 = null;marker1 = new AMap.Marker({map: this.map,position: graspArr[0],icon: new AMap.Icon({image: originIcon,size: new AMap.Size(48, 48), //图标大小imageSize: new AMap.Size(32, 32),}),offset: new AMap.Pixel(-13, -26),});marker1.setMap(this.map);// 终点let marker2 = null;marker2 = new AMap.Marker({map: this.map,position: graspArr[graspArr.length - 1],icon: new AMap.Icon({image: endIcon,size: new AMap.Size(48, 48), //图标大小imageSize: new AMap.Size(32, 32),}),offset: new AMap.Pixel(-13, -26),});// 定位到指定位置this.map.setFitView();marker2.setMap(this.map);//查询轨迹if (type == 1) {console.log(666, '轨迹的坐标点', graspArr)// 绘制轨迹(轨迹纠偏)const polyline = new AMap.Polyline({map: this.map,path: graspArr,showDir: true,strokeColor: "red", //线颜色// strokeOpacity: 1,     //线透明度strokeWeight: 6, //线宽});} else {//轨迹播放var markerSign = new AMap.Marker({map: this.map,position: graspArr[0],icon: new AMap.Icon({image: olderManIcon,size: new AMap.Size(48, 48), //图标大小imageSize: new AMap.Size(44, 44),}),// icon: "https://webapi.amap.com/images/car.png",offset: new AMap.Pixel(-13, -26),autoRotation: true,angle: -90,});// 绘制轨迹(轨迹纠偏)const polyline = new AMap.Polyline({map: this.map,path: graspArr,showDir: true,strokeColor: "#28F", //线颜色strokeOpacity: 1,     //线透明度strokeWeight: 6, //线宽});// 轨迹路线样式const passedPolyline = new AMap.Polyline({map: this.map,strokeColor: "#68d068", //线颜色strokeOpacity: 1,     //线透明度strokeWeight: 6, //线宽strokeStyle: "solid"  //线样式});markerSign.on("moving", function (e) {passedPolyline.setPath(e.passedPath);// this.map.setCenter(e.target.getPosition(), true);});this.map.setFitView();setTimeout(() => {markerSign.moveAlong(graspArr, 300);}, 1000);// markerSign.moveAlong(graspArr, {//   // 每一段的时长//   duration: 200, //可根据实际采集时间间隔设置//   // JSAPI2.0 是否延道路自动设置角度在 moveAlong 里设置//   // autoRotation: true,// });}},},
}
</script>
<style lang="scss">
// 修改时间选择框的样式,不能加scoped
.popperClass-my {border: 1px solid #66729b;background-color: rgba(0, 0, 0, 0.7);color: white;.el-date-range-picker__content.is-left,.el-picker-panel__content .el-date-range-picker__content .is-left,.el-picker-panel__content .el-date-range-picker__content .is-right,.el-date-range-picker__time-header,.el-date-range-picker__time-picker-wrap,.el-input__inner,.el-picker-panel__footer,.el-time-panel .el-popper,.el-button,.el-time-spinner,.el-time-spinner__item,.el-time-panel .el-popper {border: 0;}.el-time-spinner,.el-picker-panel__footer,.el-time-spinner__item {background: rgba(0, 0, 0, 0.7);// border: 0;// color: white;}.is-disabled .el-input__inner {background: rgba(0, 20, 38, 1);color: white;}.el-input__inner {background: rgba(0, 20, 38, 1);color: white;// 点日期-时间框}.el-time-panel__footer {background: rgba(0, 20, 38, 1);border: 0;}ul.el-scrollbar_view.el-time-spinner_list::before {background: rgba(0, 20, 38, 1);}// 选中日期.available.in-range div {background-color: black;color: white;}.available.in-range div:hover {background-color: black;color: white;}.el-button,.el-button.is-plain:hover {color: white;background: rgba(0, 20, 38, 1);border: 0;}.el-time-spinner__item:hover:not(.disabled) {//二级下拉框background: rgba(0, 0, 0, 0.7);font-size: medium;color: white;}}
</style><style scoped lang="scss">
@import "./components/css/rem.scss";// 下拉框样式的修改
::v-deep .el-input,
::v-deep .el-input__inner,
::v-deep .btn-bg,
::v-deep .el-range-editor--medium .el-range-input {background: url("./components/img/search1.png") no-repeat center center;background-size: 100% 100%;color: #fff;border: 0px;text-align: center;
}::v-deep .el-select-dropdown,
::v-deep .popperClass .el-date-picker .el-range-input {border: 0;background-image: url("./components/img/search-bg.png");background-position: center;background-repeat: no-repeat;background-size: 100% 100%;.el-select-dropdown__item {color: #fff;}
}.btn-time {background: url("./components/img/search1.png") no-repeat center center;background-size: 100% 100%;color: white;border: 0;
}.picker .el-date-range-picker {background-color: transparent !important;//   border: 0;// background-image: url("./components/img/search-bg.png");// background-position: center;// background-repeat: no-repeat;// background-size: 100% 100%;}::v-deep .amap-marker-label {background-color: transparent !important;color: #ffcd09;border: 0px solid #00f;white-space: nowrap;font-size: 16px;transform: translateX(-50%);font-weight: 700;
}.bg-com {width: 18vw;padding: .375rem;background: url('./components/img/bg-2.png') no-repeat center center;background-size: 100% 100%;z-index: 10;.item {max-width: 26vw;}
}.item-bg {width: 4.125rem;background: url('./components/img/alarm-bg.png') no-repeat center center;background-size: 100% 100%;
}
</style>

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

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

相关文章

【小白成长记】new Error()传递对象数据

new Error()需要传递对象数据时遇到的小问题&#xff0c;简单记录如下。 如下图代码&#xff1a;单个Promise里&#xff0c;表单校验未通过处理为 reject&#xff0c;同时需要将 表单以及未校验通过的错误信息传递以便后续进行处理。经过测试&#xff0c;发现reject只能传递一…

电脑文件msvcp100.dll丢失原因,如何快速修复msvcp100.dll

电脑文件msvcp100.dll丢失原因&#xff0c;最近有朋友在问这个&#xff0c;显然会问这个的人&#xff0c;一般都是遇到了msvcp100.dll丢失的问题了&#xff0c;今天我们就来详细的给大家说说msvcp100.dll这个文件吧&#xff0c;我们只有了解了msvcp100.dll这个文件&#xff0c;…

Docker专题-03 Log-Driver日志转存

Docker专题教程 注&#xff1a; 本教程由羞涩梦整理同步发布&#xff0c;本人技术分享站点&#xff1a;blog.hukanfa.com 转发本文请备注原文链接&#xff0c;本文内容整理日期&#xff1a;2024-03-19 csdn 博客名称&#xff1a;五维空间-影子&#xff0c;欢迎关注 说明 容器…

MySQL 索引:索引为什么使用 B+树?

Hash 索引不支持顺序和范围查询&#xff1b; 二叉查找树(BST)&#xff1a;解决了排序的问题&#xff0c;极端情况下可能会退化成线性链表&#xff0c;查询效率急剧下降&#xff1b; 平衡二叉树(AVL) &#xff1a;通过旋转解决了平衡的问题&#xff0c;但是旋转操作效率太低&am…

Rust之构建命令行程序(五):环境变量

开发环境 Windows 11Rust 1.77.0 VS Code 1.87.2 项目工程 这次创建了新的工程minigrep. 使用环境变量 我们将通过添加一个额外的功能来改进minigrep:一个不区分大小写的搜索选项&#xff0c;用户可以通过环境变量打开该选项。我们可以将此功能设置为命令行选项&#xff0c;…

linux 升级openssl1.1.1w 亲测记录

下载好openssl源码包,解压到指定目录下 tar -xzvf openssl-1.1.1w.tar.gz -C /usr/localcd openssl-1.1.1w/*预编译、编译、安装*/./config --prefix/usr/local/openssl sharedmake && make install备份配置系统中原有的文件、创建软链接、动态库查找路径配置文件 ld.s…

SpringBoot实战(二十七)集成WebFlux

目录 一、WebFlux1.1 定义1.2 WebFlux 与 Spring MVC 区别 二、代码实现2.1 Maven 配置2.2 暴露 RESTful API 接口的方式方式一&#xff1a;基于注解的控制器方式二&#xff1a;函数式路由器&#xff08;Functional Endpoints&#xff09; 2.3 测试Service2.4 测试ServiceImpl2…

【Charles如何对手机APP进行抓包和弱网测试】

一、Charles对APP抓包 1、前提条件&#xff1a; 1&#xff09;电脑上必须安装Charles工具&#xff0c;如没有安装可参考&#xff1a;【Charles抓包工具下载安装详细操作步骤】-CSDN博客 2&#xff09;手机和电脑必须在同一个局域网内&#xff08;连接同一个WiFi&#xff09;…

ng发布静态资源 发布项目 发布数据

描述&#xff1a;把一个项目或者数据发布出来&#xff0c;通过http的形式访问&#xff0c;比如发布一个js文件&#xff0c;用http://localhost:6060/data/jquery/jquery.min.js访问。 步骤&#xff1a;配置nginx.conf文件&#xff0c;nginx.conf位于conf目录下&#xff0c;在se…

P2822 [NOIP2016 提高组] 组合数问题题解

题目 组合数表示的是从n个物品中选出m个物品的方案数。举个例子&#xff0c;从(1,2,3) 三个物品中选择两个物品可以有 (1,2),(1,3),(2,3)这三种选择方法。根据组合数的定义&#xff0c;我们可以给出计算组合数的一般公式&#xff1a; 其中n!12⋯n&#xff1b;特别地&#xff0…

Java 在PDF中插入页眉、页脚

在处理PDF文档时&#xff0c;有时需要为文档中的每一页添加页眉和页脚&#xff0c;以包含一些有用的信息&#xff0c;如文档标题、章节名称、日期、页码等。对于需要自动化处理的场景&#xff0c;或者需要在大量文档中添加一致的页眉和页脚&#xff0c;可以通过编程的方式来实现…

QGraphicsView的使用,view坐标,scene坐标,item坐标

Graphics View绘图构架 QGraphicsScene&#xff08;场景&#xff09;&#xff1a;可以管理多个图形项QGraphicsItem&#xff08;图形项&#xff09;&#xff1a;也就是图元&#xff0c;支持鼠标事件响应。QGraphicsView&#xff08;视图&#xff09;&#xff1a;关联场景可以让…

【数据库系统】数据库完整性和安全性

第六章 数据库完整性和安全性 基本内容 安全性&#xff1b;完整性&#xff1b;数据库恢复技术&#xff1b;SQL Server的数据恢复机制&#xff1b; 完整性 实体完整性、参照完整性、用户自定义完整性 安全性 身份验证权限控制事务日志&#xff0c;审计数据加密 数据库恢复 冗余…

Redis学习二--常见问题及处理

基本概念 Redis基本概念数据结构 机制 持久化机制&#xff1a; RDB(内存快照)&#xff1a;某一时刻的内存快照以二进制的方式写入磁盘&#xff0c;可以手动触发和自动触发。 优点&#xff1a;生成文件小&#xff0c;恢复速度快&#xff0c;适用于灾难恢复。 缺点&#xff1a…

关于Zookeeper分布式锁

背景 之前说到分布式锁的实现有三种 1、基于数据库实现的分布式锁 2、Redis分布式锁 3、Zookeeper分布式锁 前者redis分布式锁博客已具体介绍&#xff0c;此博客最终决定补齐关于Zookeeper分布式锁的实现原理。 简述 Zoopkeeper&#xff0c;它是一个为分布式的协调服务&…

固态继电器(SSR)您需要了解的一切

固态继电器&#xff08;也称SSR&#xff0c;SS继电器或SSR开关&#xff09;是一种集成的非接触式电子开关设备&#xff0c;由集成电路&#xff08;IC&#xff09;和分立组件紧密组装而成。处于现代电气应用的最前沿&#xff0c;与机电同类产品相比&#xff0c;具有许多优势。本…

重学SpringBoot3-Profiles介绍

更多SpringBoot3内容请关注我的专栏&#xff1a;《SpringBoot3》 期待您的点赞&#x1f44d;收藏⭐评论✍ 重学SpringBoot3-Profiles介绍 Profiles简介如何在Spring Boot中使用Profiles定义Profiles激活ProfilesIDEA设置active profile使用Profile-specific配置文件 条件化Bean…

flex布局

文章目录 1. 概念2. 和浮动的区别3. 伸缩容器和伸缩项目3.1. 伸缩容器3.2. 伸缩项目 4. 主轴与侧轴5. 主轴属性6. 纵轴属性6.1. align-self 示例 7. flex 实现水平垂直居中7.1. 方法一7.2. 方法二 8. 伸缩性8.1. flex-basis8.2. flex-shrink8.3. flex-grow&#xff08;伸&#…

如何做人才运营战略?

招聘人才和人才获取是同义词&#xff0c;但它们并不相同。招聘是大多数雇主的短期解决方案&#xff0c;而人才获取是一个长期解决方案。 企业要想改善企业文化朝着统一的愿景努力&#xff0c;就需要关注长期规划。 人才获取vs人才招聘 招聘是为了填补空缺&#xff0c;人才获取…

在服务器(Ubuntu20.04)安装用户级别的cuda11.8

1、cuda11.8的下载 首先在cuda官网下载我们需要的cuda版本&#xff0c;这里我下载的是cuda11.8&#xff08;我的最高支持cuda12.0&#xff09; 这里我直接使用wget命令下载不了&#xff0c;于是我直接在浏览器输入后面的链接下载到本地&#xff0c;之后再上传至服务器的&am…