飞利浦双串口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;}
}

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

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

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

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

相关文章

Python 算法高级篇:图的表示与存储优化

Python 算法高级篇&#xff1a;图的表示与存储优化 引言 1. 什么是图&#xff1f;2. 图的基本概念3. 图的表示方法3.1. 临接矩阵表示临接矩阵的优点&#xff1a;临接矩阵的缺点&#xff1a; 3.2. 邻接表表示邻接表的优点&#xff1a;邻接表的缺点&#xff1a; 4. 优化的存储方法…

【开源】基于SpringBoot的计算机机房作业管理系统的设计和实现

目录 一、摘要1.1 项目介绍1.2 项目录屏 二、功能模块2.1 登录注册模块2.2 课程管理模块2.3 课时管理模块2.4 学生作业模块 三、系统设计3.1 用例设计3.2 数据库设计3.2.1 课程表3.2.2 课时表3.2.3 学生作业表 四、系统展示五、核心代码5.1 查询课程数据5.2 新增课时5.3 提交作…

C++初阶--类与对象(2)

文章目录 类的6个默认成员函数构造函数默认构造函数的用处&#xff1a; 析构函数默认析构函数的用处 拷贝构造函数赋值运算符重载取地址及const取地址操作符重载 类的6个默认成员函数 对于一个没有成员的类来说&#xff0c;称之为空类&#xff1b; 但空类并非完全是空的&#…

1024 云上见 · 上云挑战(ChatGPT搭建)

【玩转1024】使用函数计算X通义千问搭建AI助手&#xff0c;参与1024小说创作大赛 【使用函数计算X通义千问搭建AI助手&#xff0c;参与小说创作大赛】&#xff1a;本活动基于函数计算X 通义千问快速部署 AI 个人助手应用&#xff0c;用户可以根据需要选择不同角色的AI助手开启…

Maven配置阿里云中央仓库settings.xml

Maven配置阿里云settings.xml 前言一、阿里云settings.xml二、使用步骤1.任意目录创建settings.xml2.使用阿里云仓库 总结 前言 国内网络从maven中央仓库下载文件通常是比较慢的&#xff0c;所以建议配置阿里云代理镜像以提高jar包下载速度&#xff0c;IDEA中我们需要配置自己…

基础课13——数据异常处理

数据异常是指数据不符合预期或不符合常识的情况。数据异常可能会导致数据分析结果不准确&#xff0c;甚至是错误&#xff0c;因此在进行数据分析之前需要对数据进行清洗和验证。 常见的数据异常包括缺失值、重复值、异常值等。 缺失值是指数据中存在未知值或未定义的值&#…

JAVA:集合框架常见的面试题和答案

1、List接口的常见实现类有哪些&#xff1f; 答&#xff1a; 常见的List接口实现类包括&#xff1a; ArrayList: 基于动态数组实现的List&#xff0c;支持快速随机访问。LinkedList: 基于链表实现的List&#xff0c;支持快速的插入和删除操作。Vector: 一个线程安全的动态数组…

基于Java的流浪动物救助管理系统设计与实现(源码+lw+部署文档+讲解等)

文章目录 前言具体实现截图论文参考详细视频演示为什么选择我自己的网站自己的小程序&#xff08;小蔡coding&#xff09; 代码参考数据库参考源码获取 前言 &#x1f497;博主介绍&#xff1a;✌全网粉丝10W,CSDN特邀作者、博客专家、CSDN新星计划导师、全栈领域优质创作者&am…

Qt中实现页面切换的两种方式

文章目录 方式一 &#xff1a;使用QStackedWidget讲解代码结构main.cpp完整代码运行结果&#xff1a; 方式二 &#xff1a;代码结构完整代码mainwindow.hnewmainwindow.hmain.cppmainwindow.cppnewmainwindow.cppmainwindow.uinewmainwindow.ui 效果 方式一 &#xff1a;使用QS…

docker 部署 若依 Ruoyi springboot+vue分离版 dockerCompose

本篇从已有虚拟机/服务器 安装好dokcer为基础开始讲解 1.部署mysql 创建conf data init三个文件夹 conf目录存放在mysql配置文件 init目录存放着若依数据库sql文件&#xff08;从navicat导出的并非若依框架自带sql&#xff09; 创建一个属于本次若依部署的网段&#xff08;只…

sql-50练习题6-10

sql练习题6-10题 前言数据库表结构介绍学生表课程表成绩表教师表 0-6 查询"李"姓老师的数量0-7 查询学过"李四"老师授课的同学的信息0-8 查询没学过"李四"老师授课的同学的信息0-9 查询学过编号为"01"并且也学过编号为"02"的…

Redis(09)| Reactor模式

我们在使用Redis的时候&#xff0c;通常是多个客户端连接Redis服务器&#xff0c;然后各自发送命令请求(例如Get、Set)到Redis服务器&#xff0c;最后Redis处理这些请求返回结果。 从上一篇博文《Redis&#xff08;08&#xff09;| 线程模型》中知道Redis是单线程。Redis除了处…

数据结构——栈与队列

目录 1. 中缀表达式转换为后缀表达式 2. 括号匹配问题 3. 栈实现队列 4. 约瑟夫环 1. 中缀表达式转换为后缀表达式 【问题描述】 输入一个中缀表达式&#xff0c;表达式中有、-、*、/四种运算以及&#xff08;、&#xff09;&#xff0c;表达式中的其他符号为大写的字母。实…

QT webengine显示HTML简单示例

文章目录 参考示例1TestWebenqine.promainwindow.hmainwindow.cppmain.cpp效果 示例2 (使用setDevToolsPage函数)main.cpp效果 参考 QT webengine显示HTML简单示例 示例1 编译器 : Desktop Qt 5.15.2 MSVC2019 64bit编辑器: QtCreator代码: TestWebenqine.pro # TestWeben…

pycharm运行R语言脚本(win10环境下安装)

文章目录 简介1. pycharm安装插件2. 安装R语言解释器2.1下载安装包2.2具体安装过程 3.编辑环境变量4 检验是否安装成功&#xff1a;5.安装需要的library6.pycharm中配置安装好的R语言解释器 简介 pycharm 安装 R language for Intellij R language for Intellij 是一个插件&am…

震惊!原来BUG是这么理解的!什么是BUG?软件错误(BUG)的概念

较为官方的概念&#xff1a; 当且仅当规格说明是存在的并且正确&#xff0c;程序与规格说明之间的 不匹配才是错误。 当需求规格说明书没有提到的功能&#xff0c;判断标准以最终用户为准&#xff1a;当程序没有实现其最终用户合理预期的 功能要求时&#xff0c;就是软…

【Python 零基础入门】常用内置函数 初探

【Python 零基础入门】内容补充 1 常用内置函数 Python 简介为什么要学习内置函数数据类型和转换int(): 转为整数float(): 转为浮点数list(): 转为列表tuple(): 转换为元组set():转换为集合dict(): 创建字典: 数学运算abs(): 绝对值pow(): 幂运算round(): 四舍五入min(): 最小值…

NPM【问题 01】npm i node-sass@4.14.1报错not found: python2及Cannot download问题处理

node-sass安装问题处理 1.问题2.处理2.1 方案一【我的环境失败】2.2 方案二【成功】2.3 方案三【成功】 1.问题 gyp verb which failed Error: not found: python2 # 1.添加Python27的安装路径到环境变量 gyp verb check python checking for Python executable "python…

leetcode:1154. 一年中的第几天(python3解法)

难度&#xff1a;简单 给你一个字符串 date &#xff0c;按 YYYY-MM-DD 格式表示一个 现行公元纪年法 日期。返回该日期是当年的第几天。 示例 1&#xff1a; 输入&#xff1a;date "2019-01-09" 输出&#xff1a;9 解释&#xff1a;给定日期是2019年的第九天。 示例…

51单片机实验:数码管动态显示00-99

1、实验要求 利用STC89C52RC单片机开发板实现&#xff1a;使用2位数码管循环显示00-99&#xff0c;每次间隔1s&#xff0c;并且当计数到20时&#xff0c;则蜂鸣器鸣响1次。 2、实验分析 程序实现分析&#xff1a; 1、定义数码管位选引脚&#xff08;P2.4、P2.5、P2.6、…