海康威视相机-LINUX SDK 开发

硬件与环境

mvs

相机: MV-CS020-10GC
系统:UBUNTU 22.04
语言:C++
工具:cmake
海康官网下载SDK
在这里插入图片描述

在这里插入图片描述
运行下面的命令进行安装

sudo dpkg -i  MVSXXX.deb

安装完成后从在/opt/MVS 路径下就有了相关的库,实际上我们开发的时候只需要lib和include。有兴趣的同学也可以尝试以下Samples的例子。make一下就能生成可执行文件。如果make报错,可能环境变量没有设置好,到bin文件夹下把那几个设置环境变量的shell脚本运行一下再试一试。

make

在这里插入图片描述
这里是我运行了/opt/MVS/Samples/64/Display下的例子。

在这里插入图片描述

开发

实际上我们开发的时候只需要目录/opt/MVS/lib和/opt/MVS/include下的文件。他们是海康提供的链接库。所以我们在写程序的时候链接到海康的库,我们就能调用海康官方的接口了。

我将海康的库放在我工程的3rdPartys下,这样就移植到其他电脑上会比较方便。

add_library(cameraAPISHARED
)
# Define preprocessor macro for exporting symbols on Windowsif(WIN32)target_compile_definitions(cameraAPI PRIVATE cameraAPI_EXPORTS)
endif()message( target name: cameraAPI )target_include_directories(cameraAPI  PRIVATE${OpenCV_INCLUDE_DIRS}./include./3rdPartys/mvsinclude
)target_sources(cameraAPI PRIVATE./src/edge_camera.cpp
)target_link_directories(cameraAPI  PUBLIC${OpenCV_LIBS}./3rdPartys/mvslib/64
)target_link_libraries(cameraAPI  PRIVATE${OpenCV_LIBS}MvCameraControlpthread
)

主要的程序

//
// Created by zc on 8/24/23.
//
#include "edge_camera.h"EDGE_CAMERA::EDGE_CAMERA() {std::cout<<"EDGE_CAMERA BEGIN!"<<std::endl;
}EDGE_CAMERA::~EDGE_CAMERA(){std::cout<<"EDGE_CAMERA FINISH!"<<std::endl;
}// print the discovered devices' information
void EDGE_CAMERA::PrintDeviceInfo(MV_CC_DEVICE_INFO* pstMVDevInfo)
{if (nullptr == pstMVDevInfo){printf("    NULL info.\n\n");return;}if (MV_GIGE_DEVICE == pstMVDevInfo->nTLayerType){unsigned int nIp1 = ((pstMVDevInfo->SpecialInfo.stGigEInfo.nCurrentIp & 0xff000000) >> 24);unsigned int nIp2 = ((pstMVDevInfo->SpecialInfo.stGigEInfo.nCurrentIp & 0x00ff0000) >> 16);unsigned int nIp3 = ((pstMVDevInfo->SpecialInfo.stGigEInfo.nCurrentIp & 0x0000ff00) >> 8);unsigned int nIp4 = (pstMVDevInfo->SpecialInfo.stGigEInfo.nCurrentIp & 0x000000ff);// en:Print current ip and user defined nameprintf("    IP: %d.%d.%d.%d\n" , nIp1, nIp2, nIp3, nIp4);printf("    UserDefinedName: %s\n" , pstMVDevInfo->SpecialInfo.stGigEInfo.chUserDefinedName);printf("    Device Model Name: %s\n\n", pstMVDevInfo->SpecialInfo.stGigEInfo.chModelName);}else if (MV_USB_DEVICE == pstMVDevInfo->nTLayerType){printf("    UserDefinedName: %s\n", pstMVDevInfo->SpecialInfo.stUsb3VInfo.chUserDefinedName);printf("    Device Model Name: %s\n\n", pstMVDevInfo->SpecialInfo.stUsb3VInfo.chModelName);}else{printf("    Not support.\n\n");}
}//  en:Convert pixel arrangement from RGB to BGR
void EDGE_CAMERA::RGB2BGR( unsigned char* pRgbData, unsigned int nWidth, unsigned int nHeight )
{if ( nullptr == pRgbData ){return;}// RGB TO BGRfor (unsigned int j = 0; j < nHeight; j++){for (unsigned int i = 0; i < nWidth; i++){unsigned char red = pRgbData[j * (nWidth * 3) + i * 3];pRgbData[j * (nWidth * 3) + i * 3]     = pRgbData[j * (nWidth * 3) + i * 3 + 2];pRgbData[j * (nWidth * 3) + i * 3 + 2] = red;}}
}// en:Convert data stream to Mat format then save image
bool EDGE_CAMERA::Convert2Mat(MV_FRAME_OUT_INFO_EX *pstImageInfo, unsigned char *pData, cv::Mat &img)
{if (nullptr == pstImageInfo || nullptr == pData){printf("NULL info or data.\n");return false;}cv::Mat srcImage;if ( PixelType_Gvsp_Mono8 == pstImageInfo->enPixelType )                // Mono8{srcImage = cv::Mat(pstImageInfo->nHeight, pstImageInfo->nWidth, CV_8UC1, pData);}else if ( PixelType_Gvsp_RGB8_Packed == pstImageInfo->enPixelType )     // RGB8{RGB2BGR(pData, pstImageInfo->nWidth, pstImageInfo->nHeight);srcImage = cv::Mat(pstImageInfo->nHeight, pstImageInfo->nWidth, CV_8UC3, pData);}else if(PixelType_Gvsp_BayerRG8 == pstImageInfo->enPixelType)           // BayerRG8{printf("pPixelType_Gvsp_BayerRG8 type is converted to Mat\n");//RGB2BGR(pData, pstImageInfo->nWidth, pstImageInfo->nHeight);srcImage = cv::Mat(pstImageInfo->nHeight, pstImageInfo->nWidth, CV_8UC1, pData);// srcImage.create(srcImage.rows,srcImage.cols,CV_8UC3);cvtColor(srcImage, srcImage, cv::COLOR_BayerRG2RGB);}else{printf("Unsupported pixel format\n");return false;}if ( nullptr == srcImage.data ){printf("Creat Mat failed.\n");return false;}try{// en:Save converted image in a local fileimg = srcImage;cv::imwrite("Image_Mat.bmp", srcImage);}catch (cv::Exception& ex){fprintf(stderr, "Exception in saving mat image: %s\n", ex.what());}srcImage.release();return true;
}// en:Convert data stream in Ipl format then save image
bool EDGE_CAMERA::Convert2Ipl(MV_FRAME_OUT_INFO_EX* pstImageInfo, unsigned char * pData)
{if (nullptr == pstImageInfo || nullptr == pData){printf("NULL info or data.\n");return false;}IplImage* srcImage = nullptr;if ( PixelType_Gvsp_Mono8 == pstImageInfo->enPixelType )                // Mono8????{srcImage = cvCreateImage(cvSize(pstImageInfo->nWidth, pstImageInfo->nHeight), IPL_DEPTH_8U, 1);}else if ( PixelType_Gvsp_RGB8_Packed == pstImageInfo->enPixelType )     // RGB8????{RGB2BGR(pData, pstImageInfo->nWidth, pstImageInfo->nHeight);srcImage = cvCreateImage(cvSize(pstImageInfo->nWidth, pstImageInfo->nHeight), IPL_DEPTH_8U, 3);}else{printf("Unsupported pixel format\n");return false;}if ( nullptr == srcImage ){printf("Creat IplImage failed.\n");return false;}srcImage->imageData = (char *)pData;try{// en:Save converted image in a local filecv::Mat cConvertImage = cv::cvarrToMat(srcImage);cv::imwrite("Image_Ipl.bmp", cConvertImage);cConvertImage.release();}catch (cv::Exception& ex){fprintf(stderr, "Exception in saving IplImage: %s\n", ex.what());}cvReleaseImage(&srcImage);return true;
}void EDGE_CAMERA::findCameras(){int nRet = MV_OK;//void* handle = nullptr;//unsigned char * pData = nullptr;//MV_CC_DEVICE_INFO_LIST _stDeviceList;memset(&_stDeviceList, 0, sizeof(MV_CC_DEVICE_INFO_LIST));// en:Enum devicedo {nRet = MV_CC_EnumDevices(MV_GIGE_DEVICE | MV_USB_DEVICE, &_stDeviceList);if (MV_OK != nRet) {printf("Enum Devices fail! nRet [0x%x]\n", nRet);break;}// en:Show devicesif (_stDeviceList.nDeviceNum > 0) {for (unsigned int i = 0; i < _stDeviceList.nDeviceNum; i++) {printf("[device %d]:\n", i);MV_CC_DEVICE_INFO *pDeviceInfo = _stDeviceList.pDeviceInfo[i];if (nullptr == pDeviceInfo) {break;}PrintDeviceInfo(pDeviceInfo);}} else {printf("Find No Devices!\n");break;}}while(false);
}void EDGE_CAMERA::connectCameras(){for(int device = 0; device < _stDeviceList.nDeviceNum; device++){if (!MV_CC_IsDeviceAccessible(_stDeviceList.pDeviceInfo[device], MV_ACCESS_Exclusive)){PrintDeviceInfo(_stDeviceList.pDeviceInfo[device]);printf("Can't connect %u! ", _stDeviceList.pDeviceInfo[device]->nMacAddrLow);continue;}else{void *handle;PrintDeviceInfo(_stDeviceList.pDeviceInfo[device]);printf("connect %10u!\n", _stDeviceList.pDeviceInfo[device]->nMacAddrLow);int nRet = MV_CC_CreateHandle(&handle, _stDeviceList.pDeviceInfo[device]);_handlesCameraInfos.push_back({handle,nRet}); //save the handle to handlesCameraInfosif (MV_OK != nRet){printf("Create Handle fail! nRet [0x%x]\n", nRet);}}}
}void EDGE_CAMERA::initCamera(void *handle, int createRetStatus, unsigned int cameraIndex) {int nRet;unsigned char * pData = nullptr;do{if (createRetStatus != MV_OK)break;handle = handle;// en:Open devicenRet = MV_CC_OpenDevice(handle);if (MV_OK != nRet) {printf("Open Device fail! nRet [0x%x]\n", nRet);break;}// en:Detection network optimal package size(It only works for the GigE camera)if (MV_GIGE_DEVICE == _stDeviceList.pDeviceInfo[cameraIndex]->nTLayerType) {int nPacketSize = MV_CC_GetOptimalPacketSize(handle);if (nPacketSize > 0) {nRet = MV_CC_SetIntValue(handle, "GevSCPSPacketSize", nPacketSize);if (MV_OK != nRet) {printf("Warning: Set Packet Size fail! nRet [0x%x]!", nRet);}} else {printf("Warning: Get Packet Size fail! nRet [0x%x]!", nPacketSize);}}//en:Set trigger mode as offnRet = MV_CC_SetEnumValue(handle, "TriggerMode", 0);if (MV_OK != nRet) {printf("Set Trigger Mode fail! nRet [0x%x]\n", nRet);break;}// en:Get payload sizeMVCC_INTVALUE stParam;memset(&stParam, 0, sizeof(MVCC_INTVALUE));nRet = MV_CC_GetIntValue(handle, "PayloadSize", &stParam);if (MV_OK != nRet) {printf("Get PayloadSize fail! nRet [0x%x]\n", nRet);break;}unsigned int nPayloadSize = stParam.nCurValue;// en:Init image infoMV_FRAME_OUT_INFO_EX stImageInfo = {0};memset(&stImageInfo, 0, sizeof(MV_FRAME_OUT_INFO_EX));pData = (unsigned char *) malloc(sizeof(unsigned char) * (nPayloadSize));if (nullptr == pData) {printf("Allocate memory failed.\n");break;}memset(pData, 0, sizeof(pData));//  en:Start grab imagenRet = MV_CC_StartGrabbing(handle);if (MV_OK != nRet) {printf("Start Grabbing fail! nRet [0x%x]\n", nRet);break;}_camerasDatas.push_back({handle,pData,nPayloadSize,stImageInfo});// en:Get one frame from camera with timeout=1000ms/*    while (true) {nRet = MV_CC_GetOneFrameTimeout(handle, pData, nPayloadSize, &stImageInfo, 1000);if (MV_OK == nRet) {printf("Get One Frame: Width[%d], Height[%d], FrameNum[%d]\n",stImageInfo.nWidth, stImageInfo.nHeight, stImageInfo.nFrameNum);} else {printf("Get Frame fail! nRet [0x%x]\n", nRet);break;}//  en:Convert image databool bConvertRet = false;cv::Mat img;bConvertRet = Convert2Mat(&stImageInfo, pData, img);cv::namedWindow("img", cv::WINDOW_NORMAL);cv::resizeWindow("img", cv::Size(900, 600));imshow("img", img);cv::waitKey(20);}*/}while(false);/* // en:Stop grab imagenRet = MV_CC_StopGrabbing(handle);if (MV_OK != nRet){printf("Stop Grabbing fail! nRet [0x%x]\n", nRet);break;}// en:Close devicenRet = MV_CC_CloseDevice(handle);if (MV_OK != nRet){printf("ClosDevice fail! nRet [0x%x]\n", nRet);break;}//  en:Input the format to convertprintf("\n[0] OpenCV_Mat\n");printf("[1] OpenCV_IplImage\n");int nFormat = 0;*/}void EDGE_CAMERA::initAllCameras(){unsigned int nCameraIndex = _handlesCameraInfos.size();unsigned int cameraIndex = 0;for(auto handlesCameraInfo:_handlesCameraInfos){initCamera(handlesCameraInfo.handle, handlesCameraInfo.createRetStatus, cameraIndex);cameraIndex++;}
}void EDGE_CAMERA::disPlay() {//initCamera(_handlesCameraInfos[0].handle, _handlesCameraInfos[0].createRetStatus, 0);std::string winName = "img";cv::namedWindow(winName, cv::WINDOW_NORMAL);cv::resizeWindow(winName, cv::Size(900, 600));while (cv::waitKey(50) != 'q') {unsigned int cameraIndex = 0;int nRet = MV_CC_GetOneFrameTimeout(_camerasDatas[0].handle, _camerasDatas[0].pData, _camerasDatas[0].nPayloadSize, &_camerasDatas[0].stImageInfo, 1000);if (MV_OK == nRet) {printf("Get One Frame: Width[%d], Height[%d], FrameNum[%d]\n",_camerasDatas[0].stImageInfo.nWidth, _camerasDatas[0].stImageInfo.nHeight, _camerasDatas[0].stImageInfo.nFrameNum);} else {printf("Get Frame fail! nRet [0x%x]\n", nRet);break;}//  en:Convert image databool bConvertRet = false;cv::Mat img;bConvertRet = Convert2Mat(&_camerasDatas[0].stImageInfo, _camerasDatas[0].pData, img);imshow(winName, img);cv::waitKey(20);}}bool EDGE_CAMERA::getAndProcessImg() {int nRet = MV_OK;void* handle = nullptr;unsigned char * pData = nullptr;do{MV_CC_DEVICE_INFO_LIST stDeviceList;memset(&stDeviceList, 0, sizeof(MV_CC_DEVICE_INFO_LIST));// en:Enum devicenRet = MV_CC_EnumDevices(MV_GIGE_DEVICE | MV_USB_DEVICE, &stDeviceList);if (MV_OK != nRet){printf("Enum Devices fail! nRet [0x%x]\n", nRet);break;}// en:Show devicesif (stDeviceList.nDeviceNum > 0){for (unsigned int i = 0; i < stDeviceList.nDeviceNum; i++){printf("[device %d]:\n", i);MV_CC_DEVICE_INFO* pDeviceInfo = stDeviceList.pDeviceInfo[i];if (nullptr == pDeviceInfo){break;}PrintDeviceInfo(pDeviceInfo);}}else{printf("Find No Devices!\n");break;}// en:Select deviceunsigned int nIndex = 0;while (true){printf("Please Input camera index(0-%d): ", stDeviceList.nDeviceNum - 1);if (1 == scanf("%d", &nIndex)){while (getchar() != '\n'){;}if (nIndex >= 0 && nIndex < stDeviceList.nDeviceNum){if (!MV_CC_IsDeviceAccessible(stDeviceList.pDeviceInfo[nIndex], MV_ACCESS_Exclusive)){printf("Can't connect! ");continue;}break;}}else{while (getchar() != '\n'){;}}}// en:Create handlenRet = MV_CC_CreateHandle(&handle, stDeviceList.pDeviceInfo[nIndex]);if (MV_OK != nRet){printf("Create Handle fail! nRet [0x%x]\n", nRet);break;}// en:Open devicenRet = MV_CC_OpenDevice(handle);if (MV_OK != nRet){printf("Open Device fail! nRet [0x%x]\n", nRet);break;}// en:Detection network optimal package size(It only works for the GigE camera)if (MV_GIGE_DEVICE == stDeviceList.pDeviceInfo[nIndex]->nTLayerType){int nPacketSize = MV_CC_GetOptimalPacketSize(handle);if (nPacketSize > 0){nRet = MV_CC_SetIntValue(handle, "GevSCPSPacketSize", nPacketSize);if (MV_OK != nRet){printf("Warning: Set Packet Size fail! nRet [0x%x]!", nRet);}}else{printf("Warning: Get Packet Size fail! nRet [0x%x]!", nPacketSize);}}//en:Set trigger mode as offnRet = MV_CC_SetEnumValue(handle, "TriggerMode", 0);if (MV_OK != nRet){printf("Set Trigger Mode fail! nRet [0x%x]\n", nRet);break;}// en:Get payload sizeMVCC_INTVALUE stParam;memset(&stParam, 0, sizeof(MVCC_INTVALUE));nRet = MV_CC_GetIntValue(handle, "PayloadSize", &stParam);if (MV_OK != nRet){printf("Get PayloadSize fail! nRet [0x%x]\n", nRet);break;}unsigned int nPayloadSize = stParam.nCurValue;// en:Init image infoMV_FRAME_OUT_INFO_EX stImageInfo = { 0 };memset(&stImageInfo, 0, sizeof(MV_FRAME_OUT_INFO_EX));pData = (unsigned char *)malloc(sizeof(unsigned char)* (nPayloadSize));if (nullptr == pData){printf("Allocate memory failed.\n");break;}memset(pData, 0, sizeof(pData));//  en:Start grab imagenRet = MV_CC_StartGrabbing(handle);if (MV_OK != nRet){printf("Start Grabbing fail! nRet [0x%x]\n", nRet);break;}// en:Get one frame from camera with timeout=1000msnRet = MV_CC_GetOneFrameTimeout(handle, pData, nPayloadSize, &stImageInfo, 1000);if (MV_OK == nRet){printf("Get One Frame: Width[%d], Height[%d], FrameNum[%d]\n",stImageInfo.nWidth, stImageInfo.nHeight, stImageInfo.nFrameNum);}else{printf("Get Frame fail! nRet [0x%x]\n", nRet);break;}// en:Stop grab imagenRet = MV_CC_StopGrabbing(handle);if (MV_OK != nRet){printf("Stop Grabbing fail! nRet [0x%x]\n", nRet);break;}// en:Close devicenRet = MV_CC_CloseDevice(handle);if (MV_OK != nRet){printf("ClosDevice fail! nRet [0x%x]\n", nRet);break;}//  en:Input the format to convertprintf("\n[0] OpenCV_Mat\n");printf("[1] OpenCV_IplImage\n");int nFormat = 0;while (1){printf("Please Input Format to convert: ");if (1 == scanf("%d", &nFormat)){if (0 == nFormat || 1 == nFormat){break;}}while (getchar() != '\n'){;}}//  en:Convert image databool bConvertRet = false;cv::Mat img;if (OpenCV_Mat == nFormat){bConvertRet = Convert2Mat(&stImageInfo, pData, img);}else if (OpenCV_IplImage == nFormat){bConvertRet = Convert2Ipl(&stImageInfo, pData);}//  en:Print resultif (bConvertRet){printf("OpenCV format convert finished.\n");}else{printf("OpenCV format convert failed.\n");}} while (0);// en:Destroy handleif (handle){MV_CC_DestroyHandle(handle);handle = nullptr;}// en:Free memeryif (pData){free(pData);pData = nullptr;}return true;
}void EDGE_CAMERA::saveImg(std::string path,unsigned int cameraIndex){}

Main函数

int main(int argc, char **argv){EDGE_CAMERA camera;camera.findCameras();camera.connectCameras();camera.initAllCameras();camera.disPlay();}

执行效果

在这里插入图片描述

注意

我是编译了一个动态库cameraAPI,main函数是链接的camkeraAPI。上面是把最重要的代码给贴出来了。不是完整的工程哈。

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

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

相关文章

CausalEGM:通过编码生成建模的通用因果推理框架

英文题目&#xff1a;CausalEGM: a general causal inference framework by encoding generative modeling 中文题目&#xff1a;CausalEGM&#xff1a;通过编码生成建模的通用因果推理框架 单位&#xff1a;斯坦福大学统计系 时间&#xff1a;2023 论文链接&#xff1a;ht…

ceph对象三元素data、xattr、omap

这里有一个ceph的原则&#xff0c;就是所有存储的不管是块设备、对象存储、文件存储最后都转化成了底层的对象object&#xff0c;这个object包含3个元素data&#xff0c;xattr&#xff0c;omap。data是保存对象的数据&#xff0c;xattr是保存对象的扩展属性&#xff0c;每个对象…

java+ssm+mysql农场信息管理系统

项目介绍&#xff1a; 本系统为基于jspssmmysql的农场信息管理系统&#xff0c;功能如下&#xff1a; 用户&#xff1a;注册登录系统&#xff0c;菜地信息管理&#xff0c;农作物信息管理&#xff0c;种植信息管理&#xff0c;客户信息管理&#xff0c;商家信息管理&#xff…

BingChat与ChatGPT比较,哪个聊天机器人能让你获益更多?

人工智能领域的最新进展为普通人创造新的收入来源提供了更多机会。今年早些时候&#xff0c;微软对OpenAI进行了大量投资。此后&#xff0c;微软在Microsoft Edge浏览器中推出了自家的聊天机器人Bing Chat。 在论坛和社交媒体上&#xff0c;你可以发现这两个AI工具都吸引了很…

Property ‘sqlSessionFactory‘ or ‘sqlSessionTemplate‘ are required

项目场景&#xff1a; 最近因为公司业务需要在搭一个新架构&#xff0c;用的springboot3和jdk17,在整合mybatis多数据源的时候报错 &#xff08;引用的mybatisplus 和 mybatisplusjion的是最新的包-2023-08-26&#xff09; Error creating bean with name ‘XXXServiceImpl’:…

[已解决] wget命令出现Unable to establish SSL connection.错误

问题 从win11上下载best.ckpt包时 遇到&#xff1a; Unable to establish SSL connection.错误 解决方案&#xff1a; 加上参数&#xff1a; 加上跳过验证证书的参数--no-check-certificate 有些网站不允许通过非浏览器的方式进行下载&#xff0c;使用代理既可以解决问题&am…

【C++入门】模版初阶(泛型编程)

目录 1.泛型编程2.函数模版2.1函数模版的概念2.2函数模版的使用2.3函数模版的原理2.4函数模版的实例化2.5 模板参数的匹配原则 3.类模版3.1类模版的定义格式3.2类模版的实例化 1.泛型编程 让我们思考一个小问题&#xff1a;如何实现一个通用的交换函数呢&#xff1f; 在解决这…

构建个人博客_Obsidian_github.io_hexo

1 初衷 很早就开始分享文档&#xff0c;以技术类的为主&#xff0c;一开始是 MSN&#xff0c;博客&#xff0c;随着平台的更替&#xff0c;后来又用了 CSDN&#xff0c;知乎&#xff0c;简书…… 再后来是 Obsidian&#xff0c;飞书&#xff0c;Notion&#xff0c;常常有以下困…

ElasticSearch基础知识汇总

文章目录 前言一、认识ElasticSearch1.正向索引和倒排索引2. MySql与ElasticSearc3.IK分词器 二、ES索引库操作1.mapping映射属性2.索引库的CRUD 三、ES文档库操作 前言 Elasticsearch是一个基于Lucene的搜索服务器。它提供了一个分布式多用户能力的全文搜索引擎&#xff0c;基…

详解过滤器Filter和拦截器Interceptor的区别和联系

目录 前言 区别 联系 前言 过滤器(Filter)和拦截器(Interceptor)都是用于在Web应用程序中处理请求和响应的组件&#xff0c;但它们在实现方式和功能上有一些区别。 区别 1. 实现方式&#xff1a; - 过滤器是基于Servlet规范的组件&#xff0c;通过实现javax.servlet.Filt…

【如何对公司网络进行限速?一个案例详解】

有不少朋友问到了关于企业网络QoS配置&#xff0c;这个确实在实际网络应用中非常多&#xff0c;基本上大部分企业或个人都用到这个功能&#xff0c;本期我们详细了解下QoS如何对宽带进行限制&#xff0c;QoS如何企业中应用。 一、什么是QoS? Qos是用来解决网络延迟和阻塞等问…

JVM 内存大对象监控和优化实践

作者&#xff1a;vivo 互联网服务器团队 - Liu Zhen、Ye Wenhao 服务器内存问题是影响应用程序性能和稳定性的重要因素之一&#xff0c;需要及时排查和优化。本文介绍了某核心服务内存问题排查与解决过程。首先在JVM与大对象优化上进行了有效的实践&#xff0c;其次在故障转移与…