Delphi TCP服务端监听端口获取客户端RFID网络读卡器上传的刷卡数据

本示例使用设备介绍:液显WIFI无线网络HTTP协议RFID云读卡器可编程实时可控开关TTS语-淘宝网 (taobao.com)
unit Unit1;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, ComCtrls, ScktComp, StdCtrls, ScktComp7, ExtCtrls,Clipbrd;typeTForm1 = class(TForm)ServerSocket1: TServerSocket;Button1: TButton;Button2: TButton;Edit1: TEdit;Edit2: TEdit;Label1: TLabel;ListBox1: TListBox;ListBox2: TListBox;Button3: TButton;CheckBox1: TCheckBox;Panel1: TPanel;RadioButton1: TRadioButton;RadioButton2: TRadioButton;RadioButton3: TRadioButton;RadioButton4: TRadioButton;Label6: TLabel;Label2: TLabel;Edit3: TEdit;Button4: TButton;Button5: TButton;Button6: TButton;Button7: TButton;RichEdit10: TRichEdit;UpDown7: TUpDown;ComboBox1: TComboBox;ComboBox3: TComboBox;RichEdit1: TRichEdit;UpDown1: TUpDown;RichEdit2: TRichEdit;UpDown2: TUpDown;Label3: TLabel;Label5: TLabel;Label7: TLabel;RadioButton5: TRadioButton;RadioButton6: TRadioButton;Label8: TLabel;Label9: TLabel;Label10: TLabel;CheckBox2: TCheckBox;Label4: TLabel;Button8: TButton;Button9: TButton;procedure ServerSocket1ClientConnect(Sender: TObject; Socket: TCustomWinSocket);procedure ServerSocket1ClientDisconnect(Sender: TObject;Socket: TCustomWinSocket);procedure ServerSocket1ClientRead(Sender: TObject; Socket: TCustomWinSocket);procedure Button1Click(Sender: TObject);procedure FormActivate(Sender: TObject);procedure Button2Click(Sender: TObject);procedure Button3Click(Sender: TObject);procedure Button6Click(Sender: TObject);procedure Button5Click(Sender: TObject);procedure Button4Click(Sender: TObject);procedure FormClose(Sender: TObject; var Action: TCloseAction);procedure Button7Click(Sender: TObject);procedure Button8Click(Sender: TObject);procedure Button9Click(Sender: TObject);procedure CheckBox1MouseUp(Sender: TObject; Button: TMouseButton;Shift: TShiftState; X, Y: Integer);private{ Private declarations }procedure Responsedata();procedure GetSenddata(respcode:integer);procedure ButtonSend(sendcode:integer);public{ Public declarations }ResponseBuff:Array of Byte;end;varForm1: TForm1;implementation{$R *.dfm}procedure TForm1.ServerSocket1ClientConnect(Sender: TObject; Socket: TCustomWinSocket);
beginButton3.Click();
end;procedure TForm1.ServerSocket1ClientDisconnect(Sender: TObject; Socket: TCustomWinSocket);
beginButton3.Click();
end;procedure TForm1.ServerSocket1ClientRead(Sender: TObject; Socket: TCustomWinSocket);
varRemotAddPort,DispStr,HexStr:String;i,GetDataLen:integer;GetBuff:Array of Byte;SendBuff:Array of Byte;respcode:integer;
begintryRemotAddPort:=Socket.RemoteAddress+':'+inttostr(Socket.RemotePort);GetDataLen:= Socket.ReceiveLength;SetLength(GetBuff, GetDataLen);Socket.ReceiveBuf(GetBuff[0],GetDataLen); //Socket.ReceiveText;DispStr:='';for i:=0 to GetDataLen-1 dobeginDispStr:=DispStr+inttohex(GetBuff[i],2)+' ';end;if ListBox2.Count >100 then ListBox2.Clear();ListBox2.Items.Add('Get Data From '+RemotAddPort+' : '+DispStr);case GetBuff[0] of$C1,$CF:beginif GetBuff[0]= $C1 thenDispStr:='数据解析:IC读卡器上传卡号,'elseDispStr:='数据解析:IC卡离开读卡器,';DispStr := DispStr+'设备IP['+IntToStr(GetBuff[1]) + '.' + IntToStr(GetBuff[2]) + '.' + IntToStr(GetBuff[3]) + '.' + IntToStr(GetBuff[4])+'],';DispStr := DispStr+'机号['+IntToStr(GetBuff[5] + GetBuff[6]*256)+'],';DispStr := DispStr+'数据包号['+IntToStr(GetBuff[7] + GetBuff[8]*256)+'],';DispStr := DispStr+'卡号长度['+IntToStr(GetBuff[9])+'],';HexStr:='';for i:=10 to 10+GetBuff[9]-1 doHexStr:=HexStr+inttohex(GetBuff[i],2);DispStr := DispStr+'16进制卡号['+HexStr+'],';HexStr:='';for i:=10+GetBuff[9] to GetDataLen-1 doHexStr:=HexStr+inttohex(GetBuff[i],2);DispStr := DispStr+'唯一硬件序号['+HexStr+']';ListBox2.Items.Add(DispStr);ListBox2.Items.Add('');listbox2.ItemIndex :=listbox2.Items.Count-1;if CheckBox1.Checked thenbeginResponsedata() ;Socket.SendBuf(ResponseBuff[0],Length(ResponseBuff));DispStr:='Send Data To '+RemotAddPort+' : ';for i:=0 to Length(ResponseBuff)-1 doDispStr:=DispStr+inttohex(ResponseBuff[i],2)+' ';ListBox2.Items.Add(DispStr);ListBox2.Items.Add('');listbox2.ItemIndex :=listbox2.Items.Count-1;end;end;$D1,$DF:beginif GetBuff[0]= $D1 thenDispStr:='数据解析:ID读卡器上传卡号,'elseDispStr:='数据解析:ID卡离开读卡器,';DispStr := DispStr+'设备IP['+IntToStr(GetBuff[1]) + '.' + IntToStr(GetBuff[2]) + '.' + IntToStr(GetBuff[3]) + '.' + IntToStr(GetBuff[4])+'],';DispStr := DispStr+'机号['+IntToStr(GetBuff[5] + GetBuff[6]*256)+'],';DispStr := DispStr+'数据包号['+IntToStr(GetBuff[7] + GetBuff[8]*256)+'],';HexStr:='';for i:=9 to 13 doHexStr:=HexStr+inttohex(GetBuff[i],2);DispStr := DispStr+'16进制卡号['+HexStr+'],';HexStr:='';for i:=14 to GetDataLen-1 doHexStr:=HexStr+inttohex(GetBuff[i],2);DispStr := DispStr+'唯一硬件序号['+HexStr+']';ListBox2.Items.Add(DispStr);ListBox2.Items.Add('');listbox2.ItemIndex :=listbox2.Items.Count-1;if CheckBox1.Checked thenbeginResponsedata() ;Socket.SendBuf(ResponseBuff[0],Length(ResponseBuff));DispStr:='Send Data To '+RemotAddPort+' : ';for i:=0 to Length(ResponseBuff)-1 doDispStr:=DispStr+inttohex(ResponseBuff[i],2)+' ';ListBox2.Items.Add(DispStr);ListBox2.Items.Add('');listbox2.ItemIndex :=listbox2.Items.Count-1;end;end;$F3:beginDispStr:='数据解析:读卡器心跳包,';DispStr := DispStr+'设备IP['+IntToStr(GetBuff[1]) + '.' + IntToStr(GetBuff[2]) + '.' + IntToStr(GetBuff[3]) + '.' + IntToStr(GetBuff[4])+'],';DispStr := DispStr+'机号['+IntToStr(GetBuff[5] + GetBuff[6]*256)+'],';DispStr := DispStr+'数据包号['+IntToStr(GetBuff[7] + GetBuff[8]*256)+'],';DispStr := DispStr+'心跳包标识['+inttohex(GetBuff[9],2)+'],';DispStr := DispStr+'长度['+IntToStr(GetBuff[10])+'],';DispStr := DispStr+'继电器状态['+inttohex(GetBuff[11],2)+'],';DispStr := DispStr+'输入口状态['+inttohex(GetBuff[12],2)+'],';DispStr := DispStr+'随机校验码['+inttohex(GetBuff[13],2)+inttohex(GetBuff[14],2)+inttohex(GetBuff[15],2)+inttohex(GetBuff[16],2)+'],';HexStr:='';HexStr:='';for i:=17 to GetDataLen-1 doHexStr:=HexStr+inttohex(GetBuff[i],2);DispStr := DispStr+'唯一硬件序号['+HexStr+']';ListBox2.Items.Add(DispStr);ListBox2.Items.Add('');listbox2.ItemIndex :=listbox2.Items.Count-1; end;end;exceptend;
end;procedure TForm1.Responsedata(); //根据选择的回应方式生成回应数据缓冲
beginif RadioButton1.Checked thenGetSenddata(0)elseif RadioButton2.Checked thenGetSenddata(1)elseif RadioButton3.Checked thenGetSenddata(2)elseGetSenddata(3);
end;procedure TForm1.GetSenddata(respcode:integer); //根据发送方式生成发送数据缓冲
var
delaytime,i,voicelen,displen:integer;
strls,voicestr:string;
begincase respcode of0:beginSetLength(ResponseBuff, 39);ResponseBuff[0]:=$5A; //命令字:驱动显示文字+蜂鸣器响声ResponseBuff[1]:=$00; //机号低ResponseBuff[2]:=$00; //机号高,0000表示任意机号if(CheckBox2.Checked) thenbeginResponseBuff[3]:=ComboBox1.ItemIndex; //蜂鸣器响声代码if RadioButton6.Checked then ResponseBuff[3]:=ResponseBuff[3] xor 128; //背光灯状态不改变endelsebeginResponseBuff[3]:=$ff; //不响声if RadioButton6.Checked then ResponseBuff[3]:=ResponseBuff[3] xor 127; //背光灯状态不改变end;delaytime:=StrToInt(RichEdit10.Lines[0]);ResponseBuff[4] := delaytime mod 256; //显示时长strls := Edit1.Text + ' ';for i := 1 to 34 doResponseBuff[4+i] := Byte(strls[i]);end;1:beginvoicestr:='[v'+ trim(RichEdit2.Lines[0])+']'; //本次播报TTS语音的音量大小,取值范围v0 到 v16voicestr:= voicestr+trim(edit3.Text);voicelen:=length(voicestr); //语音长度displen:=34; //满屏显示长度SetLength(ResponseBuff, 11+displen+voicelen+4);ResponseBuff[0]:=$5C; //命令字:驱动显示文字+蜂鸣器响声+开启继电器+播报TTS语音ResponseBuff[1]:=$00; //机号低ResponseBuff[2]:=$00; //机号高,0000表示任意机号if(CheckBox2.Checked) thenbeginResponseBuff[3]:=ComboBox1.ItemIndex; //蜂鸣器响声代码if RadioButton6.Checked then ResponseBuff[3]:=ResponseBuff[3] xor 128; //背光灯状态不改变endelsebeginResponseBuff[3]:=$ff; //不响声if RadioButton6.Checked then ResponseBuff[3]:=ResponseBuff[3] xor 127; //背光灯状态不改变end;case ComboBox3.ItemIndex of //开启的继电器号1: ResponseBuff[4]:=$f1;2: ResponseBuff[4]:=$f2;3: ResponseBuff[4]:=$f3;4: ResponseBuff[4]:=$f4;5: ResponseBuff[4]:=$f5;6: ResponseBuff[4]:=$f6;7: ResponseBuff[4]:=$f7;8: ResponseBuff[4]:=$f8;else ResponseBuff[4]:=$f0;end;delaytime:=StrToInt(RichEdit1.Lines[0]);ResponseBuff[5] := delaytime mod 256;ResponseBuff[6] := (delaytime div 256) mod 256;delaytime:=StrToInt(RichEdit10.Lines[0]);ResponseBuff[7] := delaytime mod 256; //显示时长ResponseBuff[8] :=0;ResponseBuff[9] :=displen;ResponseBuff[10] :=voicelen;strls := Edit1.Text + ' ';for i := 1 to displen doResponseBuff[10+i] := Byte(strls[i]);for i := 1 to voicelen doResponseBuff[10+displen+i] := Byte(voicestr[i]);ResponseBuff[10+displen+voicelen+1]:=$55; //防干扰固定后缀ResponseBuff[10+displen+voicelen+2]:=$aa;ResponseBuff[10+displen+voicelen+3]:=$66;ResponseBuff[10+displen+voicelen+4]:=$99;end;2:beginSetLength(ResponseBuff, 4);ResponseBuff[0]:=$96; //命令字:驱动蜂鸣器响ResponseBuff[1]:=$00; //机号低ResponseBuff[2]:=$00; //机号高,0000表示任意机号ResponseBuff[3]:=ComboBox1.ItemIndex; //蜂鸣器响声代码end;3:beginSetLength(ResponseBuff, 6);ResponseBuff[0]:=$78; //命令字:驱动开启继电器ResponseBuff[1]:=$00; //机号低ResponseBuff[2]:=$00; //机号高,0000表示任意机号case ComboBox3.ItemIndex of //开启的继电器号1: ResponseBuff[3]:=$f1;2: ResponseBuff[3]:=$f2;3: ResponseBuff[3]:=$f3;4: ResponseBuff[3]:=$f4;5: ResponseBuff[3]:=$f5;6: ResponseBuff[3]:=$f6;7: ResponseBuff[3]:=$f7;8: ResponseBuff[3]:=$f8;else ResponseBuff[3]:=$f0;end;delaytime:=StrToInt(RichEdit1.Lines[0]);ResponseBuff[4] := delaytime mod 256;ResponseBuff[5] := (delaytime div 256) mod 256;end;4:beginSetLength(ResponseBuff, 6);ResponseBuff[0]:=$78; //命令字:驱动关闭已开启继电器ResponseBuff[1]:=$00; //机号低ResponseBuff[2]:=$00; //机号高,0000表示任意机号case ComboBox3.ItemIndex of //继电器号1: ResponseBuff[3]:=$e1;2: ResponseBuff[3]:=$e2;3: ResponseBuff[3]:=$e3;4: ResponseBuff[3]:=$e4;5: ResponseBuff[3]:=$e5;6: ResponseBuff[3]:=$e6;7: ResponseBuff[3]:=$e7;8: ResponseBuff[3]:=$e8;else ResponseBuff[3]:=$e0;end;delaytime:=StrToInt(RichEdit1.Lines[0]);ResponseBuff[4] := delaytime mod 256;ResponseBuff[5] := (delaytime div 256) mod 256;end;end;
end;procedure TForm1.ButtonSend(sendcode:integer);
var
i:integer;
RemotAddPort,DispStr:string;
beginif ServerSocket1.Active thenbegini:=ListBox1.ItemIndex ;if i>=0 thenbegintryGetSenddata(sendcode);ServerSocket1.Socket.Connections[i].SendBuf(ResponseBuff[0],Length(ResponseBuff));RemotAddPort:= ServerSocket1.Socket.Connections[i].RemoteAddress+':'+inttostr(ServerSocket1.Socket.Connections[i].RemotePort);DispStr:='Send Data To '+RemotAddPort+' : ';for i:=0 to Length(ResponseBuff)-1 doDispStr:=DispStr+inttohex(ResponseBuff[i],2)+' ';ListBox2.Items.Add(DispStr);ListBox2.Items.Add('');listbox2.ItemIndex :=listbox2.Items.Count-1;exceptend;endelseApplication.MessageBox('请先选择要向其发送指令的在线客户端!', '警告', MB_OK+MB_ICONSTOP);endelseApplication.MessageBox('请先启动TCP服务监听!', '警告', MB_OK+MB_ICONSTOP);
end;procedure TForm1.Button1Click(Sender: TObject);
beginButtonSend(0);
end;procedure TForm1.FormActivate(Sender: TObject);
begin
if ServerSocket1.Active thenbeginButton2.Caption := '停止';end
elsebeginButton2.Click();end;
end;procedure TForm1.Button2Click(Sender: TObject);
begin
if not ServerSocket1.Active thenbegintryServerSocket1.Port := StrToInt(Edit2.Text);ServerSocket1.Active := True;Button2.Caption := '停止';Edit2.Enabled := False;exceptApplication.MessageBox('启动TCP服务监听失败!可能端口已被其他应用占用。', '警告', MB_OK+MB_ICONSTOP);end;endelsebeginServerSocket1.Active := False;Button2.Caption := '启动TCP服务监听';Edit2.Enabled := True;ListBox1.Items.Clear();ListBox2.Items.Clear();end;end;procedure TForm1.Button3Click(Sender: TObject);
vari,links:integer;
beginListBox1.Items.Clear();links:=ServerSocket1.Socket.ActiveConnections;for i:=0 to links-1 dobeginListBox1.Items.Add(inttostr(i)+'|'+ServerSocket1.Socket.Connections[i].RemoteAddress+':'+inttostr(ServerSocket1.Socket.Connections[i].RemotePort));end;
end;procedure TForm1.Button6Click(Sender: TObject);
beginButtonSend(3);
end;procedure TForm1.Button5Click(Sender: TObject);
beginButtonSend(2);
end;procedure TForm1.Button4Click(Sender: TObject);
beginButtonSend(1);
end;procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if ServerSocket1.Active then ServerSocket1.Active := False;
end;procedure TForm1.Button7Click(Sender: TObject);
beginButtonSend(4);
end;procedure TForm1.Button8Click(Sender: TObject);
varliststr:string;i:integer;
beginif listbox2.Count <1 then exit;liststr:='';for i:=0 to ListBox2.Count-1 dobeginListBox2.ItemIndex:=i;liststr:=liststr+ListBox2.Items.Strings[ListBox2.ItemIndex]+#13#10;end;Clipboard.SetTextBuf(PChar(liststr));Application.MessageBox('TCP通讯报文日志已拷贝!', '提示', MB_OK+MB_ICONASTERISK );
end;procedure TForm1.Button9Click(Sender: TObject);
beginListBox2.Clear();
end;procedure TForm1.CheckBox1MouseUp(Sender: TObject; Button: TMouseButton;Shift: TShiftState; X, Y: Integer);
beginif checkbox1.Checked then Panel1.Visible :=true else Panel1.Visible :=false;
end;end.
相关文章:
Delphi TCP服务端监听端口获取客户端RFID网络读卡器上传的刷卡数据
本示例使用设备介绍:液显WIFI无线网络HTTP协议RFID云读卡器可编程实时可控开关TTS语-淘宝网 (taobao.com) unit Unit1;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, ComCtrls, ScktComp, StdCtrls, ScktCom…...
javaSE学习笔记(一)概述、语法
目录 前言 一、概述 1.java语言发展史 2.Java语言版本 3.Java语言平台 4.Java语言特点 5.Java语言跨平台原理-可移植性 6.JRE和JDK的概述 7.JDK的下载和安装 7.1安装的细节 7.2可能出现的问题 7.3验证安装是否成功 8.JDK安装路径下的目录解释 9.path环境变量的作…...
接口开发之使用C#插件Quartz.Net定时执行CMD任务工具
C#制作定时任务工具执行CMD命令 概要准备知识点实现原理thinkphp配置winform执行CMD命令读取ini配置文件定时任务Quartz.Net 完整代码Job.csIniFunc.csForm1.csconfig.ini简易定时任务工具雏形 概要 很多时候写接口上线后还会遇到很多修改,类似JAVA,C#,delphi制作的…...
XSS脚本(存储型xss获取肉鸡的cookies)
XSS脚本(存储型xss获取肉鸡的cookies) 存储型XSS就是在能够提交上传的文本框中提交一些标签代码,这段代码被插入到页面中,肉鸡每次点击这个页面时都会有弹框弹出。(只要点击就会弹框) 反射性XSS顾名思义插入…...
【React】04.MVC模式和MVVM模式
React是Web前端框架 1、目前市面上比较主流的前端框架 ReactAngular(NG框架)Vue 主流的思想: 不在直接去操作DOM,而是改为“数据驱动思想” 操作DOM思想: 操作DOM比较消耗性能[主要原因就是,可能会导…...
调试代码0
dev_update_off () * read_image (Image, C:/Users/Public/Documents/MVTec/HALCON-12.0/examples/images/smd/smd_on_chip_01.png) read_image (Image, D:/图像文件/图片/图片/基板/20230609-103004-0.bmp) get_image_size (Image, Width, Height) * dev_close_window () * de…...
【C++心愿便利店】No.12---C++之探索string底层实现
文章目录 前言一、写实拷贝(了解)二、string类常用接口实现2.1 成员变量2.2 默认构造函数2.3 拷贝构造函数2.4 operator2.5 operator[]2.6 c_str2.7 size()2.8 capacity() 三、迭代器的实现3.1 begin()和end()3.2 范围for 四、string类增删查改4.1 reser…...
Android Studio(列表视图ListView)
前言 前面在适配器章节,已经介绍了ListView的作用(干什么的),这节将主要介绍如何去设计ListView页面视图。 思考 列表视图需要些什么? 1. 列表项容器(装载各列表项的容器):<ListView/> 2. 列表项布局…...
让深度神经网络绘画以了解它们是如何工作的
一、说明 深度学习如此有效,这真是一个谜。尽管有一些关于深度神经网络为何如此有效的线索,但事实是没有人完全确定,并且深度学习的理论理解是一个非常活跃的研究领域。 在本教程中,我们将以一种不寻常的方式触及问题的一个小方面…...
https://www.jianshu.com/p/34bf240b85a9
https://www.jianshu.com/p/34bf240b85a9 https://www.eccee.com/soft-platform/991.html...
如何导出PPT画的图为高清图片?插入到world后不压缩图像的设置方法?
期刊投稿的时候,需要图片保持一定的清晰度数,那么我们怎么才能从PPT中导出符合要求的图片呢? 对于矢量图绘图软件所画的图,直接导出即可。 而PPT导出的图片清晰度在60pi,就很模糊。 整体思路: PPT绘图——…...
【Spring】Spring IOC DI
Spring IOC & DI IOC DI入门什么是Spring什么是容器什么是IOC IOC介绍传统程序开发解决方案 DI IOC详解Bean的存储Controller(控制器存储)Service(服务存储)Repository(仓库存储)Component(组件存储)Configuration(配置存储) 为什么需要这么多类注解类注解之间的关系方法注…...
一招解密网络流量瓶颈!
前言 我们曾介绍过观测云提供全面的基础设施监测方案(参见《全方位监控基础设施,坚实守护您的业务稳定!》),能够高效全面地帮助您实时观测所有的基础设施对象及云产品等,赋能您的业务稳定发展。今天我们将…...
某校帮签到小程序m 加密参数解析
小程序解密清参考我以前的文章 VX小程序逆向 js版本 function n(e, a) {var t (65535 & e) (65535 & a);return (e >> 16) (a >> 16) (t >> 16) << 16 | 65535 & t };function i(e, a, t, n, r, i, s) {return o(a & n | t &…...
Node.js |(六)express框架 | 尚硅谷2023版Node.js零基础视频教程
学习视频:尚硅谷2023版Node.js零基础视频教程,nodejs新手到高手 文章目录 📚express使用🐇初体验🐇express路由⭐️路由的使用⭐️获取请求参数⭐️获取路由参数🔥练习:根据路由参数响应歌手信息…...
包教包会:Mysql主从复制搭建
笑小枫的专属目录 一、无聊的理论知识1. 主从复制原理2. 主从复制的工作过程3. MySQL四种同步方式 二、docker下安装、启动mysql1. 安装主库2. 安装从库 三、配置Master(主)四、配置Slave(从)五、链接Master(主)和Slave(从)六、主从复制排错1. 错误:error connectin…...
Subset Selection
白话解释:https://www.geeksforgeeks.org/feature-subset-selection-process/ 貌似有一种比较常见的方法,称为多元逐步回归有3种筛选自变量的方法 (1)向前法:n个因变量情况,慢慢增加因变量到方程中&#x…...
【测开求职】面试题:计算机网络 精简版整理
本篇文章整理的是在秋招过程中遇到的计算机网络高频面试题,应付部分中小厂的测试开发工程师面试完全没有问题,如果时间充足的话,建议再看一下笔者的另外一篇文章:【测开求职】面试题:计算机网络 详细版整理,会让你对整个计算机网络有足够全面深刻的理解,亲测应付各个大厂…...
设计模式-代理模式(delegate)
什么是代理? 代理(Proxy)是一种设计模式,提供了对目标对象另外的访问方式;即通过代理对象访问目标对象.这样做的好处是:可以在目标对象实现的基础上,增强额外的功能操作,即扩展目标对象的功能. 这里使用到编程中的一个思想:不要随意去修改别人已经写好的代码或者方…...
MongoDB 安装与配置
MongoDB 安装与配置 MongoDB 是一个高性能、开源的 NoSQL 数据库,它提供了丰富的查询功能和高可用性。本文将详细讲解 MongoDB 的安装与配置过程。 1. MongoDB 安装 1.1 Windows 平台安装 下载 MongoDB 安装包 访问 MongoDB 官方下载页面(https://w…...
浏览器访问 AWS ECS 上部署的 Docker 容器(监听 80 端口)
✅ 一、ECS 服务配置 Dockerfile 确保监听 80 端口 EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]或 EXPOSE 80 CMD ["python3", "-m", "http.server", "80"]任务定义(Task Definition&…...
[2025CVPR]DeepVideo-R1:基于难度感知回归GRPO的视频强化微调框架详解
突破视频大语言模型推理瓶颈,在多个视频基准上实现SOTA性能 一、核心问题与创新亮点 1.1 GRPO在视频任务中的两大挑战 安全措施依赖问题 GRPO使用min和clip函数限制策略更新幅度,导致: 梯度抑制:当新旧策略差异过大时梯度消失收敛困难:策略无法充分优化# 传统GRPO的梯…...
云计算——弹性云计算器(ECS)
弹性云服务器:ECS 概述 云计算重构了ICT系统,云计算平台厂商推出使得厂家能够主要关注应用管理而非平台管理的云平台,包含如下主要概念。 ECS(Elastic Cloud Server):即弹性云服务器,是云计算…...
【OSG学习笔记】Day 18: 碰撞检测与物理交互
物理引擎(Physics Engine) 物理引擎 是一种通过计算机模拟物理规律(如力学、碰撞、重力、流体动力学等)的软件工具或库。 它的核心目标是在虚拟环境中逼真地模拟物体的运动和交互,广泛应用于 游戏开发、动画制作、虚…...
如何将联系人从 iPhone 转移到 Android
从 iPhone 换到 Android 手机时,你可能需要保留重要的数据,例如通讯录。好在,将通讯录从 iPhone 转移到 Android 手机非常简单,你可以从本文中学习 6 种可靠的方法,确保随时保持连接,不错过任何信息。 第 1…...
ServerTrust 并非唯一
NSURLAuthenticationMethodServerTrust 只是 authenticationMethod 的冰山一角 要理解 NSURLAuthenticationMethodServerTrust, 首先要明白它只是 authenticationMethod 的选项之一, 并非唯一 1 先厘清概念 点说明authenticationMethodURLAuthenticationChallenge.protectionS…...
Rust 异步编程
Rust 异步编程 引言 Rust 是一种系统编程语言,以其高性能、安全性以及零成本抽象而著称。在多核处理器成为主流的今天,异步编程成为了一种提高应用性能、优化资源利用的有效手段。本文将深入探讨 Rust 异步编程的核心概念、常用库以及最佳实践。 异步编程基础 什么是异步…...
.Net Framework 4/C# 关键字(非常用,持续更新...)
一、is 关键字 is 关键字用于检查对象是否于给定类型兼容,如果兼容将返回 true,如果不兼容则返回 false,在进行类型转换前,可以先使用 is 关键字判断对象是否与指定类型兼容,如果兼容才进行转换,这样的转换是安全的。 例如有:首先创建一个字符串对象,然后将字符串对象隐…...
网站指纹识别
网站指纹识别 网站的最基本组成:服务器(操作系统)、中间件(web容器)、脚本语言、数据厍 为什么要了解这些?举个例子:发现了一个文件读取漏洞,我们需要读/etc/passwd,如…...
C++.OpenGL (14/64)多光源(Multiple Lights)
多光源(Multiple Lights) 多光源渲染技术概览 #mermaid-svg-3L5e5gGn76TNh7Lq {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-3L5e5gGn76TNh7Lq .error-icon{fill:#552222;}#mermaid-svg-3L5e5gGn76TNh7Lq .erro…...
