Java新程北斗

新程北斗API:**
https://www.gzxcbd.cn/808gps/open/webApi.html#sec-vehicle-device-track**
获取设备历史轨迹:
必填参数:汽车设备号id,开始时间,结束时间
时间格式:yyyy-MM-dd HH:mm:ss

控制层:HashMap<String, Object> data = new HashMap<>();//获取轨迹List<BeiDouTrack> trackList = new ArrayList<>();if (StringUtils.isNotEmpty(startTime) && StringUtils.isNotEmpty(endTime)) {try {String did = beidouApi.getHandler().getDidByVehicle(plate).get(0);data.put("did", did);trackList = beidouApi.getHandler().getTrackListByDid(did, startTime, endTime);} catch (Exception e) {br.setCode(ResultCodeEnum.HTTP_ERROR.getCode());br.setMsg("定位系统不存在该车辆信息,请更换车牌号");return br;}}data.put("orderId", orderId);data.put("type", type);data.put("plate", plate);data.put("points", trackList);br.setData(data);return br;

北斗API

package com.taiji.web.api;import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.taiji.core.util.HttpClient;
import com.taiji.dto.*;
import com.taiji.web.config.BeiDouConfig;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;/*** 新程北斗API** @author liping* @date 2024-09-06 15:31**/
@Service
public class BeidouApi {/*** 获取用户车辆信息API地址*/private static final String API_QUERY_USER_VEHICLE = "https://www.gzxcbd.cn/StandardApiAction_queryUserVehicle.action";/*** 获取车辆最新位置信息API地址*/private static final String API_VEHICLE_STATUS = "https://www.gzxcbd.cn/StandardApiAction_vehicleStatus.action";/*** 获取车辆设备号API地址*/private static final String API_GET_DEVICE_BY_VEHICLE = "https://www.gzxcbd.cn/StandardApiAction_getDeviceByVehicle.action";/*** 获取设备在线状态API地址*/private static final String API_GET_DEVICE_OL_STATUS = "https://www.gzxcbd.cn/StandardApiAction_getDeviceOlStatus.action";/*** 录像查询API地址*/private static final String API_GET_VIDEO_FILE_INFO = "https://www.gzxcbd.cn/StandardApiAction_getVideoFileInfo.action";/*** 获取设备历史轨迹API地址*/private static final String API_QUERY_TRACK_DETAIL = "https://www.gzxcbd.cn/StandardApiAction_queryTrackDetail.action";/*** 获取车辆行驶里程API地址*/private static final String API_RUN_MILEAGE = "https://www.gzxcbd.cn/StandardApiAction_runMileage.action";/*** 获取设备报警数据(分页)API地址*/private static final String API_QUERY_ALARM_DETAIL = "https://www.gzxcbd.cn/StandardApiAction_queryAlarmDetail.action";/*** 获取设备状态(定位状态)API地址*/private static final String API_GET_DEVICE_STATUS = "https://www.gzxcbd.cn/StandardApiAction_getDeviceStatus.action";/*** 会话号参数名*/private static final String PARAM_JSESSION = "jsession";/*** 返回码字段名*/private static final String RESULT_FIELD = "result";/*** 错误消息字段名*/private static final String MESSAGE_FIELD = "message";/*** 成功返回码*/private static final int SUCCESS_RESULT = 0;@Resourceprivate BeiDouConfig beiDouConfig;private final Map<String, BeidouApiHandler> HANDLER_MAP = new HashMap<>();public BeidouApiHandler getHandler(String username, String password){BeidouApiHandler handler = HANDLER_MAP.get(username);if(handler == null){handler = new BeidouApiHandler(username, password, beiDouConfig);HANDLER_MAP.put(username, handler);}return handler;}public BeidouApiHandler getHandler(){return getHandler(beiDouConfig.getUsername(), beiDouConfig.getPassword());}public static class BeidouApiHandler{private final String username;private final String password;private final BeiDouConfig beiDouConfig;public BeidouApiHandler(String username, String password, BeiDouConfig beiDouConfig){this.username = username;this.password = password;this.beiDouConfig = beiDouConfig;}/*** 获取会话号* @return*/public String getSession(){return beiDouConfig.getSession(this.username, this.password);}/*** 添加会话号到请求参数* @return*/private Map<String, String> withSession(){String session = getSession();Map<String, String> data = new HashMap<>(1);data.put(PARAM_JSESSION, session);return data;}/*** 添加会话号到请求参数* @param data  请求参数* @return*/private Map<String, String> withSession(Map<String, String> data){data.putAll(withSession());return data;}/*** 返回码校验* @param json  响应报文*/private void checkResult(JSONObject json){if(json.getIntValue(RESULT_FIELD) != SUCCESS_RESULT){throw new BeidouApiException(json.getIntValue(RESULT_FIELD), json.getString(MESSAGE_FIELD));}}/*** 获取用户车辆信息* @return*/public JSONObject queryUserVehicle(){String result = HttpClient.doPost(API_QUERY_USER_VEHICLE, withSession());JSONObject json = JSONObject.parseObject(result);checkResult(json);return json;}/*** 获取车牌号列表* @return*/public List<String> getPlateList(){JSONObject vehicleRes = queryUserVehicle();JSONArray vehicles = vehicleRes.getJSONArray("vehicles");if(CollectionUtils.isNotEmpty(vehicles)){return vehicles.stream().map(o -> ((JSONObject)o).getString("nm")).collect(Collectors.toList());}return null;}/*** 获取车牌号(多个车牌号以“,”拼接)* @return*/public String getPlates(){JSONObject vehicleRes = queryUserVehicle();JSONArray vehicles = vehicleRes.getJSONArray("vehicles");if(CollectionUtils.isNotEmpty(vehicles)){return vehicles.stream().map(o -> ((JSONObject)o).getString("nm")).collect(Collectors.joining(","));}return "";}/*** 获取车辆最新位置信息* @param plates    车牌号码(多个办车牌以“,”拼接)* @return*/public List<BeiDouLocationInfor> getLocations(String plates){Map<String, String> data = new HashMap<>(3);data.put("vehiIdno", plates);data.put("toMap", "2");String res = HttpClient.doPost(API_VEHICLE_STATUS, withSession(data));JSONObject json = JSONObject.parseObject(res);checkResult(json);return JSON.parseArray(json.getString("infos"), BeiDouLocationInfor.class);}/*** 获取车辆最新位置信息* @param plates    车牌号码列表* @return*/public List<BeiDouLocationInfor> getLocations(List<String> plates){return getLocations(join(plates));}/*** 获取车辆最新位置信息* @param plates    车牌号码列表* @return*/public List<CarDtoForDispatch> vehicleStatus(List<String> plates){return vehicleStatus(join(plates));}/*** 获取车辆最新位置信息* @param plates    车牌号码(多个办车牌以“,”拼接)* @return*/public List<CarDtoForDispatch> vehicleStatus(String plates){List<BeiDouLocationInfor> locations = getLocations(plates);if(CollectionUtils.isNotEmpty(locations)){return locations.stream().map(o -> {CarDtoForDispatch carDto = new CarDtoForDispatch();carDto.setPlate(o.getVi());carDto.setMlat(o.getMlat()); //纬度carDto.setMlng(o.getMlng()); //经度carDto.setTm(o.getTm()); //时间return carDto;}).collect(Collectors.toList());}return null;}/*** 获取车辆设备号* @param plates  车牌号 可以是多个,以','分割* @return*/public JSONObject getDeviceByVehicle(String plates){Map<String, String> data = new HashMap<>(2);data.put("vehiIdno", plates);String res = HttpClient.doPost(API_GET_DEVICE_BY_VEHICLE, withSession(data));JSONObject json = JSONObject.parseObject(res);checkResult(json);return json;}/*** 获取车辆设备号* @param plates  车牌号列表* @return*/public JSONObject getDeviceByVehicle(List<String> plates){return getDeviceByVehicle(join(plates));}/*** 获取车辆设备号* @param plates    车牌号 可以是多个,以','分割* @return*/public List<String> getDidByVehicle(String plates){JSONObject json = getDeviceByVehicle(plates);JSONArray devices = json.getJSONArray("devices");if(CollectionUtils.isNotEmpty(devices)){return devices.stream().map(o -> ((JSONObject) o).getString("did")).collect(Collectors.toList());}return null;}/*** 获取车辆设备号* @param plates    车牌号列表* @return*/public List<String> getDidByVehicle(List<String> plates){return getDidByVehicle(join(plates));}/*** 获取设备在线状态* @param plates    车牌号 可以是多个,以','分割* @return*/public JSONObject getDeviceOlStatus(String plates){Map<String, String> data = new HashMap<>(2);data.put("vehiIdno", plates);String result = HttpClient.doPost(API_GET_DEVICE_OL_STATUS, withSession(data));JSONObject json = JSONObject.parseObject(result);checkResult(json);return json;}/*** 获取设备在线状态* @param plates    车牌号列表* @return*/public JSONObject getDeviceOlStatus(List<String> plates){return getDeviceOlStatus(join(plates));}/*** 获取设备在线状态* @param plates    车牌号 可以是多个,以','分割* @return*/public List<BeiDouOnLine> getDeviceOnLine(String plates){JSONObject json = getDeviceOlStatus(plates);return JSON.parseArray(json.getString("onlines"), BeiDouOnLine.class);}/*** 获取设备在线状态* @param plates    车牌号列表* @return*/public List<BeiDouOnLine> getDeviceOnLine(List<String> plates){return getDeviceOnLine(join(plates));}/*** 录像查询 (原始接口返回json)* @param plate     车牌号* @param year      年份* @param month     月份* @param day       日期* @param type      录像类型 0表示常规,1表示报警,-1表示所有* @param fileType  文件类型 1表示图像 2表示录像。* @return*/public JSONObject getVideoFileInfo(String plate,String year,String month,String day,String type,String fileType){String did = getDidByVehicle(plate).get(0);Map<String, String> data = new HashMap<>(16);data.put("DevIDNO", did);data.put("LOC", "1");data.put("CHN", "0");data.put("YEAR", year);data.put("MON", month);data.put("DAY", day);data.put("RECTYPE", type);data.put("FILEATTR", fileType);data.put("BEG", "0");data.put("END", "86399");data.put("ARM1", "0");data.put("ARM2", "0");data.put("RES", "0");data.put("STREAM", "0");data.put("STORE", "0");String result = HttpClient.doPost(API_GET_VIDEO_FILE_INFO, withSession(data));JSONObject json = JSONObject.parseObject(result);checkResult(json);return json;}/*** 录像查询(返回文件列表)* @param plate     车牌号* @param year      年份* @param month     月份* @param day       日期* @param type      录像类型 0表示常规,1表示报警,-1表示所有* @param fileType  文件类型 1表示图像 2表示录像。* @return*/public JSONArray getVideoFiles(String plate,String year,String month,String day,String type,String fileType){JSONObject json = getVideoFileInfo(plate, year, month, day, type, fileType);return json.getJSONArray("files");}/*** 获取设备历史轨迹* @param plate     车牌号* @param startTime 开始时间(格式:yyyy-MM-dd HH:mm:ss)* @param endTime   结束时间(格式:yyyy-MM-dd HH:mm:ss)* @return*/public JSONObject queryTrackDetail(String plate,String startTime,String endTime){String did = getDidByVehicle(plate).get(0);return queryTrackDetailByDid(did, startTime, endTime);}/*** 根据设备号获取设备历史轨迹* @param did       设备号* @param startTime 开始时间(格式:yyyy-MM-dd HH:mm:ss)* @param endTime   结束时间(格式:yyyy-MM-dd HH:mm:ss)* @return*/public JSONObject queryTrackDetailByDid(String did,String startTime,String endTime){Map<String, String> data = new HashMap<>(5);data.put("devIdno", did);data.put("begintime", startTime);data.put("endtime", endTime);data.put("toMap", "2");String result = HttpClient.doPost(API_QUERY_TRACK_DETAIL, withSession(data));JSONObject json = JSONObject.parseObject(result);checkResult(json);return json;}/*** 获取设备历史轨迹* @param plate     车牌号* @param startTime 开始时间(格式:yyyy-MM-dd HH:mm:ss)* @param endTime   结束时间(格式:yyyy-MM-dd HH:mm:ss)* @return*/public List<BeiDouTrack> getTrackList(String plate,String startTime,String endTime){JSONObject json = queryTrackDetail(plate, startTime, endTime);return JSON.parseArray(json.getString("tracks"), BeiDouTrack.class);}/*** 获取设备历史轨迹* @param did       设备号* @param startTime 开始时间(格式:yyyy-MM-dd HH:mm:ss)* @param endTime   结束时间(格式:yyyy-MM-dd HH:mm:ss)* @return*/public List<BeiDouTrack> getTrackListByDid(String did,String startTime,String endTime){JSONObject json = queryTrackDetailByDid(did, startTime, endTime);return JSON.parseArray(json.getString("tracks"), BeiDouTrack.class);}/*** 获取车辆行驶里程* @param plates    车牌号 可以是多个,以','分割* @param beginTime 开始时间 开始时间不得大于结束时间(格式:yyyy-MM-dd)* @param endTime   结束时间(格式:yyyy-MM-dd)* @return*/public JSONObject runMileage(String plates, String beginTime, String endTime){Map<String, String> data = new HashMap<>(4);data.put("vehiIdno", plates);data.put("begintime", beginTime);data.put("endtime", endTime);String result = HttpClient.doPost(API_RUN_MILEAGE, withSession(data));JSONObject json = JSONObject.parseObject(result);checkResult(json);return json;}/*** 获取车辆行驶里程* @param plates    车牌号列表* @param beginTime 开始时间 开始时间不得大于结束时间(格式:yyyy-MM-dd)* @param endTime   结束时间(格式:yyyy-MM-dd)* @return*/public JSONObject runMileage(List<String> plates, String beginTime, String endTime){return runMileage(join(plates), beginTime, endTime);}/*** 获取车辆行驶里程* @param plates    车牌号 可以是多个,以','分割* @param beginTime 开始时间 开始时间不得大于结束时间(格式:yyyy-MM-dd)* @param endTime   结束时间(格式:yyyy-MM-dd)* @return*/public List<BeiMileageDto> getMileageList(String plates, String beginTime, String endTime){JSONObject json = runMileage(plates, beginTime, endTime);return JSON.parseArray(json.getString("infos"), BeiMileageDto.class);}/*** 获取车辆行驶里程* @param plates    车牌号列表* @param beginTime 开始时间 开始时间不得大于结束时间(格式:yyyy-MM-dd)* @param endTime   结束时间(格式:yyyy-MM-dd)* @return*/public List<BeiMileageDto> getMileageList(List<String> plates, String beginTime, String endTime){return getMileageList(join(plates), beginTime, endTime);}/*** 获取车辆载重告警* @param plates    车牌号 可以是多个,以','分割* @param beginTime 开始时间 (格式:yyyy-MM-dd HH:mm:ss)* @param endTime   结束时间 开始时间不得大于结束时间,并且查询天数不得大于90天(格式:yyyy-MM-dd HH:mm:ss)* @return*/public JSONArray getLoadAlarm(String plates,String beginTime,String endTime){Map<String, String> data = new HashMap<>(9);data.put("vehiIdno", plates);data.put("begintime", beginTime);data.put("endtime", endTime);data.put("armType", "1325,1324");data.put("handle", "0");data.put("currentPage", "1");data.put("pageRecords", "10000");data.put("toMap", "2");String result = HttpClient.doPost(API_QUERY_ALARM_DETAIL, withSession(data));JSONObject json = JSONObject.parseObject(result);checkResult(json);return json.getJSONArray("alarms");}/*** 获取车辆载重告警* @param plates    车牌号列表* @param beginTime 开始时间 (格式:yyyy-MM-dd HH:mm:ss)* @param endTime   结束时间 开始时间不得大于结束时间,并且查询天数不得大于90天(格式:yyyy-MM-dd HH:mm:ss)* @return*/public JSONArray getLoadAlarm(List<String> plates,String beginTime,String endTime){return getLoadAlarm(join(plates), beginTime, endTime);}/*** 获取设备状态(定位状态)* @param plates 车牌号 可以是多个,以','分割* @return*/public List<BeiDouDeviceStatus> getDeviceStatus(String plates){//https://www.gzxcbd.cn/StandardApiAction_getDeviceStatus.action?jsession=jsessionStr// &vehiIdno=vehiIdnoStr// &geoaddress=1// &language=zh// &toMap=2Map<String, String> data = new HashMap<>(5);data.put("vehiIdno", plates);data.put("geoaddress", "1");data.put("language", "zh");data.put("toMap", "2");String result = HttpClient.doPost(API_GET_DEVICE_STATUS, withSession(data));JSONObject json = JSONObject.parseObject(result);checkResult(json);JSONArray status = json.getJSONArray("status");if(CollectionUtils.isNotEmpty(status)){return status.stream().map(BeidouApiHandler::convert).collect(Collectors.toList());}return null;}/*** json转设备状态对象* @param object    json对象* @return*/private static BeiDouDeviceStatus convert(Object object){JSONObject json = (JSONObject) object;BeiDouDeviceStatus status = new BeiDouDeviceStatus();// 车牌号status.setPlate(json.getString("vid"));// 经过转换后的经度status.setMlng(json.getString("mlng"));// 经过转换后的纬度status.setMlat(json.getString("mlat"));// 位置上报时间status.setGt(StringUtils.replace(json.getString("gt"), ".0", ""));// 速度(方向)Double spValue = json.getDouble("sp");String direction = getDirection(json.getInteger("hx"));if(spValue != null){StringBuilder builder = new StringBuilder().append(spValue / 10.0).append("公里/时");if(direction != null){builder.append("(").append(direction).append(")");}status.setSp(builder.toString());}// 高程String gd = json.getString("gd");if(null != gd) {status.setGd(gd + "(m)");}// 行驶记录仪速度Double tspValue = json.getDouble("tsp");if (null != tspValue) {status.setTsp(tspValue / 10.0 + "公里/时");}// 里程Double lcValue = json.getDouble("lc");if (null != lcValue) {status.setTsp(lcValue / 1000 + "公里");}// 今日里程Double bsd1Value = json.getDouble("bsd1");if (null != bsd1Value) {status.setTsp(bsd1Value / 10.0 + "公里");}// 设备号status.setId(json.getString("id"));// 位置status.setPs(json.getString("ps"));// 在线状态status.setOnlineStatus(StringUtils.equals("1", json.getString("ol")) ? "在线" : "离线");// 网络类型status.setNet(getNet(json.getInteger("net")));// 状态1status.setS1(getS1(json.getInteger("s1")));// 卫星数status.setSn(json.getInteger("sn"));// 状态汇总信息List<String> olItems = Arrays.asList(status.getOnlineStatus(), status.getNet(), status.getS1(), status.getSn() == null ? null : "卫星数:" + status.getSn());status.setOl(join(olItems));return status;}/*** 获取方向* @param hx* @return*/private static String getDirection(Integer hx){if(hx == null){return null;}Integer direction = ((hx + 22) / 45) & 0x7;String[] directionNames = {"北","东北","东","东南","南","西南","西","西北"};if(direction >= 0 && direction < directionNames.length){return directionNames[direction];}return null;}/*** 获取网络类型* @param net* @return*/private static String getNet(Integer net){if(net == null){return null;}String[] netNames = {"3G","WIFI","有线","4G","5G"};if(net >= 0 && net < netNames.length){return netNames[net];}return null;}/*** 获取状态1* @param s1* @return*/private static String getS1(Integer s1){if(s1 == null){return null;}List<String> items = new ArrayList<>();items.add(getStatusType(s1, 2) ? "ACC开启" : "ACC关闭");if(getStatusType(s1, 14)){items.add("怠速");}if(getStatusType(s1, 15)){items.add("行驶");}if(getStatusType(s1, 17)){items.add("怠速");}return join(items);}private static boolean getStatusType(int num, int index) {return (num >> (index - 1) & 1) == 1;}/*** 字符串拼接* @param collection    集合* @param delimiter     分隔符* @return*/private static String join(Collection<String> collection, CharSequence delimiter){if(CollectionUtils.isNotEmpty(collection)){return collection.stream().filter(StringUtils::isNotEmpty).collect(Collectors.joining(delimiter));}return "";}/*** 字符串拼接(以”,“为分隔符)* @param collection    集合* @return*/private static String join(Collection<String> collection){return join(collection, ",");}}}

post请求

package com.taiji.core.util;import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpEntity;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;import java.util.Map;public class HttpClient {static final Logger logger = LoggerFactory.getLogger(HttpClient.class);public static String doGet(String url) {CloseableHttpClient httpClient = null;CloseableHttpResponse response = null;String result = "";try {// 通过址默认配置创建一个httpClient实例httpClient = HttpClients.createDefault();// 创建httpGet远程连接实例HttpGet httpGet = new HttpGet(url);// 设置配置请求参数RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(35000)// 连接主机服务超时时间.setConnectionRequestTimeout(35000)// 请求超时时间.setSocketTimeout(60000)// 数据读取超时时间.build();// 为httpGet实例设置配置httpGet.setConfig(requestConfig);// 执行get请求得到返回对象response = httpClient.execute(httpGet);// 通过返回对象获取返回数据HttpEntity entity = response.getEntity();// 通过EntityUtils中的toString方法将结果转换为字符串result = EntityUtils.toString(entity);} catch (ClientProtocolException e) {e.printStackTrace();} catch (IOException e) {e.printStackTrace();} finally {// 关闭资源if (null != response) {try {response.close();} catch (IOException e) {e.printStackTrace();}}if (null != httpClient) {try {httpClient.close();} catch (IOException e) {e.printStackTrace();}}}return result;}public static String doPost(String url, Map<String, String> map) {CloseableHttpClient httpClient = null;CloseableHttpResponse response = null;String result = "";try {httpClient = HttpClients.createDefault();HttpPost httpPost = new HttpPost(url);RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(120000)// 连接主机服务超时时间.setConnectionRequestTimeout(120000)// 请求超时时间.setSocketTimeout(120000)// 数据读取超时时间.build();httpPost.setConfig(requestConfig);ArrayList<BasicNameValuePair> parameters = new ArrayList<BasicNameValuePair>();if (null != map && !map.isEmpty()) {map.forEach((key, value) -> {if(StringUtils.isNotBlank(value)){parameters.add(new BasicNameValuePair(key, value));}});}httpPost.setEntity(new UrlEncodedFormEntity(parameters,"UTF-8"));logger.info("发送请求时间:[{}]", DateUtils.getCurrentYYYYMMDDHHmmss());response = httpClient.execute(httpPost);logger.info("返回请求时间:[{}]", DateUtils.getCurrentYYYYMMDDHHmmss());HttpEntity entity = response.getEntity();result = EntityUtils.toString(entity);} catch (Exception e) {logger.info("异常请求时间:[{}]", DateUtils.getCurrentYYYYMMDDHHmmss());logger.error("发送请求失败:", e);throw new RuntimeException("请求异常:", e);} finally {if (null != response) {try {response.close();} catch (IOException e) {logger.error("关闭连接失败:", e);}}if (null != httpClient) {try {httpClient.close();} catch (IOException e) {logger.error("关闭连接失败:", e);}}}return result;}
}

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

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

相关文章

数字+文旅:AI虚拟数字人如何焕发传统文旅景区新活力?

​​引言&#xff1a; 据《2024年中国数字文旅行业市场研究报告》显示&#xff0c;截至2022年&#xff0c;中国数字文旅市场规模已达到约9698.1亿元人民币&#xff0c;相较于2017年的7870.5亿元&#xff0c;实现了57.89%的显著增长。这一行业涵盖了数字化的文化遗产旅游、虚拟…

JVM、字节码文件介绍

目录 初识JVM 什么是JVM JVM的三大核心功能 JVM的组成 字节码文件的组成 基础信息 Magic魔数 主副版本号 其它基础信息 常量池 字段 方法 属性 字节码常用工具 javap jclasslib插件 阿里Arthas 初识JVM 什么是JVM JVM的三大核心功能 1. 解释和运行虚拟机指…

【性能优化】安卓性能优化之CPU优化

【性能优化】安卓性能优化之CPU优化 CPU优化及常用工具原理与文章参考常用ADB常用原理、监控手段原理监控手段多线程并发解决耗时UI相关 常见场景排查CPU占用过高常用系统/开源分析工具AndroidStudio ProfilerSystraceBtracePerfettoTraceView和 Profile ANR相关ANR原理及常见场…

使用 VSCode 通过 Remote-SSH 连接远程服务器详细教程

使用 VSCode 通过 Remote-SSH 连接远程服务器详细教程 在日常开发中&#xff0c;许多开发者需要远程连接服务器进行代码编辑和调试。Visual Studio Code&#xff08;VSCode&#xff09;提供了一个非常强大的扩展——Remote-SSH&#xff0c;它允许我们通过 SSH 协议直接连接远程…

YOLO V3 网络构架解析

YOLO V3&#xff08;You Only Look Once version 3&#xff09;是由Joseph Redmon等人于2018年提出的一种基于深度学习的目标检测算法。它在速度和精度上相较于之前的版本有了显著提升&#xff0c;成为计算机视觉领域的一个重要里程碑。本文将详细解析YOLO V3的网络架构&#x…

【信息论基础第六讲】离散无记忆信源等长编码包括典型序列和等长信源编码定理

一、信源编码的数学模型 我们知道信源的输出是消息序列&#xff0c;对于信源进行编码就是用码字集来表示消息集&#xff0c;也就是要进行从消息集到码字集的映射。 根据码字的特征我们又将其分为D元码&#xff0c;等长码&#xff0c;不等长码&#xff0c;唯一可译码。 我们通过…

通过DevTools逃离Chrome沙盒(CVE-2024-6778和CVE-2024-5836)

介绍 这篇博文详细介绍了如何发现CVE-2024-6778和CVE-2024-5836的&#xff0c;这是Chromium web浏览器中的漏洞&#xff0c;允许从浏览器扩展&#xff08;带有一点点用户交互&#xff09;中进行沙盒逃逸。 简而言之&#xff0c;这些漏洞允许恶意的Chrome扩展在你的电脑上运行…

npm run serve 提示异常Cannot read property ‘upgrade‘ of undefined

npm run serve 提示Cannot read property ‘upgrade’ of undefined 一般是proxy的target代理域名问题导致的&#xff0c;如下&#xff1a; 解决方案&#xff1a; proxy: { “/remoteDealerReportApi”: { target: ‘http://demo-.com.cn’, //此域名有问题&#xff0c;会导致…

Linux-基础命令及相关知识2

补充&#xff1a; 1、A命令&#xff08;echo&#xff09;既有可能是内部命令也有可能是外部命令&#xff0c;例如命令A既有可能在bash上也有可能在csh上&#xff0c;为了防止A在某些shell程序里不起作用&#xff0c;可以将A命令设置为外部命令&#xff08;环境变量路径上&…

【JAVA毕设】基于JAVA的酒店管理系统

一、项目介绍 本系统前端框架采用了比较流行的渐进式JavaScript框架Vue.js。使用Vue-Router实现动态路由&#xff0c;Ajax实现前后端通信&#xff0c;Element-plus组件库使页面快速成型。后端部分&#xff1a;采用SpringBoot作为开发框架&#xff0c;同时集成MyBatis、Redis、…

Chrome DevTools:Console Performance 汇总篇

Chrome DevTools Chrome 开发者工具是一套 Web 开发者工具&#xff0c;直接内置于 Google Chrome 浏览器中。 开发者工具可以帮助您即时修改页面和快速诊断问题&#xff0c;最终帮助您更快地构建更好的网站。 一、开启 DevTools 右上角菜单 > 更多工具 > 开发者工具 页面…

如何用mmclassification训练多标签多分类数据

这里使用的源码版本是 mmclassification-0.25.0 训练数据标签文件格式如下&#xff0c;每行的空格前面是路径&#xff08;图像文件所在的绝对路径&#xff09;&#xff0c;后面是标签名&#xff0c;因为特殊要求这里我的每张图像都记录了三个标签每个标签用“,”分开&#xff0…

力扣71~75题

题71&#xff08;中等&#xff09;&#xff1a; python代码&#xff1a; class Solution:def simplifyPath(self, path: str) -> str:#首先根据/分割字符串&#xff0c;再使用栈来遍历存储p_listpath.split(/)p_stack[]for i in p_list:#如果为空则肯定是//或者///if i:con…

mac m1 安装openresty以及redis限流使用

一切源于一篇微信文章 早上我上着班&#xff0c;听着歌1.打算使用腾讯云服务器centos-7实验&#xff1a;安装ngx_devel_kitmac m1 os 12.7.6 安装openresty测试lua限流: 终于回到初心了&#xff01; 早上我上着班&#xff0c;听着歌 突然微信推送了一篇文章《Nginx 实现动态封…

记录一次从nacos配置信息泄露到redis写计划任务接管主机

经典c段打点开局。使用dddd做快速的打点发现某系统存在nacos权限绕过 有点怀疑是蜜罐&#xff0c;毕竟nacos这实在是有点经典 nacos利用 老规矩见面先上nacos利用工具打一波看看什么情况 弱口令nacos以及未授权访问&#xff0c;看这记录估计被光顾挺多次了啊 手动利用Nacos-…

MySQL - Navicat自动备份MySQL数据

对于从事IT开发的工程师&#xff0c;数据备份我想大家并不陌生&#xff0c;这件工程太重要了&#xff01;对于比较重要的数据&#xff0c;我们希望能定期备份&#xff0c;每天备份1次或多次&#xff0c;或者是每周备份1次或多次。 如果大家在平时使用Navicat操作数据库&#x…

深入解析Python数据容器

Python数据容器 1&#xff0c;数据容器介绍2&#xff0c;数据容器的分类3&#xff0c;数据容器&#xff1a;list&#xff08;列表&#xff09;3.1&#xff0c;列表的定义3.2&#xff0c;列表的下标索引3.3&#xff0c;列表的常用操作3.3.1&#xff0c;查找指定元素下标3.3.2&am…

【OpenAI】第三节(上下文)什么是上下文?全面解读GPT中的上下文概念与实际案例

文章目录 一、GPT上下文的定义1.1 上下文的组成 二、GPT上下文的重要性2.1 提高生成文本的相关性2.2 增强对话的连贯性2.3 支持多轮对话 三、使用上下文改善编程对话3.1 使用上下文的概念3.2 使用上下文改善对话的作用3.3 使用上下文改善对话的方法3.4 案例分析 四、利用历史记…

安装Openeuler出现的问题

1.正常安装中&#xff0c;不显示已有的网络&#xff0c;ens33 尝试&#xff1a;手敲ens33配置&#xff0c;包括使用uuidgen ens33 配置还是不行 可能解决办法1&#xff1a;更换安装的版本。譬如说安装cenos 7 64位 启动虚拟机&#xff0c;更换版本之后的安装界面&#xff0c;…

Excel常用操作培训

以下是Excel的基本操作&#xff0c;内部培训专用。喜欢就点赞收藏哦&#xff01; 目录 1 Excel基本操作 1.1 常用快捷键 1.1.1快捷键操作工作簿、工作表 1.1.2快捷键操作 1.1.3单元格操作 1.1.4输入操作 2.1 常见功能描述 2.1.1 窗口功能栏 2.1.2 剪切板 2.1.3 字体…