vb.net 实时监控双门双向门禁控制板源代码

news2024/11/28 19:01:22

 本示例使用设备介绍:实时网络双门双向门禁控制板可二次编程控制网络继电器远程开关-淘宝网 (taobao.com)

Imports System.Net.Sockets
Imports System.Net
Imports System.Text
Imports System.Threading

Imports System.Net.NetworkInformation
Imports System.Management
Public Class Form1
    Dim PortNumber As Integer  ''侦听端口号    
    Dim ListenerThre As Thread ''侦听线程
    Dim LocalIp As String      ''本地ip64
    Dim ready As Boolean = False ''线程运行标识
    Dim machinnos As String
    Dim RemoteIPoint As IPEndPoint
    Dim BeepCode As String
    Dim VoiceCode As String

    Public ListenerSock As Socket ''侦听socket

    Delegate Sub EditUi(ByVal data0 As String, ByVal data1 As String)  '线程内更新UI传送两个参数
    Delegate Sub EditTC(ByVal con As Integer, ByVal data1 As String)


    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        'Control.CheckForIllegalCrossThreadCalls = False   '经典解决“线程间操作无效: 从不是创建控件的线程访问它 ,尽量不要用这种方式

        getIp()
        ComboBox2.SelectedIndex = 0
        ComboBox3.SelectedIndex = 1
        ComboBox4.SelectedIndex = 16
        ComboBox5.SelectedIndex = 1
        StartListener() ''开始侦听
    End Sub

    Public Sub getIp()     '获取本机所有网卡的IP
        Dim Address() As System.Net.IPAddress
        Dim i As Integer
        Address = Dns.GetHostByName(Dns.GetHostName()).AddressList
        If UBound(Address) < 0 Then
            MsgBox("未能查找到本台电脑安装的网卡,暂不能启动本软件。", MsgBoxStyle.Critical + vbOKOnly, "注意")
            End
        Else
            For i = 0 To UBound(Address)
                ComboBox1.Items.Add(Address(i).ToString())
            Next
            ComboBox1.SelectedIndex = 0
            LocalIp = ComboBox1.Text.Trim()
        End If
    End Sub

    Private Sub StartListener()
        Dim LocalPoint As IPEndPoint
        PortNumber = TextBox6.Text
        While Not ready
            Try
                LocalPoint = New IPEndPoint(IPAddress.Parse(LocalIp), PortNumber)
                ListenerSock = New Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)
                ListenerSock.Bind(LocalPoint)

                ListenerThre = New Thread(AddressOf ThrListener)
                ListenerThre.Start()
                ready = True
                'ListBox1.Items.Add(LocalPoint.ToString() & "已开始侦听......")
            Catch ex As Exception
                ListenerSock.Close()
                ready = False
                MsgBox("    有其它应用程序占用了 " & LocalPoint.ToString() & " ,请检查并关闭此应用后再打开本程序。", vbCritical + vbOKOnly, "警告")
                End
            End Try
        End While
    End Sub

    Private Sub ThrListener() '侦听线程      
        While ready
            Try
                Dim bytes(1024) As Byte
                Dim dataArray() As String
                Dim RemotePoint As System.Net.EndPoint = New System.Net.IPEndPoint(System.Net.IPAddress.Any, 0)
                Dim NumGet As Integer
                Dim Msg As String
                Dim Sendinf As String
                Dim SendBuf As Byte()
                Dim i As Integer

                Dim DevBufferIpAddrStr As String
                Dim DevBufferRemoteAddrStr As String
                Dim DevBufferCardCode As String
                Dim DevBufferUseTimeStr As String
                Dim DevRecFramesStr As String
                Dim DevBufferMachinStr As String
                Dim DevBufferDatetimeStr As String
                Dim DevBufferCardidStr As String
                Dim DevBufferUseMoneryStr As String
                Dim DevBufferReaderStr As String
                Dim DevBufferDoorNoStr As String
                Dim DevBufferDelayStr As String
                Dim DevBufferPasswPropStr As String
                Dim DevBufferPassWStr As String
                Dim DevBufferStaryStr As String
                Dim DevBufferRecordAddStr As String
                Dim DevBufferAllNoStr As String
                Dim DevBufferFunctionStr1 As String
                Dim DevBufferFunctionStr2 As String
                Dim DevBufferSerialNumStr As String
                Dim DevBufferInputKeyStr As String
                Dim DevBufferCommandStr As String
                Dim DevBufferQrcodeInfStr As String
                Dim DevBufferStateStr As String
                Dim DevBufferRandomCode As String
                Dim DevBufferSwitchStr As String
                Dim DevBufferFireStr As String

                NumGet = ListenerSock.ReceiveFrom(bytes, RemotePoint)
                Msg = Encoding.GetEncoding(936).GetString(bytes, 0, NumGet)
                'Msg = Encoding.UTF8.GetString(bytes, 0, NumGet)     '读取中文wifi名称时,需用utf8解码
                Me.Invoke(New EditUi(AddressOf EditUiNow), Now() & (" FromIP:" & Convert.ToString(RemotePoint) + "          ").Substring(0, 30) & "Data:", Msg) '用Invoke跨线程更新UI      

                Me.Invoke(New EditTC(AddressOf EditTCNow), 3, Convert.ToString(RemotePoint)) '用Invoke跨线程更新UI

                dataArray = Split(Convert.ToString(Msg), ",")
                Select Case dataArray(0)
                    Case "101"             '接收到 1、终端开机时向电脑发送的开机信息,         2、电脑发送002查询设备时间所返回的信息
                        DevRecFramesStr = dataArray(1)            '包序列号
                        DevBufferIpAddrStr = dataArray(2)         '终端IP
                        DevBufferRemoteAddrStr = dataArray(3)     '远程电脑指机IP
                        DevBufferMachinStr = dataArray(4)         '机号
                        DevBufferDatetimeStr = dataArray(5)       '日期时间*/
                        If dataArray.Length > 6 Then              '2018年以后的设备有唯一硬件序号*/
                            DevBufferSerialNumStr = dataArray(6)
                        End If

                        Sendinf = "001," + DevRecFramesStr        '向设备发此数据表示已收到信息,否则设备会连续发三次
                        SendBuf = Encoding.GetEncoding(936).GetBytes(Sendinf)
                        ListenerSock.SendTo(SendBuf, SendBuf.Length, SocketFlags.None, RemotePoint)
                        Me.Invoke(New EditTC(AddressOf EditTCNow), 2, Now() & (" SendTo:" & Convert.ToString(RemotePoint) + "          ").Substring(0, 30) & "Data:" & Sendinf)


                        Dim SystemTimeStr As String = String.Format("{0:yyyy-MM-dd HH:mm:ss}", DateTime.Now)
                        If DevBufferDatetimeStr.Substring(0, 16) <> SystemTimeStr.Substring(0, 16) Then
                            Sendinf = "003," & DevRecFramesStr & "," & SystemTimeStr
                            SendBuf = Encoding.GetEncoding(936).GetBytes(Sendinf)
                            ListenerSock.SendTo(SendBuf, SendBuf.Length, SocketFlags.None, RemotePoint)
                            Me.Invoke(New EditTC(AddressOf EditTCNow), 2, Now() & (" SendTo:" & Convert.ToString(RemotePoint) + "          ").Substring(0, 30) & "Data:" & Sendinf)
                        End If

                        Me.Invoke(New EditTC(AddressOf EditTCNow), 1, DevBufferDatetimeStr) '用Invoke跨线程更新UI      

                    Case "150"                                    '接收到实时考勤门禁机刷卡数据
                        DevRecFramesStr = dataArray(1)            '包序列号
                        DevBufferIpAddrStr = dataArray(2)         '终端IP
                        DevBufferRemoteAddrStr = dataArray(3)     '远程电脑指机IP
                        DevBufferMachinStr = dataArray(4)         '机号
                        DevBufferCardidStr = dataArray(5)         '卡号
                        DevBufferReaderStr = dataArray(6)         '消费金额*/
                        DevBufferDoorNoStr = dataArray(7)         '门或继电器号*/
                        DevBufferDelayStr = dataArray(8)          '门磁未关秒数,0表示已关*/
                        DevBufferPasswPropStr = dataArray(9)      '密码属性(0密码无效,1刷卡后按密码,2补签密码,3开门密码,4防迫胁密码)*/
                        DevBufferPassWStr = dataArray(10)         '密码(最多8位数字)*/
                        DevBufferUseTimeStr = dataArray(11)       '消费时间*/                        
                        If dataArray.Length > 12 Then
                            DevBufferSerialNumStr = dataArray(12)  '2018年以后的设备有唯一硬件序号
                        End If

                        Sendinf = "001," + DevRecFramesStr        '向设备发此数据表示已收到信息,否则设备会连续发三次
                        SendBuf = Encoding.GetEncoding(936).GetBytes(Sendinf)
                        ListenerSock.SendTo(SendBuf, SendBuf.Length, SocketFlags.None, RemotePoint)
                        Me.Invoke(New EditTC(AddressOf EditTCNow), 2, Now() & (" SendTo:" & Convert.ToString(RemotePoint) + "          ").Substring(0, 30) & "Data:" & Sendinf)

                        '此处加入业务对数据库的查、增、删、减操作
                        '用050指令返回开门成功,051指令返回开门失败,正式系统开发时要有重发机制

                        Select Case VoiceCode
                            Case "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15"  '发送禁止开门的指令"
                                Sendinf = "051," & DevBufferMachinStr & "," & DevBufferCardidStr & "," & TextBox5.Text.Trim() & "," & Format(NumericUpDown2.Value, "0") & "," & BeepCode & "," & VoiceCode
                            Case Else  '发送开门指令
                                Sendinf = "050," & DevBufferMachinStr & "," & DevBufferCardidStr & "," & TextBox5.Text.Trim() & "," & Format(NumericUpDown2.Value, "0") & "," & BeepCode & "," & VoiceCode & "," & DevBufferReaderStr & "," & DevBufferDoorNoStr & "," & Format(NumericUpDown1.Value, "0") & "," & Format(NumericUpDown2.Value, "0")
                        End Select
                        SendBuf = Encoding.GetEncoding(936).GetBytes(Sendinf)
                        ListenerSock.SendTo(SendBuf, SendBuf.Length, SocketFlags.None, RemotePoint)
                        Me.Invoke(New EditTC(AddressOf EditTCNow), 2, Now() & (" SendTo:" & Convert.ToString(RemotePoint) + "          ").Substring(0, 30) & "Data:" & Sendinf)

                    Case "151"                                    '发送按钮开门申请信息
                        DevRecFramesStr = dataArray(1)            '包序列号
                        DevBufferIpAddrStr = dataArray(2)         '终端IP
                        DevBufferRemoteAddrStr = dataArray(3)     '远程电脑指机IP
                        DevBufferMachinStr = dataArray(4)         '机号
                        DevBufferInputKeyStr = dataArray(5)       '&&按钮号
                        DevBufferReaderStr = dataArray(6)         '&&对应的门或继电器号
                        DevBufferDelayStr = dataArray(7)          '&&门磁未关秒数(0门已关)
                        DevBufferUseTimeStr = dataArray(8)        '&&刷卡时间
                        If UBound(dataArray) >= 9 Then DevBufferSerialNumStr = dataArray(9) Else DevBufferSerialNumStr = "" '唯一硬件序号

                        Sendinf = "001," + DevRecFramesStr        '向设备发此数据表示已收到信息,否则设备会连续发三次
                        SendBuf = Encoding.GetEncoding(936).GetBytes(Sendinf)
                        ListenerSock.SendTo(SendBuf, SendBuf.Length, SocketFlags.None, RemotePoint)
                        Me.Invoke(New EditTC(AddressOf EditTCNow), 2, Now() & (" SendTo:" & Convert.ToString(RemotePoint) + "          ").Substring(0, 30) & "Data:" & Sendinf)

                        Select Case VoiceCode
                            Case "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15"  '发送禁止开门的指令"
                                Sendinf = "051," & DevBufferMachinStr & "," & DevBufferInputKeyStr & "," & TextBox5.Text.Trim() & "," & Format(NumericUpDown2.Value, "0") & "," & BeepCode & "," & VoiceCode
                            Case Else   '发送开门指令
                                Sendinf = "050," & DevBufferMachinStr & "," & DevBufferInputKeyStr & "," & TextBox5.Text.Trim() & "," & Format(NumericUpDown2.Value, "0") & "," & BeepCode & "," & VoiceCode & "," & DevBufferInputKeyStr & "," & DevBufferReaderStr & "," & Format(NumericUpDown1.Value, "0") & "," & Format(NumericUpDown2.Value, "0")
                        End Select
                        SendBuf = Encoding.GetEncoding(936).GetBytes(Sendinf)
                        ListenerSock.SendTo(SendBuf, SendBuf.Length, SocketFlags.None, RemotePoint)
                        Me.Invoke(New EditTC(AddressOf EditTCNow), 2, Now() & (" SendTo:" & Convert.ToString(RemotePoint) + "          ").Substring(0, 30) & "Data:" & Sendinf)

                    Case "152"    '门磁报警信息
                        DevRecFramesStr = dataArray(1)        ' &&包序列号
                        DevBufferIpAddrStr = dataArray(2)     ' &&终端IP
                        DevBufferRemoteAddrStr = dataArray(3) '&&远程电脑指机IP
                        DevBufferMachinStr = dataArray(4)     '&&机号
                        DevBufferInputKeyStr = dataArray(5)   '&&门磁号
                        DevBufferReaderStr = dataArray(6)     '&&对应的门或继电器号
                        DevBufferDelayStr = dataArray(7)      '&&门磁未关秒数(0门已关)
                        DevBufferUseTimeStr = dataArray(8)    '&&刷卡时间
                        If UBound(dataArray) >= 9 Then DevBufferSerialNumStr = dataArray(9) Else DevBufferSerialNumStr = "" '唯一硬件序号

                        Sendinf = "001," + DevRecFramesStr        '向设备发此数据表示已收到信息,否则设备会连续发三次
                        SendBuf = Encoding.GetEncoding(936).GetBytes(Sendinf)
                        ListenerSock.SendTo(SendBuf, SendBuf.Length, SocketFlags.None, RemotePoint)
                        Me.Invoke(New EditTC(AddressOf EditTCNow), 2, Now() & (" SendTo:" & Convert.ToString(RemotePoint) + "          ").Substring(0, 30) & "Data:" & Sendinf)

                    Case "153"    '返回查询设备状态的053指令
                        DevRecFramesStr = dataArray(1)        ' &&包序列号
                        DevBufferIpAddrStr = dataArray(2)     ' &&终端IP
                        DevBufferRemoteAddrStr = dataArray(3) '&&远程电脑指机IP
                        DevBufferMachinStr = dataArray(4)     '&&机号
                        DevBufferInputKeyStr = dataArray(5)   '&&继电器号
                        DevBufferReaderStr = dataArray(6)     '&&继电器状态
                        DevBufferDelayStr = dataArray(7)      '&&门磁未关秒数(0门已关)
                        DevBufferStateStr = dataArray(8)      '&&门磁报警状态
                        If UBound(dataArray) >= 9 Then DevBufferSerialNumStr = dataArray(9) Else DevBufferSerialNumStr = "" '唯一硬件序号

                        Sendinf = "001," + DevRecFramesStr        '向设备发此数据表示已收到信息,否则设备会连续发三次
                        SendBuf = Encoding.GetEncoding(936).GetBytes(Sendinf)
                        ListenerSock.SendTo(SendBuf, SendBuf.Length, SocketFlags.None, RemotePoint)
                        Me.Invoke(New EditTC(AddressOf EditTCNow), 2, Now() & (" SendTo:" & Convert.ToString(RemotePoint) + "          ").Substring(0, 30) & "Data:" & Sendinf)

                        Msg = "继电器号:" & DevBufferInputKeyStr & ",继电器状态:" & DevBufferReaderStr & ",门磁未关秒数:" & DevBufferDelayStr & ",门磁报警状态:" & DevBufferStateStr
                        Me.Invoke(New EditTC(AddressOf EditTCNow), 9, Msg)

                    Case "154"                                    '接收到实时考勤门禁机卡离开感应区
                        DevRecFramesStr = dataArray(1)            '包序列号
                        DevBufferIpAddrStr = dataArray(2)         '终端IP
                        DevBufferRemoteAddrStr = dataArray(3)     '远程电脑指机IP
                        DevBufferMachinStr = dataArray(4)         '机号
                        DevBufferCardidStr = dataArray(5)         '卡号
                        DevBufferSerialNumStr = dataArray(6)

                    Case "155" '&&门禁脱网记录发送----
                        DevRecFramesStr = dataArray(1)      ' &&包序列号
                        DevBufferIpAddrStr = dataArray(2)   ' &&终端IP
                        DevBufferRemoteAddrStr = dataArray(3) '&&远程电脑指机IP
                        DevBufferMachinStr = dataArray(4)     '&&机号
                        DevBufferCardidStr = dataArray(5)     '&&卡号
                        DevBufferReaderStr = dataArray(6)    '&&读头
                        DevBufferDoorNoStr = dataArray(7)    '&&门或继电器号
                        DevBufferPasswPropStr = dataArray(8) '&&密码属性(0密码无效,1刷卡后按密码,2补签密码,3开门密码,4防迫胁密码)
                        DevBufferUseTimeStr = dataArray(9)   '&&刷卡时间
                        DevBufferStaryStr = dataArray(10)    '&&状态  0扣费 1计次
                        DevBufferRecordAddStr = dataArray(11) '&&记录地址标识
                        DevBufferAllNoStr = dataArray(12)    '&&总计录数
                        If UBound(dataArray) = 13 Then DevBufferSerialNumStr = dataArray(13) Else DevBufferSerialNumStr = "" '唯一硬件序号

                        Sendinf = "001," + DevRecFramesStr        '向设备发此数据表示已收到信息,否则设备会连续发三次
                        SendBuf = Encoding.GetEncoding(936).GetBytes(Sendinf)
                        ListenerSock.SendTo(SendBuf, SendBuf.Length, SocketFlags.None, RemotePoint)
                        Me.Invoke(New EditTC(AddressOf EditTCNow), 2, Now() & (" SendTo:" & Convert.ToString(RemotePoint) + "          ").Substring(0, 30) & "Data:" & Sendinf)

                        If Not IsDateTime(DevBufferUseTimeStr) Then  '记录的刷卡时间非法,表示此记录有问题(测试时的其它数据)
                            DevBufferUseTimeStr = "9999-99-99 99:99:99"
                        End If

                        '这里对脱网记录进行处理

                        If CheckBox3.Checked Then  '选择清除已上传的记录驱使用设备继续上传剩下的记录
                            Sendinf = "055," + DevBufferMachinStr + "," + DevBufferCardidStr + "," + DevBufferUseTimeStr + "," + DevBufferRecordAddStr '&&清除设备内当前这条记录,设备才会传下一条记录
                            SendBuf = Encoding.GetEncoding(936).GetBytes(Sendinf)
                            ListenerSock.SendTo(SendBuf, SendBuf.Length, SocketFlags.None, RemotePoint)
                            Me.Invoke(New EditTC(AddressOf EditTCNow), 2, Now() & (" SendTo:" & Convert.ToString(RemotePoint) + "          ").Substring(0, 30) & "Data:" & Sendinf)
                        End If

                    Case "158" '响应电脑远程开门的058指令
                        DevRecFramesStr = dataArray(1)      ' &&包序列号
                        DevBufferIpAddrStr = dataArray(2)   ' &&终端IP
                        DevBufferRemoteAddrStr = dataArray(3) '&&远程电脑指机IP
                        DevBufferMachinStr = dataArray(4)     '&&机号
                        DevBufferStaryStr = dataArray(5)      '&&0开门成功,1开门密码认证失败,2开门密码认证失败超过6次,需等待一段时间后再能再次接收058指令(防暴力破解),3 不允许此时间段开门
                        DevBufferRandomCode = dataArray(6)    '&&动态随机码(8位十六进制)

                        Me.Invoke(New EditTC(AddressOf EditTCNow), 10, DevBufferRandomCode)

                        Msg = ""
                        Select Case DevBufferStaryStr
                            Case "0"
                                Msg = "IP:" & DevBufferIpAddrStr & " 开门成功"
                            Case "1"
                                Msg = "IP:" & DevBufferIpAddrStr & " 开门密码认证失败!"
                            Case "2"
                                Msg = "IP:" & DevBufferIpAddrStr & " 开门密码认证失败超过6次,需等待一段时间后再能再次接收058指令(防暴力破解)"
                            Case "3"
                                Msg = "IP:" & DevBufferIpAddrStr & " 不允许此时间段开门"
                        End Select
                        Me.Invoke(New EditTC(AddressOf EditTCNow), 9, Msg)
                        Me.Invoke(New EditTC(AddressOf EditTCNow), 10, DevBufferRandomCode)

                    Case "159" '&&心跳信息
                        DevRecFramesStr = dataArray(1)      ' &&包序列号
                        DevBufferIpAddrStr = dataArray(2)   ' &&终端IP
                        DevBufferRemoteAddrStr = dataArray(3) '&&远程电脑指机IP
                        DevBufferMachinStr = dataArray(4)     '&&机号
                        DevBufferQrcodeInfStr = dataArray(5)  '&&信息类型
                        DevBufferSwitchStr = dataArray(6)     '继电器状态(bit0为第1门bit1为第2门)
                        DevBufferFireStr = dataArray(7)       '消防输入状态
                        DevBufferRandomCode = dataArray(8)    '&&动态随机码(8位十六进制)
                        DevBufferDatetimeStr = dataArray(9)   '日期时间
                        DevBufferSerialNumStr = dataArray(10) '设备硬件号

                        Me.Invoke(New EditTC(AddressOf EditTCNow), 10, DevBufferRandomCode)

                End Select


            Catch ex As Exception
                Me.Invoke(New EditTC(AddressOf EditTCNow), 2, "ERROR:" & vbCrLf & ex.GetHashCode & ex.Message & vbCrLf)
            End Try
        End While
    End Sub

 

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

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

相关文章

(C++类的初始化和清理)构造函数与析构函数

目录 1. 类的六个默认成员函数2. 构造函数&#xff08;Constructor&#xff09;2.1 概念2.2 特性 3. 析构函数&#xff08;Destructor&#xff09;3.1 概念3.2 特性 1. 类的六个默认成员函数 一个类中如果什么成员都没有&#xff0c;称为空类 class Date {};但是这并不代表空…

树状图PPT怎么做?用这个树状图制作软件轻松拿捏!

在我们的日常工作和学习中&#xff0c;PPT已经成为了我们常见的展示方式。 在制作PPT时&#xff0c;树状图PPT是非常重要和常用的一种&#xff0c;并且在商务、教育等领域都非常受欢迎。那么&#xff0c;究竟什么是树状图PPT&#xff0c;如何使用树状图制作软件来快速绘制树状…

肖sir__linux讲解(2.1)

linux命令 cp 复制命令 a、cp 原文件名称 新文 件名称&#xff08;不存在的文件&#xff09; 案例&#xff1a;cp a k 截图&#xff1a; b.cp 原文件名称 原有文 件名称&#xff08;存在的文件&#xff09; 案例:cp a b 截图&#xff1a; c、cp 指定路径复制 格式&#xff…

C#源代码生成器深入讲解二

在阅读本文前需掌握源代码生成器相关知识C#源代码生成器深入讲解一 C#源代码生成器深入讲解二—增量生成器 源代码生成器有个非常大的弊病&#xff0c;每次都会遍历所有的语法树来分析,这样就有个问题&#xff0c;每次可能只修改了很少一部分或者只有很少一部分的代码需要分析…

Linux使用Docker完整安装Superset3,同时解决please use superset_config.py to override it报错

文章目录 Docker安装Superset流程1. 首先获取镜像2. 生成SSL3. 创建Superset容器4. 更新数据库5. 测试访问Superset Docker安装Superset流程 1. 首先获取镜像 docker pull amancevice/superset2. 生成SSL 接下来我们运行一些额外的程序&#xff1a; openssl rand -base64 4…

每一天的努力,都会让远方变得更近——中国人民大学与加拿大女王大学金融硕士

在这个快速变化的时代&#xff0c;我们每个人都面临着各种挑战和机遇。要想在这个世界上获得成功和成就&#xff0c;就需要不断地努力和奋斗。因为只有不断地努力&#xff0c;我们才能够实现自己的梦想和目标&#xff0c;每一天的努力都会让远方变得更近。中国人民大学与加拿大…

STM32——STM32F103时钟解析(正点原子资料+HAL库代码分析)

文章目录 前言时钟树详解系统时钟配置系统时钟使能配置 前言 上次写系统时钟解析的时候说出一篇103的时钟解析&#xff0c;我就整理HAL库开发的正点的资料&#xff0c;给小白梳理&#xff0c;我也是小白&#xff0c;不做权威使用。 时钟树详解 在 STM32 中&#xff0c;有五个…

MATLAB与Excel的数据交互

准备阶段 clear all % 添加Excel函数 try Excel=actxGetRunningServer(Excel.Application); catch Excel=actxserver(Excel.application); end % 设置Excel可见 Excel.visible=1; 插入数据 % % 激活eSheet1 % eSheet1.Activate; % 或者 % Activate(eSheet1); % % 打开…

springboot使用MongoTemplate根据正则表达式查询日期数据

一、日期正则表达式测试 匹配HH:mm:ss正则表达式写法有很多列举两个 .(点)代表任意匹配 ^开头必须是跟着的 : 精确匹配,必须是: ([0-1]?[0-9]|2[0-3]).([0-5][0-9]).([0-5][0-9]) ^([0-1]?[0-9]|2[0-3]).([0-5][0-9]).([0-5][0-9])$ ([0-1]?[0-9]|2[0-3]):([0-5][0-9]):…

【机器学习9】前馈神经网络

深度前馈网络是一类网络模型的统称&#xff0c;主要包括多层感知机、 自编码器、限制玻尔兹曼机&#xff0c; 以及卷积神经网络等。 1 激活函数 激活函数及对应导函数图其它Sigmoid 导数 在z很大或很小时都会趋近于0&#xff0c; 造成梯度消失的现象Tanh 其导数在z很大或很小…

Python接口自动化(什么是接口、接口优势、类型)

简介 经常听别人说接口测试&#xff0c;接口测试自动化&#xff0c;但是你对接口&#xff0c;有多少了解和认识&#xff0c;知道什么是接口吗&#xff1f;它是用来做什么的&#xff0c;测试时候要注意什么&#xff1f;坦白的说&#xff0c;笔者之前也不是很清楚。接下来先看一下…

模拟实现一个Linux中的简单版shell

exec系列接口中的环境变量 在之前我们学习了exec系类函数的功能就是将一个程序替换成另外一个程序。 然后就会出现下面的问题&#xff1a; 首先父进程对应的环境变量的信息是从bash中来的&#xff0c;因为我们自己写的父进程在运行的时候首先就要成为bash的子进程。这里我们将…

解决计算机丢失msvcr71.dll问题,总结5种解决方法分享

由于各种原因&#xff0c;计算机在使用的过程中可能会出现一些问题&#xff0c;其中之一就是丢失msvcr71.dll文件。这个问题可能会导致计算机无法正常运行某些程序或功能&#xff0c;给我们的生活和工作带来困扰。那么&#xff0c;当我们遇到这个问题时&#xff0c;应该如何解决…

福利来了,运营素材免费下载

各位运营的小伙伴&#xff0c;是不是在日常工作中常常用到这种场景&#xff1a;公司要做一个活动&#xff0c;老板让你写一个活动SOP&#xff0c;但是没有过往经验&#xff0c;一时无从下手&#xff0c;老板又死催。 自己想了解拉新的办法&#xff0c;但是一时找不到资料&…

双十一快递业务量暴增,快递驿站视频智能监控方案保障快递业务顺利开展

一、背景分析 虽然刚刚过去的双十一电商购物狂潮结束&#xff0c;但是快递业务量仍处在高峰期。据数据统计&#xff0c;今年全国邮政快递企业在11月11日当天共揽收快递包裹6.39亿件&#xff0c;是平日业务量的1.87倍&#xff0c;同比增长15.76%。随着电商购物节的不断增多&…

【Qt之QWizardPage】使用

介绍 QWizardPage类是向导页面的基类。 QWizard表示一个向导。每个页面都是一个QWizardPage。当创建自己的向导时&#xff0c;可以直接使用QWizardPage&#xff0c;也可以子类化它以获得更多控制。 页面具有以下属性&#xff0c;由QWizard呈现&#xff1a;a title&#xff0c;…

易点易动库存管理系统:革新企业库存管理,降本增效

在快速变化的市场环境中&#xff0c;企业面临着库存管理的巨大挑战。传统的库存管理方式耗时耗力&#xff0c;且常常因为信息滞后、数据不精确而导致库存积压或短缺。易点易动库存管理系统&#xff08;以下简称“易点易动”&#xff09;的出现&#xff0c;标志着企业库存管理进…

前端性能优化的方式

文章目录 前言DNS 预解析存储使用 HTTP / 2.0预加载预渲染懒执行与懒加载文件优化webpack优化如何根据chrome的timing优化移动端优化后言 前言 hello world欢迎来到前端的新世界 &#x1f61c;当前文章系列专栏&#xff1a;前端系列文章 &#x1f431;‍&#x1f453;博主在前端…

Linux进程之进程的状态简述

文章目录 1.百度搜索2.对进程状态的认识2.0创建状态2.1就绪状态2.2运行状态2.3阻塞状态2.4挂起状态 3.认识LinuxOS下的进程3.0进程状态的简述3.1了解R/S状态3.2D深度睡眠状态3.3信号/调试暂停状态3.4僵尸状态 1.百度搜索 2.对进程状态的认识 一个进程所具有的状态为操作系统的…

demo(三)eurekaribbonhystrix----服务降级熔断

一、介绍&#xff1a; 1、雪崩&#xff1a; 多个微服务之间调用的时候&#xff0c;假如微服务A调用微服务B和微服务C&#xff0c;微服务B和微服务C又调用其他的微服务&#xff0c;这就是所谓的"扇出"。如果扇出的链路上某个微服务的调用响应的时间过长或者不可用&am…