飞利浦双串口51单片机485网关

主要功能将PC端的数据接收下来,分发到不同的设备,也是轮询设备数据读取回来,打包回传到PC端,数据包包头包尾识别,数据校验,接收超时处理,将协议结构化处理,协议的改动不需要改动程序,中断接收一帧完成置标志位交由上层协议程序校验并处理转发

协议格式定义,每一个位都进行了定仪

#ifndef PROTOCOL_H
#define PROTOCOL_H
#include "define.h"
//IO_EMM_31
typedef struct 
{uchar Stx;uchar Length;uchar ID;uchar TollCollectorID[3];uchar LoginDuration[2];uchar VehicleClass;union{uchar byte;struct{uchar Payment:4;uchar Axle:4;}BIT;}AxlePaymentDisplay;union{uint word;uchar byte[2];}TollFare;union{uchar byte;struct{			uchar reserved:1;uchar Exit_LSS_Rlight:1;uchar BarrierClose:1;uchar BarrierOpen:1;uchar Entry_LSS_Rlight:1;uchar Entry_LSS_Glight:1;uchar LaneLog:1;uchar zero:1;}BIT;}TMU_Control1;union{uchar byte;struct{uchar EmergencyAlarm:1;uchar EvasionAlarm:1;uchar DiscrepancyAlarm:1;uchar MisregistrationAlarm:1;uchar reserved:1;uchar AxleDectorFault:1;uchar BoothEquipmentFault:1;uchar zero:1;}BIT;}TMU_Control2;union{uchar byte;struct{uchar EmergencyAlarmRstBut:1;uchar EvalsionAlarmRstBut:1;uchar DiscrepancyAlarmRstBut:1;uchar MisregistrationAlarmRstBut:1;uchar AxleDetectorOVerride:1;uchar KeyInOverrideSelect:1;uchar reserved:1;uchar zero:1;}BIT;}ConStatus1;union{uchar byte;struct{uchar resetved:4;uchar TMUCommFail:1;uchar TMUDimmerOverAct:1;uchar AllSignageDimmming:1;uchar zero:1;}BIT;}ConStatus2;union{uchar byte;struct{uchar reserved:1;uchar CanopyBeacon:1;uchar Entry_LSS_Rlight:1;uchar Entry_LSS_Glight:1;uchar TPS_Glight:1;uchar TPS_Rlight:1;uchar DimmingNormal:1;uchar zero:1;}BIT;}SignageControl;union{uchar byte;struct{uchar TPSCommFail:1;uchar reserve2:1;uchar reserve1:1;uchar TPSTempHigher70:1;uchar CLSCommFail:1;uchar CLSPixelFaultDetect:1;uchar CLSTempHigher70:1;uchar zero:1;}BIT;}TPS_CLSFaultStatus;union{uchar byte;struct{uchar EntryCommFail:1;uchar ExitCommFail:1;uchar RlightAspectHigher50:1;uchar RlightAspectHigher25:1;uchar TempHigher70:1;uchar reseved:1;uchar Rlight:1;uchar zero:1;}BIT;}ExitLSSStatus;union{uchar byte;struct{uchar GlightAspectHigher50:1;uchar GlightAspectHigher25:1;uchar RlightAspectHigher50:1;uchar RlightAspectHigher25:1;uchar TempHigher70:1;uchar Glight:1;uchar Rlight:1;uchar zero:1;}BIT;}EntryLSSStatus;union{uchar byte;struct{uchar ShortDetect:1;uchar reserved:2;uchar KickBarAlarm:1;uchar CabinetOpen:1;uchar BarrierColse:1;uchar BarrierOpen:1;uchar zero:1;}BIT;}LocalIOInputStatus;union{uchar byte;struct{uchar Class0:1;uchar Class1:1;uchar Class2:1;uchar Class3:1;uchar Class4:1;uchar Class5:1;uchar Class6:1;uchar zero:1;}BIT;}AutoTollInputStatus1;union{uchar byte;struct{uchar Class7:1;uchar Class8:1;uchar Class9:1;uchar ClassAdd1:1;uchar LaneOpen:1;uchar LaneClose:1;uchar reserved:1;uchar zero:1;}BIT;}AutoTollInputStatus2;union{uchar byte;struct{uchar Axle1:1;uchar Axle2:1;uchar Axle3:1;uchar Axle4:1;uchar Axle5:1;uchar Axle6:1;uchar reserved:1;uchar zero:1;}BIT;}AutoTollInputStatus3;uchar Checksum;uchar Etx;
}IO_EMM_31;//IO_EMM_32
typedef struct
{uchar Stx;uchar Length;uchar ID;union{uchar byte;struct{uchar reserved:1;uchar Dimmer:3;uchar Normal:3;uchar zero:1;}BIT;}TPSSetting;union{uchar byte;struct{uchar reserved:1;uchar Dimmer:3;uchar Normal:3;uchar zero:1;}BIT;}CLSSetting;union{uchar byte;struct{uchar reserved:1;uchar Dimmer:3;uchar Normal:3;uchar zero:1;}BIT;}EntryLSSSetting;union{uchar byte;struct{uchar reserved:1;uchar Dimmer:3;uchar Normal:3;uchar Zero:1;}BIT;}ExitLSSSetting;uchar Checksum;uchar Etx;
}IO_EMM_32;//IO_TMU
typedef struct
{uchar Stx;uchar Length;uchar ID;uchar TollCollectorID[3];uchar LoginDuration[2];uchar VehicleClass;union{uchar byte;struct{uchar Payment:4;uchar Axle:4;}BIT;}AxlePaymentDisplay;union{uchar byte;struct{			uchar reserved:1;uchar Exit_LSS_Rlight:1;uchar BarrierClose:1;uchar BarrierOpen:1;uchar Entry_LSS_Rlight:1;uchar Entry_LSS_Glight:1;uchar LaneLog:1;uchar zero:1;}BIT;}TMU_Control1;union{uchar byte;struct{uchar EmergencyAlarm:1;uchar EvasionAlarm:1;uchar DiscrepancyAlarm:1;uchar MisregistrationAlarm:1;uchar reserved:1;uchar AxleDectorFault:1;uchar BoothEquipmentFault:1;uchar zero:1;}BIT;}TMU_Control2;union{uchar byte;struct{uchar EmergencyAlarmRstBut:1;uchar EvalsionAlarmRstBut:1;uchar DiscrepancyAlarmRstBut:1;uchar MisregistrationAlarmRstBut:1;uchar AxleDetectorOVerride:1;uchar KeyInOverrideSelect:1;uchar reserved:1;uchar zero:1;}BIT;}ConStatus1;union{uchar byte;struct{uchar resetved:5;uchar TMUDimmerOverAct:1;uchar AllSignageDimming:1;uchar zero:1;}BIT;}ConStatus2;uchar Checksum;uchar Etx;
}IO_TMU;//IO_TPS
typedef struct
{uchar Stx;uchar Length;uchar ID;union{uint word;uchar byte[2];}TollFare;union{uchar byte;struct{uchar DispPleasePaid:1;uchar DispThankyou:1;uchar Rlight:1;uchar Glight:1;uchar BrightnessControl:3;uchar reserved:1;}BIT;}LedDisplay;union{uchar byte;struct{uchar TempHigher70:1;uchar reserved:7;}BIT;}Status;uchar Checksum;uchar Etx;
}IO_TPS;//IO_CLS
typedef struct
{uchar Stx;uchar Length;uchar ID;uchar VehicleClass;union{uchar byte;struct{uchar Axle:3;uchar reserved1:1;uchar RelayContactClose:1;uchar reserved2:3;}BIT;}AxleCounterDisplay;union{uchar byte;struct{uchar reserved:4;uchar Brightness:3;uchar zero:1;}BIT;}BrightnessControl;union{uchar byte;struct{uchar TempHigher70:1;uchar PixelFaultDetected:1;uchar reserved:6;}BIT;}Status;uchar Checksum;uchar Etx;
}IO_CLS;//IO_LSS
typedef struct
{uchar Stx;uchar Length;uchar ID;union{uchar byte;struct{uchar Rlight:1;uchar Glight:1;uchar reserved:6;			}BIT;}SignalDisp;union{uchar byte;struct{uchar RlightAspectHigher25:1;uchar RlightAspectHigher50:1;uchar GlightAspectHigher25:1;uchar GlightAspectHigher50:1;uchar BrightnessControl:3;uchar reserved:1;			}BIT;}Status1;union{uchar byte;struct{uchar TempHigher70:1;uchar reserved:7;}BIT;}Status2;uchar Checksum;uchar Etx;
}IO_LSS;typedef struct
{uchar Dimmer;uchar Normal;
}BRIGHTNESS;
#endif

中断接收与发送

void IntUart0Rx( void ) interrupt 4
{uchar temp;static uchar MsgLen;if( RI_0 ){RI_0 = 0;temp = S0BUF;Timer1ms[TIMER_COM_DEV].Tick = 10;Timer1ms[TIMER_COM_DEV].Flg.BIT.Enable = 1;Timer[TIMER_RESPONSE].Tick = 5;ACC = temp;if( P==RB8_0 ){if( !DevStrEndFlg ){if( temp==0xaa ){									  DevStrEndFlg = 1;IO2Dev.RecvPtr = 0;IO2Dev.RecvBuf[IO2Dev.RecvPtr++] = temp;IO2Dev.Error.byte = 0;}}else{if( temp==0xab && IO2Dev.RecvPtr==MsgLen ){DevStrEndFlg = 0;IO2Dev.RecvBuf[IO2Dev.RecvPtr++] = temp;IO2Dev.Flg.BIT.Recv = 1;IO2Dev.RecvLen = IO2Dev.RecvPtr;}/*else if( temp==0xaa  && IO2Dev.RecvPtr!=MsgLen-1 ){IO2Dev.RecvPtr = 0;IO2Dev.RecvBuf[IO2Dev.RecvPtr++] = temp;}*/else if( IO2Dev.RecvPtr==2 ){IO2Dev.ID = temp;IO2Dev.RecvBuf[IO2Dev.RecvPtr++] = temp;switch( IO2Dev.ID ){case IO_TMU_ID:MsgLen = sizeof( IO_TMU )-1;break;case IO_TPS_ID:MsgLen = sizeof( IO_TPS )-1;break;case IO_CLS_ID:MsgLen = sizeof( IO_CLS )-1;break;case IO_ELSS_ID:MsgLen = sizeof( IO_LSS )-1;break;case IO_XLSS_ID:MsgLen = sizeof( IO_LSS )-1;break;default:DevStrEndFlg = 0;}}else if( IO2Dev.RecvPtr<RECVBUF_LEN ){IO2Dev.RecvBuf[IO2Dev.RecvPtr++] = temp;}else  //接收数据溢出{DevStrEndFlg = 0;IO2Dev.RecvPtr = 0;}
//				flg = IO2Dev.RecvPtr;}}else{IO2Dev.Error.BIT.Even = 1;}}else if( S0STAT&0x08 )//Framing Error{S0STAT &= ~0x08;IO2Dev.Error.BIT.Framing = 1;}else if( S0STAT&0x04 )//Break Detect{S0STAT &= ~0x04;IO2Dev.Error.BIT.BreakDetect = 1;}else if( S0STAT&0x02 )//Overrun Error{S0STAT &= ~0x02;IO2Dev.Error.BIT.Overrun = 1;}
}//串行口0的发送中断程序
void IntUart0Tx( void ) interrupt 7
{Uart0SendData();
}

以指针提取数据
在这里插入图片描述

#include "Emm2IO.h"
#include "com.h"
#include "protocol.h"
#include "systemtask.h"
#include "IOCheck.h"IO_EMM_31 IOEmm31;
extern BUF_DEF Emm2IO;
extern IO_TMU IOTmu;
extern IO_TPS IOTps;
extern IO_CLS IOCls;
extern IO_LSS IOEntryLss;
extern IO_LSS IOExitLss;
extern BRIGHTNESS TpsBrightness,ClsBrightness,EntryLssBrightness,ExitLssBrightness;extern IO_CHECK_DEF IoCheck;
extern TIMER_DEF Timer[TIMER_NUM];
extern uchar flg;
void Emm2IOInit( void )
{//31IOEmm31.Stx = 0xaa;IOEmm31.Length = 0x18;IOEmm31.ID = 0x20;IOEmm31.ConStatus1.byte = 0;IOEmm31.ConStatus2.byte = 0x10;IOEmm31.TPS_CLSFaultStatus.byte = 0x11;IOEmm31.ExitLSSStatus.byte = 0x03;IOEmm31.EntryLSSStatus.byte = 0x00;IOEmm31.LocalIOInputStatus.byte = 0x00;IOEmm31.AutoTollInputStatus1.byte = 0x00;IOEmm31.AutoTollInputStatus2.byte = 0x00;IOEmm31.AutoTollInputStatus3.byte = 0x00;IOEmm31.Etx = 0xab;Emm2IO.Flg.byte = 0;Emm2IO.SendLen = 0;Emm2IO.RecvLen = 0;Emm2IO.SendPtr = 0;Emm2IO.RecvPtr = 0;Timer[TIMER_STOP].Flg.BIT.TimeOut = 0;Timer[TIMER_STOP].Tick = 500;Timer[TIMER_STOP].Flg.BIT.Enable = 1;
}
//从Emm2IOController31的接收数据中取出需要的内容放到设备缓冲区中
void CopyEmm31ToDev( IO_EMM_31 *IoEmm31Ptr )
{//TMUIOTmu.TollCollectorID[0] = IoEmm31Ptr->TollCollectorID[0];IOTmu.TollCollectorID[1] = IoEmm31Ptr->TollCollectorID[1];IOTmu.TollCollectorID[2] = IoEmm31Ptr->TollCollectorID[2];IOTmu.LoginDuration[0] = IoEmm31Ptr->LoginDuration[0];IOTmu.LoginDuration[1] = IoEmm31Ptr->LoginDuration[1];IOTmu.VehicleClass = IoEmm31Ptr->VehicleClass;IOTmu.AxlePaymentDisplay.byte = IoEmm31Ptr->AxlePaymentDisplay.byte;IOTmu.TMU_Control1.byte = IoEmm31Ptr->TMU_Control1.byte;IOTmu.TMU_Control2.byte = IoEmm31Ptr->TMU_Control2.byte;//TPSIOTps.TollFare.byte[0] = IoEmm31Ptr->TollFare.byte[0];IOTps.TollFare.byte[1] = IoEmm31Ptr->TollFare.byte[1];IOTps.LedDisplay.BIT.Glight = IoEmm31Ptr->SignageControl.BIT.TPS_Glight;IOTps.LedDisplay.BIT.Rlight = IoEmm31Ptr->SignageControl.BIT.TPS_Rlight;if( (((IoEmm31Ptr->TollFare.byte[0]&0xf0)>>4) == 0x000c) && (IoEmm31Ptr->AxlePaymentDisplay.BIT.Payment == 0x0b) ){IOTps.LedDisplay.BIT.DispPleasePaid = 1;IOTps.LedDisplay.BIT.DispThankyou = 0;}else if( (((IoEmm31Ptr->TollFare.byte[0]&0xf0)>>4) == 0x0000c) && (IoEmm31Ptr->AxlePaymentDisplay.BIT.Payment != 0x0b) ){IOTps.LedDisplay.BIT.DispPleasePaid = 0;IOTps.LedDisplay.BIT.DispThankyou = 1;}else if( ((IoEmm31Ptr->TollFare.byte[0]&0xf0)>>4) == 0x0000b ){IOTps.LedDisplay.BIT.DispPleasePaid = 0;IOTps.LedDisplay.BIT.DispThankyou = 0;}else{IOTps.LedDisplay.BIT.DispPleasePaid = 0;IOTps.LedDisplay.BIT.DispThankyou = 0;}//CLSIOCls.VehicleClass = IoEmm31Ptr->VehicleClass;if( IoEmm31Ptr->AxlePaymentDisplay.BIT.Axle>0 && IoEmm31Ptr->AxlePaymentDisplay.BIT.Axle<7 ){IOCls.AxleCounterDisplay.BIT.Axle = IoEmm31Ptr->AxlePaymentDisplay.BIT.Axle;}else{IOCls.AxleCounterDisplay.BIT.Axle = 0;}IOCls.AxleCounterDisplay.BIT.RelayContactClose = IoEmm31Ptr->SignageControl.BIT.CanopyBeacon;//EntryLSSIOEntryLss.SignalDisp.BIT.Rlight = IoEmm31Ptr->SignageControl.BIT.Entry_LSS_Rlight;if( IoEmm31Ptr->SignageControl.BIT.Entry_LSS_Glight && IOEmm31.LocalIOInputStatus.BIT.BarrierOpen &&!IOEmm31.LocalIOInputStatus.BIT.BarrierColse ){IOEntryLss.SignalDisp.BIT.Glight = 1;IOEntryLss.SignalDisp.BIT.Rlight = 0;}else{IOEntryLss.SignalDisp.BIT.Glight = 0;IOEntryLss.SignalDisp.BIT.Rlight = 1;}//ExitLSSif( IoEmm31Ptr->SignageControl.BIT.DimmingNormal ){IOTps.LedDisplay.BIT.BrightnessControl = TpsBrightness.Dimmer;IOCls.BrightnessControl.BIT.Brightness = ClsBrightness.Dimmer;IOEntryLss.Status1.BIT.BrightnessControl = EntryLssBrightness.Dimmer;IOExitLss.Status1.BIT.BrightnessControl = ExitLssBrightness.Dimmer;}else{IOTps.LedDisplay.BIT.BrightnessControl = TpsBrightness.Normal;IOCls.BrightnessControl.BIT.Brightness = ClsBrightness.Normal;IOEntryLss.Status1.BIT.BrightnessControl = EntryLssBrightness.Normal;IOExitLss.Status1.BIT.BrightnessControl = ExitLssBrightness.Normal;}
}
//从接收的Emm2IOController31的数据更新Emm31缓冲区
void CopyEmm31ToEmm31Buf( IO_EMM_31 *IoEmm31Ptr )
{uchar *Sptr,*Dptr,i;Sptr = (uchar*)IoEmm31Ptr;Dptr = (uchar*)&IOEmm31;for( i=0; i<11; i++ ){*(Dptr+i+3) = *(Sptr+i+3);}*(Dptr+16) = *(Sptr+16);
}
//更新各设备的亮度值
void CopyEmm32ToDev( IO_EMM_32 *IoEmm32Ptr )
{//TPSTpsBrightness.Dimmer = IoEmm32Ptr->TPSSetting.BIT.Dimmer;TpsBrightness.Normal = IoEmm32Ptr->TPSSetting.BIT.Normal;//CLSClsBrightness.Dimmer = IoEmm32Ptr->CLSSetting.BIT.Dimmer;ClsBrightness.Normal = IoEmm32Ptr->CLSSetting.BIT.Normal;//EntryLSSEntryLssBrightness.Dimmer = IoEmm32Ptr->EntryLSSSetting.BIT.Dimmer;EntryLssBrightness.Normal = IoEmm32Ptr->EntryLSSSetting.BIT.Normal;//ExitLSSExitLssBrightness.Dimmer = IoEmm32Ptr->ExitLSSSetting.BIT.Dimmer;ExitLssBrightness.Normal = IoEmm32Ptr->ExitLSSSetting.BIT.Normal;
}
//判断是否已从EMM接收完整的数据包,并进行处理
void Emm2IOMain( void )
{uchar ver,*ptr;IO_EMM_31 *IoEmm31Ptr;IO_EMM_32 *IoEmm32Ptr;if( Emm2IO.Flg.BIT.Recv ){Emm2IO.Flg.BIT.Recv = 0;Timer[TIMER_STOP].Tick = 500;Timer[TIMER_STOP].Flg.BIT.Enable = 1;if( Emm2IO.Error.byte == 0 ){ver = Checksum( &Emm2IO.RecvBuf[1],Emm2IO.RecvLen-3 );if( Emm2IO.ID==EMM_IO31_ID ){IoEmm31Ptr = (IO_EMM_31 *)Emm2IO.RecvBuf;if( ver==IoEmm31Ptr->Checksum ){CopyEmm31ToDev( IoEmm31Ptr );CopyEmm31ToEmm31Buf( IoEmm31Ptr );ptr = (uchar*)&IOEmm31;ptr++;
//					IOEmm31.AutoTollInputStatus3.byte = IoCheck.SaveState.byte[3];
//					IOEmm31.LocalIOInputStatus.byte = IoCheck.SaveState.byte[0];
//					IOEmm31.AutoTollInputStatus1.byte = IoCheck.SaveState.byte[1];
//					IOEmm31.AutoTollInputStatus2.byte = IoCheck.SaveState.byte[2];
//					IOEmm31.AutoTollInputStatus3.byte = IoCheck.SaveState.byte[3];ver = Checksum( ptr,sizeof(IO_EMM_31)-3 );IOEmm31.Checksum = ver;CopyToUart1SendBuf( (uchar*)&IOEmm31, sizeof(IO_EMM_31) );}}else if( Emm2IO.ID==EMM_IO32_ID ){IoEmm32Ptr = (IO_EMM_32 *)Emm2IO.RecvBuf;if( ver==IoEmm32Ptr->Checksum ){CopyEmm32ToDev( IoEmm32Ptr );CopyToUart1SendBuf( (uchar*)IoEmm32Ptr, sizeof(IO_EMM_32) );}}}else{Emm2IO.Error.byte = 0;}Emm2IO.RecvPtr = 0;Emm2IO.ID = 0;}//When no polling with EMM > 5 seconds.if( Timer[TIMER_STOP].Flg.BIT.TimeOut ){Timer[TIMER_STOP].Flg.BIT.TimeOut = 0;//TMUIOTmu.TollCollectorID[0] = 0x0b;IOTmu.TollCollectorID[1] = 0xbb;IOTmu.TollCollectorID[2] = 0xbb;IOTmu.LoginDuration[0] = 0xbb;IOTmu.LoginDuration[1] = 0xbb;IOTmu.VehicleClass = 0xbb;IOTmu.AxlePaymentDisplay.byte = 0xbb;IOTmu.TMU_Control1.byte = 0x00;IOTmu.TMU_Control2.byte = 0x40;//TPSIOTps.TollFare.word = 0xbbbb;IOTps.LedDisplay.BIT.Rlight = 1;IOTps.LedDisplay.BIT.Glight = 0;IOTps.LedDisplay.BIT.DispPleasePaid = 0;IOTps.LedDisplay.BIT.DispThankyou = 0;//CLSIOCls.VehicleClass = 0xbb;IOCls.AxleCounterDisplay.byte = 0x00;//Entry LssIOEntryLss.SignalDisp.byte = 0x01;//Exit LssIOExitLss.SignalDisp.byte = 0x01;}
}

主程序循环,
在这里插入图片描述
代码多年前写,基于飞利浦双串口51单片机,程序结构是大循环前后台标志,就算现在用上了linux、rtos等的方式,程序接收处理方式差别不大,只是实现起来更简单

下面是完整工程连接
链接:https://pan.baidu.com/s/1bXOrMRH6Gf7kcjra4uANtA?pwd=1234
提取码:1234

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

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

相关文章

【数据结构】Map和Set

Map和Set 1. 搜索树 1.1 概念 二叉搜索树是左子树比根节点小&#xff0c;右子树比根节点大的二叉树。&#xff08;如果左右子树不为空的话是这样&#xff0c;但是左右子树也可以为空&#xff09; 1.2 操作——查找 查找的思想与二分查找类似。 如果根节点的值和所要查找的…

前端知识与基础应用

前端知识 什么是前端&#xff1a;所有和用户打交道的操作页面&#xff0c;我们都称之为前端 例如&#xff1a;pc页面&#xff0c;浏览器的主页面&#xff0c;手机页面等等&#xff0c;可以用肉眼看到的就是前端 什么是后端&#xff1a; 就是一堆代码&#xff0c;用户不能够直接…

Kitex踩坑 [Error] KITEX: processing request error,i/o timeout

报错问题 2023/010/28 17:20:10.250768 default_server_handler.go:234: [Error] KITEX: processing request error, remoteService, remoteAddr127.0.0.1:65425, errordefault codec read failed: read tcp 127.0.0.1:8888->127.0.0.1:65425: i/o timeout 分析原因 Hert…

内置视图联动查看器,实现数据关联分析

前言 在数据驱动业务发展的今天&#xff0c;数据的关联分析变得越来越重要。作为一种强大的数据挖掘工具&#xff0c;它可以帮助企业发现数据之间的关联和模式&#xff0c;从而更好地理解市场和客户的行为。通过关联分析&#xff0c;企业可以发现看似无关的数据之间的联系&…

假如我有一台服务器,我会让它提供三种服务

一、提供照片上传、存储和下载服务 随着移动互联网时代的持续快速发展&#xff0c;PC互联网日益势微&#xff0c;各大互联网门户网站的博客、空间也跟着凋零&#xff0c; 作为博客、空间的标配功能的相册也随之被关闭。 2019年3月6日网易相册发布停运公告并于当年5月8日正式停…

在线主动学习算法评估策略:prequential evaluation procedure

在线主动学习算法评估策略&#xff1a;prequential evaluation procedure 在在线主动学习领域(Online Active Learning)&#xff0c;对在线主动学习算法的评估策略有多种方法&#xff0c;而现如今常用的方法是prequential evaluation procedure(出自论文《High density-focuse…

SpringBoot 源码分析(四) 内置Tomcat分析

一、Tomcat相关知识 1. tomcat目录结构 Tomcat文件的目录结构 2.启动流程 启动一个Tomcat服务是执行的bin目录下的脚本程序&#xff0c;startup.bat和 startup.sh.一个是windows的脚本&#xff0c;一个是Linux下的脚本&#xff0c;同样还可以看到两个停止的脚本 shutdown.ba…

Java入门与实践

Java基础 Java入门 idea的使用 idea快捷键 crtlaltt 对选中的代码弹出环绕选项弹出层 问题描述&#xff1a;idea光标变小黑块 解决&#xff1a;误触Insert键&#xff0c;再次按Insert键即可 java基础语法 注释 //单行注释/* 多行注释 *//** 文档注释&#xff0c;可提取到…

车载网关产品解析(附:车载网关详细应用案例及部署流程)

5G车载网关是一款功能强大的工业级无线通讯设备。它集成了4G/5G双模网络模块、M12接口设计、强大的路由和安全功能等特性,可以为车载和移动应用提供稳定可靠的无线数据连接。 链接直达&#xff1a;https://www.key-iot.com/iotlist/sv900.html ### 产品特性 5G车载网关最大的…

【多线程】线程互斥 {多执行流并发执行的数据竞争问题,互斥锁的基本用法,pthread_mutex系列函数,互斥锁的原理;死锁;可重入函数和线程安全}

一、进程线程间通信的相关概念 临界资源&#xff1a;多线程执行流共享的资源就叫做临界资源。确切的说&#xff0c;临界资源在同一时刻只能被一个执行流访问。临界区&#xff1a;每个线程内部&#xff0c;访问临界资源的代码&#xff0c;就叫做临界区。互斥&#xff1a;通过互…

计算机网络基础三

课程目标 理解路由表的作用 能够读懂路由表信息 能够使用图形抓包工具 wireshark 进行数据包的抓取 &#xff0c;如&#xff08; TCP/IP 的三次握手四次断开&#xff09; 一、路由表 思考&#xff1a; 什么是交换,什么是路由,什么是路由表&#xff1f;1. 交换是指同网络访…

Linux C语言开发-D15一维数组

数组&#xff1a;有一定顺序关系的数据类型相同变量的变量集合 形式&#xff1a;<存储类型> <数据类型> <数组名> [<表达式>] 数组名表示内存首地址&#xff0c;是一个地址常量&#xff0c;sizeof(数组名)是数组占用的总内存空间 编译时分配连续内存…

常见的22个软件测试面试题(含答案解析)

大家好&#xff0c;我是大圣。今天大圣给大家列举了API测试的22个面试题&#xff0c;快来看看吧。 1、什么是API? API是允许两个应用程序相互通信的代码。API使开发人员能够发出特定的调用或请求来发送或接收信息。 2、什么是以API为中心的应用程序? 以API为中心的应用程…

重置 VCSA 6.7 root密码和SSO密码

原贴地址&#xff1a;https://www.cnblogs.com/airoot/p/16059033.html 问题描述 1、用root用户登录 VMware vCenter Server Appliance虚拟机失败&#xff0c;无法登录 2、vCenter Server Appliance 6.7 U1的root帐户错误尝试次数超过3次已锁定或帐户已过期 官方说明 在VC…

帆软同时查看多个tab会卡换种方式用网页跳转就会提升效率

效果如图&#xff1a; 方法&#xff1a; 首先&#xff0c;要下载个插件–网页框控件&#xff1b; 接着&#xff0c;做个frm作为首页&#xff0c; 把地址和参数输入进去 最后&#xff0c;预览首页就可以了

【软件教程】如何用C++检查TCP或UDP端口是否被占用

一、检查步骤 使用socket函数创建socket_fd套接字。使用sockaddr_in结构体配置协议和端口号。使用bind函数尝试与端口进行绑定&#xff0c;成功返回0表示未被占用&#xff0c;失败返回-1表示已被占用。 二、CODE 其中port需要修改为想要检测的端口号&#xff0c;也可以将代码…

检测和缓解SQL注入攻击

SQL注入即是指web应用程序对用户输入数据的合法性没有判断或过滤不严&#xff0c;攻击者可以在web应用程序中事先定义好的查询语句的结尾上添加额外的SQL语句&#xff0c;在管理员不知情的情况下实现非法操作&#xff0c;以此来实现欺骗数据库服务器执行非授权的任意查询&#…

Jetpack Compose | State状态管理及界面刷新

我们知道Jetpack Compose&#xff08;以下简称Compose&#xff09;中的 UI 可组合项是通过Composable 声明的函数来描述的&#xff0c;如&#xff1a; Composable fun Greeting() {Text(text "init",color Color.Red,modifier Modifier.fillMaxWidth()) }上面的代…

研究人员发现基于xmpp的即时通讯服务被窃听

攻击者使用我们的加密服务发布了几个新的TLS证书,这些服务被用来劫持加密的 星连接 在5222端口使用透明的[中间人]代理。 到目前为止收集到的证据指向在托管提供者网络上配置的流量重定向,排除了其他可能性&#xff0c;例如服务器中断或欺骗攻击。 据估计&#xff0c;窃听从20…

数据结构:优先级队列(堆)

概念 优先级队列是啥&#xff1f; 队列是一种先进先出 (FIFO) 的数据结构 &#xff0c;但有些情况下&#xff0c; 操作的数据可能带有优先级&#xff0c;一般出队 列时&#xff0c;可能需要优先级高的元素先出队列。 在这种情况下&#xff0c; 数据结构应该提供两个最基本的…