C# 读写FDX-B(ISO11784/85)动物标签源码

news2024/12/26 11:11:57

本示例使用的发卡器:EM4305 EM4469 ISO11784/85协议125K低频FXD-B动物标签读写发卡器-淘宝网 (taobao.com) 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Runtime.InteropServices;  //调用动态库一定要加入这个引用

namespace FDX_B
{
    public partial class Form1 : Form
    {
        //------------------------------------------------------------------------------------------------------------------------------------------------------
        //外部函数声明:让设备发出声响
        [DllImport("OUR_IDR.dll", EntryPoint = "idr_beep", CallingConvention = CallingConvention.StdCall)]
        static extern byte idr_beep(UInt32 xms);//xms单位为毫秒 
        //------------------------------------------------------------------------------------------------------------------------------------------------------    
        //读取设备编号,可做为软件加密狗用,也可以根据此编号在公司网站上查询保修期限
        [DllImport("OUR_IDR.dll", EntryPoint = "pcdgetdevicenumber", CallingConvention = CallingConvention.StdCall)]
        static extern byte pcdgetdevicenumber(byte[] devicenumber);//devicenumber用于返回编号 
        //------------------------------------------------------------------------------------------------------------------------------------------------------    
        //EM4205/4305/4469/4569卡读卡
        [DllImport("OUR_IDR.dll", EntryPoint = "em4305_read", CallingConvention = CallingConvention.StdCall)]
        public static extern byte em4305_read(byte ctrlword, byte[] seria, byte[] key, byte[] blockflag, byte[] readdata);
        //------------------------------------------------------------------------------------------------------------------------------------------------------
        //EM4205/4305/4469/4569卡写卡
        [DllImport("OUR_IDR.dll", EntryPoint = "em4305_write", CallingConvention = CallingConvention.StdCall)]
        public static extern byte em4305_write(byte ctrlword, byte[] seria, byte[] key, byte[] blockflag, byte[] writedata);
        //------------------------------------------------------------------------------------------------------------------------------------------------------
        //EM4205/4305/4469/4569卡锁定块
        [DllImport("OUR_IDR.dll", EntryPoint = "em4305_lock", CallingConvention = CallingConvention.StdCall)]
        public static extern byte em4305_lock(byte ctrlword, byte[] seria, byte[] key, byte[] blockflag);
        //------------------------------------------------------------------------------------------------------------------------------------------------------
        //T5557卡读卡
        [DllImport("OUR_IDR.dll", EntryPoint = "t5557_read", CallingConvention = CallingConvention.StdCall)]
        public static extern byte t5557_read(byte ctrlword, byte[] seria, byte[] key, byte[] blockflag, byte[] readdata);
        //------------------------------------------------------------------------------------------------------------------------------------------------------
        //T5557卡写卡
        [DllImport("OUR_IDR.dll", EntryPoint = "t5557_write", CallingConvention = CallingConvention.StdCall)]
        public static extern byte t5557_write(byte ctrlword, byte[] seria, byte[] key, byte[] blockflag, byte[] writedata);

        public Form1()
        {
            InitializeComponent();
        }

        private void MessageErrInf(byte Errcode)
        {
            switch (Errcode)
            {
                case 1:
                    MessageBox.Show("错误代码:" + Errcode.ToString() + ",卡放得远 或 需要密码才能写卡 或 块已锁定!", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    break;
                case 2:
                    MessageBox.Show("错误代码:" + Errcode.ToString() + ",本卡尚未开启密码功能,函数myctrlword中无需加入NEEDKEY", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    break;
                case 3:
                    MessageBox.Show("错误代码:" + Errcode.ToString() + ",需要密码才能读卡,函数myctrlword要加入NEEDKEY", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    break;
                case 4:
                    MessageBox.Show("错误代码:" + Errcode.ToString() + ",卡放得远 或 需要密码才能读卡!", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    break;
                case 5:
                    MessageBox.Show("错误代码:" + Errcode.ToString() + ",密码错误!", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    break;
                case 8:
                    MessageBox.Show("错误代码:" + Errcode.ToString() + ",操作失败,请将卡放在读卡器的感应区!", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    break;
                case 12:
                    MessageBox.Show("错误代码:" + Errcode.ToString() + ",卡放得远 或 密码错误!", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    break;
                case 21:
                    MessageBox.Show("错误代码:" + Errcode.ToString() + ",没有动态库!", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    break;
                case 22:
                    MessageBox.Show("错误代码:" + Errcode.ToString() + ",动态库或驱动程序异常!", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    break;
                case 23:
                    MessageBox.Show("错误代码:" + Errcode.ToString() + ",驱动程序错误或发卡器尚未安装!", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    break;
                case 24:
                    MessageBox.Show("错误代码:" + Errcode.ToString() + ",操作超时,一般是动态库没有反映!", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    break;
                case 25:
                    MessageBox.Show("错误代码:" + Errcode.ToString() + ",发送字数不够!", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    break;
                case 28:
                    MessageBox.Show("错误代码:" + Errcode.ToString() + ",输入错误,可能是启用卡号密码保护而没在页面左上角选择带密码操作!", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    break;
                default:
                    MessageBox.Show("错误代码:" + Errcode.ToString() + ",未知的错误信息,错误代码:" + Errcode.ToString(), "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    break;
            }
        }

        private ushort GetCrc16Ccitt(byte[] bytes)  //计算crc16ccitt校验码
        {
            ushort crc = 0x0000;
            int i, j;

            for (j = 0; j < bytes.Length; j++)
            {
                crc ^= bytes[j];

                for (i = 0; i < 8; i++)
                {
                    if ((crc & 0x0001) > 0)
                    {
                        crc = (ushort)((crc >> 1) ^ 0x8408);
                    }
                    else { crc = (ushort)(crc >> 1); }
                }
            }
            return crc;
        }
        private ushort checkcrc16citt(byte[] bytes)  // 检测crc16ccitt校验
        {
            ushort crc = 0x0000;
            int i, j;

            for (j = 1; j <= 10; j++)
            {
                crc ^= bytes[j];

                for (i = 0; i < 8; i++)
                {
                    if ((crc & 0x0001) > 0)
                    {
                        crc = (ushort)((crc >> 1) ^ 0x8408);
                    }
                    else { crc = (ushort)(crc >> 1); }
                }
            }
            return crc;
        }

        private Boolean checkgetbitinf(string bitstr, byte[] info) //检测是否有效的FDX-B协议信息
        {
            for (int i = 0; i < 14; i++)
            {
                string thisbit = bitstr.Substring((i + 1) * 9 - 9, 9);
                if (thisbit.Substring(0, 1) == "1")
                {
                    info[13 - i] =(byte) Convert.ToInt16(thisbit.Substring(1, 8),2);
                }
                else { return false; };
            }
            ushort crcitt = checkcrc16citt(info);
            if (crcitt == 0)
            {
                return true;
            }
            else { return false; }            
        }


        private void button1_Click(object sender, EventArgs e)
        {
            byte status;                          //存放返回值
            int j;
            byte myctrlword = 0x00;               //控制字
            byte[] oldpicckey = new byte[4];      //密码
            byte[] mypiccserial = new byte[4];    //卡序列号
            byte[] mypiccdata = new byte[70];     //读卡数据缓冲:卡无线转输分频比、卡内容长度(字节数),及最多返回12个块的数据
            byte[] mypiccblockflag = new byte[2]; //指定读哪一块
            string bitstr;

            textBox1.Text = "0000";
            textBox2.Text = "000000000000";
            textBox3.Text = "00000";
            textBox4.Text = "00000000";
            
            mypiccblockflag[0] = 224;
            mypiccblockflag[1] = 1;

            status = em4305_read(myctrlword, mypiccserial, oldpicckey, mypiccblockflag, mypiccdata);
            if (status == 0)
            {
                idr_beep(30);
                string blockdata = "";
                for (int i = 0; i < mypiccdata[1]; i++)
                {
                    bitstr ="00000000"+ Convert.ToString(mypiccdata[2 + i], 2);
                    bitstr = bitstr.Substring(bitstr.Length - 8);
                    blockdata =bitstr+ blockdata;
                }
                byte[] info = new byte[14];
                if (checkgetbitinf(blockdata, info))
                {
                    string Serialnumberbit = "";
                    bitstr = "00000000" + Convert.ToString(info[1], 2);
                    bitstr = bitstr.Substring(bitstr.Length - 8);
                    Serialnumberbit = bitstr + Serialnumberbit;
                    bitstr = "00000000" + Convert.ToString(info[2], 2);
                    bitstr = bitstr.Substring(bitstr.Length - 8);
                    Serialnumberbit = bitstr + Serialnumberbit;
                    bitstr = "00000000" + Convert.ToString(info[3], 2);
                    bitstr = bitstr.Substring(bitstr.Length - 8);
                    Serialnumberbit = bitstr + Serialnumberbit;
                    bitstr = "00000000" + Convert.ToString(info[4], 2);
                    bitstr = bitstr.Substring(bitstr.Length - 8);
                    Serialnumberbit = bitstr + Serialnumberbit;
                    bitstr = "00000000" + Convert.ToString(info[5], 2);
                    bitstr = bitstr.Substring(bitstr.Length - 8);
                    string conutrybit = "";
                    conutrybit = bitstr.Substring(0, 2);
                    bitstr = bitstr.Substring(bitstr.Length - 6);
                    Serialnumberbit = bitstr + Serialnumberbit;
                    Int64 SerialnumberId = Convert.ToInt64(Serialnumberbit, 2);
                    textBox2.Text = SerialnumberId.ToString("D12");

                    bitstr = "00000000" + Convert.ToString(info[6], 2);
                    bitstr = bitstr.Substring(bitstr.Length - 8);
                    conutrybit = bitstr + conutrybit;
                    Int16 conutryid = Convert.ToInt16(conutrybit, 2);
                    textBox1.Text = conutryid.ToString("D4");
                    
                    bitstr = "00000000" + Convert.ToString(info[7], 2);
                    bitstr = bitstr.Substring(bitstr.Length - 8);
                    if (bitstr.Substring(7, 1) == "1") { checkBox3.Checked = true; } else { checkBox3.Checked = false; }

                    string Reservedbit = bitstr.Substring(0, 7);
                    
                    bitstr = "00000000" + Convert.ToString(info[8], 2);
                    bitstr = bitstr.Substring(bitstr.Length - 8);

                    if (bitstr.Substring(0, 1) == "1") { checkBox4.Checked = true; } else { checkBox4.Checked = false; }
                    Reservedbit = bitstr.Substring(1, 7) + Reservedbit;
                    Int16 Reserved = Convert.ToInt16(Reservedbit, 2);
                    textBox3.Text = Reserved.ToString("D5");

                    string Extensionbit = "";
                    bitstr = "00000000" + Convert.ToString(info[11], 2);
                    bitstr = bitstr.Substring(bitstr.Length - 8);
                    Extensionbit = bitstr + Extensionbit;
                    bitstr = "00000000" + Convert.ToString(info[12], 2);
                    bitstr = bitstr.Substring(bitstr.Length - 8);
                    Extensionbit = bitstr + Extensionbit;
                    bitstr = "00000000" + Convert.ToString(info[13], 2);
                    bitstr = bitstr.Substring(bitstr.Length - 8);
                    Extensionbit = bitstr + Extensionbit;
                    Int32 Extension = Convert.ToInt32(Extensionbit, 2);
                    textBox4.Text = Extension.ToString("D8");
                }
                else
                {
                    MessageBox.Show("不是有效的FDX-B协议标签!", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            } 
            else { MessageErrInf(status); }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Int16 conutryid = Convert.ToInt16(textBox1.Text.Trim());
            Int64 SerialnumberId = Convert.ToInt64(textBox2.Text.Trim());
            Int16 Reserved = Convert.ToInt16(textBox3.Text.Trim());
            Int32 Extension = Convert.ToInt32(textBox4.Text.Trim());

            if (conutryid > 1023){
                MessageBox.Show("Country国家代码的取值范围是:0~1023!", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                textBox1.SelectionStart = 0;
                textBox1.SelectionLength = textBox1.Text.Trim().Length;
                textBox1.Select();
                return;
            }

            if (SerialnumberId > 274877906943)
            {
                MessageBox.Show("SerialNumber序列号的取值范围是:0~274877906943!", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                textBox2.SelectionStart = 0;
                textBox2.SelectionLength = textBox2.Text.Trim().Length;
                textBox2.Select();
                return;
            }

            if (Reserved > 16383)
            {
                MessageBox.Show("Reserved保留信息的取值范围是:0~16383!", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                textBox3.SelectionStart = 0;
                textBox3.SelectionLength = textBox3.Text.Trim().Length;
                textBox3.Select();
                return;
            }

            if (Extension > 16777215)
            {
                MessageBox.Show("Extension扩展信息的取值范围是:0~16777215!", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                textBox4.SelectionStart = 0;
                textBox4.SelectionLength = textBox4.Text.Trim().Length;
                textBox4.Select();
                return;
            }

            string Extensionbit = "000000000000000000000000"+Convert.ToString(Extension, 2);
            Extensionbit = Extensionbit.Substring(Extensionbit.Length - 24);

            string Reservedbit = "00000000000000" + Convert.ToString(Reserved, 2);
            Reservedbit = Reservedbit.Substring(Reservedbit.Length - 14);
            if (checkBox4.Checked) { Reservedbit = "1" + Reservedbit; } else { Reservedbit = "0" + Reservedbit; }
            if (checkBox3.Checked) { Reservedbit =  Reservedbit+"1"; } else { Reservedbit =  Reservedbit+"0"; }

            string conutrybit = "0000000000" + Convert.ToString(conutryid, 2);
            conutrybit = conutrybit.Substring(conutrybit.Length - 10);

            string Serialnumberbit = "00000000000000000000000000000000000000" + Convert.ToString(SerialnumberId, 2);
            Serialnumberbit = Serialnumberbit.Substring(Serialnumberbit.Length - 38);

            string fdxbitstr = "10000000000";       //前导码
            fdxbitstr = "1" + Serialnumberbit.Substring(30, 8) + fdxbitstr;
            fdxbitstr = "1" + Serialnumberbit.Substring(22, 8) + fdxbitstr;
            fdxbitstr = "1" + Serialnumberbit.Substring(14, 8) + fdxbitstr;
            fdxbitstr = "1" + Serialnumberbit.Substring(6, 8) + fdxbitstr;
            fdxbitstr = "1" + conutrybit.Substring(8, 2) + Serialnumberbit.Substring(0, 6) + fdxbitstr;
            fdxbitstr = "1" + conutrybit.Substring(0, 8) + fdxbitstr;
            fdxbitstr = "1" + Reservedbit.Substring(8, 8) + fdxbitstr;
            fdxbitstr = "1" + Reservedbit.Substring(0, 8) + fdxbitstr;

            byte[] info = new byte[8]; 
            for (int i = 0; i < 8; i++)
            {
                string thisbit = fdxbitstr.Substring((i + 1) * 9 - 9, 9);
                if (thisbit.Substring(0, 1) == "1")
                {
                    info[7 - i] = (byte)Convert.ToInt16(thisbit.Substring(1, 8), 2);
                }
            }
            ushort crc16ccitt = GetCrc16Ccitt(info);
            string crcbit = "0000000000000000" + Convert.ToString(crc16ccitt, 2);
            crcbit = crcbit.Substring(crcbit.Length - 16);
            fdxbitstr = "1" + crcbit.Substring(8, 8) + fdxbitstr;
            fdxbitstr = "1" + crcbit.Substring(0, 8) + fdxbitstr;

            fdxbitstr = "1" + Extensionbit.Substring(16, 8) + fdxbitstr;
            fdxbitstr = "1" + Extensionbit.Substring(8, 8) + fdxbitstr;
            fdxbitstr = "1" + Extensionbit.Substring(0, 8) + fdxbitstr;

            byte[] writebuf = new byte[16];
            for (int i = 0; i < 16; i++)
            {
                string thisbit = fdxbitstr.Substring((i + 1) * 8 - 8, 8);
                writebuf[15 - i] = (byte)Convert.ToInt16(thisbit, 2);
            }

            byte status;                          //存放返回值
            byte myctrlword = 0x00;               //控制字
            byte[] oldpicckey = new byte[4];      //密码
            byte[] mypiccserial = new byte[4];    //卡序列号
            byte[] mypiccblockflag = new byte[2]; //指定读哪一块

            mypiccblockflag[0] = 224;
            mypiccblockflag[1] = 1;

            status = em4305_write(myctrlword, mypiccserial, oldpicckey, mypiccblockflag, writebuf);
            if (status == 0)
            {
                if (checkBox2.Checked){
                    em4305_lock(myctrlword, mypiccserial, oldpicckey, mypiccblockflag);
                }

                string seriaStr = "";
                for (int i = 0; i < 4; i++)
                {
                    seriaStr = seriaStr + mypiccserial[i].ToString("X2");
                }
                idr_beep(30);
                MessageBox.Show("卡号:" + seriaStr + "写FDX-B协议标签成功!", "提示:", MessageBoxButtons.OK , MessageBoxIcon.Information );
                if (checkBox1.Checked)
                {
                    SerialnumberId = SerialnumberId + 1;
                    textBox2.Text = SerialnumberId.ToString("D12");
                }
            }
            else { MessageErrInf(status); }

        }

        private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8)
            {
                e.Handled = true;
            }
            else { e.Handled = false; }
        }

        private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8)
            {
                e.Handled = true;
            }
            else { e.Handled = false; }
        }

        private void textBox3_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8)
            {
                e.Handled = true;
            }
            else { e.Handled = false; }
        }

        private void textBox4_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8)
            {
                e.Handled = true;
            }
            else { e.Handled = false; }
        }


        private void checkBox2_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBox2.Checked)
            {
                if (MessageBox.Show("选择写卡成功后锁定保护将不能再次更改标签信息,确定要启动保护功能吗!", "提示:", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
                {
                    checkBox2.Checked = false;
                }
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            byte status = idr_beep(50);
            if(status!=0){
                MessageErrInf(status);
            }
        }
    }
}

 

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

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

相关文章

客户案例:保障高校邮件安全,守护教育信息安全堡垒

客户背景 电子科技大学&#xff08;以下简称“电子科大”&#xff09;&#xff0c;位于四川省成都市&#xff0c;是一所历史悠久、实力雄厚的综合性工业大学。作为我国重点建设的双一流高校&#xff0c;电子科大在国内外均享有盛誉&#xff0c;其学科涵盖了理、工、管、文等多…

list的总结

目录 1.什么是list 1.1list 的优势和劣势 优势&#xff1a; 劣势&#xff1a; 2.构造函数 2.1 default (1) 2.2 fill (2) 2.3 range (3) 2.4 copy (4) 3.list iterator的使用 3.1. begin() 3.2. end() 3.3迭代器遍历 4. list容量函数 4.1. empty() 4.2. siz…

拒绝大厂重回OpenAI?秋招学一波奥特曼的选offer思路

大家好&#xff0c;我是鱼皮。最近 编程导航 很多同学秋招上岸了&#xff0c;我收到最多的鱼友提问就是&#xff1a;秋招的 offer 应该怎么选&#xff1f; 今年的大厂秋招行情和去年比起来转暖了不少&#xff0c;特别是在一些关键的技术岗位上&#xff0c;大厂们拿出了一种「砸…

Excel表中合并两个Sheet的方法?

按AltF11&#xff0c;调出Visual Basic 界面。 在左侧窗口中&#xff0c;右键选择“插入”—“模块”&#xff1a; 将如下代码粘贴进去&#xff0c;点击运行按钮&#xff0c;完成数据表合并。 Sub MergeAllSheetsInThisWorkbook() On Error Resume Next Application.ScreenU…

CPU+GPU多样化算力,ZStack Cloud助力游戏精酿核心业务上云

游戏精酿通过ZStack Cloud云平台提供高性能、高可用的云主机、云存储和云网络&#xff1b;前期通过超融合架构快速构建云基础设施&#xff0c;来支持Jira、Redis等关键业务&#xff1b;并实现对原有私有云平台业务的替代&#xff0c;按需将原有私有云业务滚动迁移到ZStack Clou…

企业海外分部,如何实现安全稳定的跨境网络互连?

如今&#xff0c;众多企业广泛采取数字化业务系统&#xff0c;如OA、ERP及CRM等&#xff0c;来提升其业务运营效率。同时&#xff0c;私有云与公有云混合架构也逐渐普及化。 具体来说&#xff0c;很多企业选择将研发系统部署在公司本地的私有云环境&#xff0c;以此确保数据安全…

气膜厂家如何确保质量?

气膜厂家是专门生产和销售气膜产品的企业&#xff0c;需要对产品的质量进行有效管理和控制&#xff0c;以确保产品能够满足客户的需求和期望。下面将从生产过程、质量控制手段和售后服务等方面介绍气膜厂家如何确保产品质量。 起初&#xff0c;气膜厂家需要建立完善的质量管理…

7.5 Windows驱动开发:监控Register注册表回调

在笔者前一篇文章《内核枚举Registry注册表回调》中实现了对注册表的枚举&#xff0c;本章将实现对注册表的监控&#xff0c;不同于32位系统在64位系统中&#xff0c;微软为我们提供了两个针对注册表的专用内核监控函数&#xff0c;通过这两个函数可以在不劫持内核API的前提下实…

Grafana实现下拉列表 、动态传参

程序员的公众号&#xff1a;源1024&#xff0c;获取更多资料&#xff0c;无加密无套路&#xff01; 最近整理了一份大厂面试资料《史上最全大厂面试题》&#xff0c;Springboot、微服务、算法、数据结构、Zookeeper、Mybatis、Dubbo、linux、Kafka、Elasticsearch、数据库等等 …

手表出行之腕上畅玩—支付宝篇

线上支付己经成为我们生活中不可或缺的一部分&#xff0c;手表的支付功能又进一步提升了购物的便捷度&#xff0c;将手表与支付宝App绑定后就能够快速体验抬腕支付、抬腕乘车以及抬腕收集支付宝能量等玩法&#xff01;

yolov5从英伟达平台移植到华为昇腾开发板上的思路

作者&#xff1a;朱金灿 来源&#xff1a;clever101的专栏 为什么大多数人学不会人工智能编程&#xff1f;>>> 最近需要将yolov5代码从英伟达平台移植到华为昇腾开发板上。搜了一些代码和资料&#xff0c;大致明白了二者的差别。 1.二者使用的模型文件不一样 yolov…

oracle的debjob挂載及查詢

背景 有一個需求需要定時去執行一個produce&#xff0c;可以使用oracle的dbjob定時執行&#xff0c;相比較之前的vbs更加絲滑 --傳遞produce 開始的時間 頻率 declarea number;beginDBMS_JOB.SUBMIT(a,xx_warehouse_daliy_record_p;,to_date(202311230800,yyyymmddhh24mi),…

物联网AI MicroPython学习之语法 实时时钟RTC

学物联网&#xff0c;来万物简单IoT物联网&#xff01;&#xff01; RTC 介绍 模块功能: 实时时钟RTC驱动模块 接口说明 RTC - 构建RTC对象 函数原型&#xff1a;RTC()参数说明&#xff1a; 无 返回值&#xff1a; 构建的RTC对象。 datetime - RTC时钟操作 函数原型&a…

RevCol:可逆的柱状神经网络

文章目录 摘要1、简介2、方法2.1、Multi-LeVEl ReVERsible Unit2.2、可逆列架构2.2.1、MACRo设计2.2.2、MicRo 设计 2.3、中间监督 3、实验部分3.1、图像分类3.2、目标检测3.3、语义分割3.4、与SOTA基础模型的系统级比较3.5、更多分析实验3.5.1、可逆列架构的性能提升3.5.2、可…

UNETR++:深入研究高效和准确的3D医学图像分割

论文&#xff1a;https://arxiv.org/abs/2212.04497 代码&#xff1a;GitHub - Amshaker/unetr_plus_plus: UNETR: Delving into Efficient and Accurate 3D Medical Image Segmentation 机构&#xff1a;Mohamed Bin Zayed University of Artificial Intelligence1, Univers…

从Redis反序列化UserDetails对象异常后中发现FastJson序列化的一些问题

最近在使用SpringSecurityJWT实现认证授权的时候&#xff0c;出现Redis在反序列化userDetails的异常。通过实践发现&#xff0c;使用不同的序列化方法和不同的fastJson版本&#xff0c;异常信息各不相同。所以特地记录了下来。 一、项目代码 先来看看我项目中redis相关配置信息…

**QT与目标板联合调试_断点仿真**

原文地址: https://blog.csdn.net/u012851408/article/details/86715626

浅析电力电容器的防火防爆及改进措施

安科瑞 华楠 摘要&#xff1a;电容器着火爆炸的原因有管理上的疏忽、保养不到位、频繁投切、高次谐波、存在于易燃易爆的环境之中以及电容器选型、安装、保护不恰当等&#xff0c;电容器的防火防爆&#xff0c;应根据这些原因采取相应的措施。关键词&#xff1a;电力电容器&am…

保姆级 ARM64 CPU架构下安装部署Docker + rancher + K8S 说明文档

1 K8S 简介 K8S是Kubernetes的简称&#xff0c;是一个开源的容器编排平台&#xff0c;用于自动部署、扩展和管理“容器化&#xff08;containerized&#xff09;应用程序”的系统。它可以跨多个主机聚集在一起&#xff0c;控制和自动化应用的部署与更新。 K8S 架构 Kubernete…

如何开发有趣而富有创意的营销小游戏

在数字化时代&#xff0c;企业通过创意而独特的方式与目标受众互动&#xff0c;已成为提高品牌知名度和用户参与度的重要手段之一。其中&#xff0c;设计一款引人入胜的营销小游戏&#xff0c;不仅能吸引用户的眼球&#xff0c;还能有效传达品牌信息。以下是一些建议&#xff0…