当前位置: 首页 > news >正文

C# 基于腾讯云人脸核身和百度云证件识别技术相结合的 API 实现

目录

腾讯云人脸核身技术

Craneoffice.net 采用的识别方式

        1、活体人脸核身(权威库):

        2、活体人脸比对:

        3、照片人脸核身(权威库):

调用成本

百度云身份证识别

调用成本

相关结合点

核心代码

实现调用人脸核身API的示例 

实现调用身份证识别API的示例 

小结


腾讯云人脸核身技术

根据腾讯云的官方介绍,其慧眼人脸核身是一组对用户身份信息真实性进行验证审核的服务套件,提供人脸核身、身份信息核验、银行卡要素核验和运营商类要素核验等各类实名信息认证能力,以解决行业内大量对用户身份信息核实的需求。

Craneoffice.net 采用的识别方式

由于其产品众多,考虑一些综合因素,我们在 Craneoffice.net 架构里主要实现以下三种识别方式:

        1、活体人脸核身(权威库):

         流程为通过录制一段人脸活体静态视频,与大数据权威库身份证信息进行比对,判断是否为 同一人。

        2、活体人脸比对:

         流程为通过上传正确、清晰的身份证正面图片,截取头像图片,再通过录制人脸活体静态视频进行比对,判断是否为同一人。

        3、照片人脸核身(权威库):

         流程为上传正确的身份证正面图片,截取头像图片,传递身份证号与姓名,与大数据权威库身份证信息进行比对,判断是否为同一人。

调用成本

申请开发账号及具体费用情况请访问腾讯云人脸核身产品首页:

https://cloud.tencent.com/act/pro/huiyandiscount

我们的产品调用成本如下表,可参照一下比例,在此仅供参考:

识别方式调用成功的成本
活体人脸核身(权威库)1元 / 每次
活体人脸比对0.15元 / 每次
照片人脸核身(权威库)1元 / 每次

总之,在腾讯云商城购买越大的产品包调用成本越低,如果有优惠活动则更为合适。

百度云身份证识别

其官方宣传可以结构化识别二代居民身份证正反面所有8个字段,识别准确率超过99%;支持识别混贴身份证,适用于同一张图上有多张身份证正反面的场景;支持检测身份证正面头像,并返回头像切片的base64编码及位置信息,其具体详细产品介绍请访问如下地址:

https://ai.baidu.com/tech/ocr_cards/idcard

调用成本

我们使用的是企业申请,一个月应该可以享受2000次免费调用,后期调用应该是0.02元左右每次,具体可参照:

https://ai.baidu.com/ai-doc/OCR/fk3h7xune#%E8%BA%AB%E4%BB%BD%E8%AF%81%E8%AF%86%E5%88%AB

相关结合点

在人脸核身方面,虽然我们可以直接提供身份证号、姓名、自拍抠图的头像BASE64编码等参数传递给腾讯云识别接口,但考虑到实际应用场景中,更加规范、有效的验证有助于提升应用程序数据的质量和精准性,也更加保障了识别结果的准确性。

因此身份证的识别功能和人脸核身功能即可以单独独立运行,又可以利用产品特性相结合,实现数据采集、校验的双保险。

具体流程如下图:

核心代码

实现调用人脸核身API的示例 

该示例代码以上小节的介绍的三种识别方式实现,仅供参考:

//定义人脸识别类public class FaceR{public string ResultJson = "";   //记录返回 json 结果public string apiurl = "faceid.tencentcloudapi.com"; //腾讯人脸识别API地址public string debuginfo = "";  //调试信息public string ErrorMessage = "";  //错误信息string[] signHeaders = null;      //头部签名数组public FaceR(){}//活体人脸核身方法,参数为身份证号;检验类型,这里传固定值 SILENT;姓名;活体的静态视频编码;方法返回相似度值等信息public string LivenessRecognition(string IdCard,string LivenessType,string Name,string VideoBase64){string content = "{  \"IdCard\":\"" + IdCard + "\",\"LivenessType\":\"" + LivenessType + "\", \"Name\":\"" + Name + "\" ,\"VideoBase64\":\"" + VideoBase64 + "\"}";// 密钥参数string SECRET_ID = 你申请的IDstring SECRET_KEY = 你申请的KEYstring service = "faceid";string endpoint = "faceid.tencentcloudapi.com";string region = "ap-guangzhou";string action = "LivenessRecognition";string version = "2018-03-01";// 注意时区,建议此时间统一采用UTC时间戳,否则容易出错DateTime date = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc).AddSeconds(1551113065);date = DateTime.UtcNow;string requestPayload = content;Dictionary<string, string> headers = BuildHeaders(SECRET_ID, SECRET_KEY, service, endpoint, region, action, version, date, requestPayload);string rv = "POST https://faceid.tencentcloudapi.com\n";ArrayList hs = new ArrayList();foreach (KeyValuePair<string, string> kv in headers){rv += (kv.Key + ": " + kv.Value) + "\n";hs.Add(kv.Key + ": " + kv.Value);}rv += "\n";hs.Add("");rv += requestPayload + "\n";string[] hss = new string[hs.Count];debuginfo = "";for (int i = 0; i < hs.Count; i++){hss[i] = hs[i].ToString();debuginfo += hss[i] + "\r\n";}signHeaders = hss;string rvs = "";rvs=GetResponseResult("https://faceid.tencentcloudapi.com", Encoding.UTF8, "POST",content, signHeaders);return rvs;}//活体人脸比对方法,参数为传递检验类型,这里传固定值 SILEN;身份证头像图片编码;活体的静态视频编码,方法返回相似度值等信息public string LivenessCompare(string LivenessType, string ImageBase64, string VideoBase64){string content = "{ \"LivenessType\":\"" + LivenessType + "\", \"ImageBase64\":\"" + ImageBase64 + "\" ,\"VideoBase64\":\"" + VideoBase64 + "\"}";// 密钥参数string SECRET_ID = 你申请的IDstring SECRET_KEY = 你申请的KEYstring service = "faceid";string endpoint = "faceid.tencentcloudapi.com";string region = "ap-guangzhou";string action = "LivenessCompare";string version = "2018-03-01";// 注意时区,建议此时间统一采用UTC时间戳,否则容易出错DateTime date = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc).AddSeconds(1551113065);date = DateTime.UtcNow;string requestPayload = content;Dictionary<string, string> headers = BuildHeaders(SECRET_ID, SECRET_KEY, service, endpoint, region, action, version, date, requestPayload);string rv = "POST https://faceid.tencentcloudapi.com\n";ArrayList hs = new ArrayList();foreach (KeyValuePair<string, string> kv in headers){rv += (kv.Key + ": " + kv.Value) + "\n";hs.Add(kv.Key + ": " + kv.Value);}rv += "\n";hs.Add("");rv += requestPayload + "\n";string[] hss = new string[hs.Count];debuginfo = "";for (int i = 0; i < hs.Count; i++){hss[i] = hs[i].ToString();debuginfo += hss[i] + "\r\n";}signHeaders = hss;string rvs = "";rvs = GetResponseResult("https://faceid.tencentcloudapi.com", Encoding.UTF8, "POST", content, signHeaders);return rvs;}//照片人脸核身方法,参数传递身份证号;姓名;截取的身份证头像图片编码;方法返回相似度值等信息public string ImageRecognition(string IdCard,string Name, string ImageBase64){string content = "{ \"IdCard\":\"" + IdCard + "\", \"Name\":\"" + HttpUtility.UrlDecode(Name, Encoding.UTF8) + "\" ,\"ImageBase64\":\"" + ImageBase64 + "\"}";// 密钥参数string SECRET_ID = 你申请的IDstring SECRET_KEY = 你申请的KEYstring service = "faceid";string endpoint = "faceid.tencentcloudapi.com";string region = "ap-guangzhou";string action = "ImageRecognition";string version = "2018-03-01";// 注意时区,建议此时间统一采用UTC时间戳,否则容易出错DateTime date = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc).AddSeconds(1551113065);date = DateTime.UtcNow;string requestPayload = content;Dictionary<string, string> headers = BuildHeaders(SECRET_ID, SECRET_KEY, service, endpoint, region, action, version, date, requestPayload);string rv = "POST https://faceid.tencentcloudapi.com\n";ArrayList hs = new ArrayList();foreach (KeyValuePair<string, string> kv in headers){rv += (kv.Key + ": " + kv.Value) + "\n";hs.Add(kv.Key + ": " + kv.Value);}rv += "\n";hs.Add("");rv += requestPayload + "\n";string[] hss = new string[hs.Count];debuginfo = "";for (int i = 0; i < hs.Count; i++){hss[i] = hs[i].ToString();debuginfo += hss[i] + "\r\n";}signHeaders = hss;string rvs = "";rvs = GetResponseResult("https://faceid.tencentcloudapi.com", Encoding.UTF8, "POST", content, signHeaders);return rvs;}//SHA256Hex算法public static string SHA256Hex(string s){using (SHA256 algo = SHA256.Create()){byte[] hashbytes = algo.ComputeHash(Encoding.UTF8.GetBytes(s));StringBuilder builder = new StringBuilder();for (int i = 0; i < hashbytes.Length; ++i){builder.Append(hashbytes[i].ToString("x2"));}return builder.ToString();}}//HMAC-SHA256算法public static byte[] HmacSHA256(byte[] key, byte[] msg){using (HMACSHA256 mac = new HMACSHA256(key)){return mac.ComputeHash(msg);}}//构造头部签名public static Dictionary<String, String> BuildHeaders(string secretid,string secretkey, string service, string endpoint, string region,string action, string version, DateTime date, string requestPayload){string datestr = date.ToString("yyyy-MM-dd");DateTime startTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);long requestTimestamp = (long)Math.Round((date - startTime).TotalMilliseconds, MidpointRounding.AwayFromZero) / 1000;// ************* 步骤 1:拼接规范请求串 *************string algorithm = "TC3-HMAC-SHA256";string httpRequestMethod = "POST";string canonicalUri = "/";string canonicalQueryString = "";string contentType = "application/json";string canonicalHeaders = "content-type:" + contentType + "; charset=utf-8\n"+ "host:" + endpoint + "\n"+ "x-tc-action:" + action.ToLower() + "\n";string signedHeaders = "content-type;host;x-tc-action";string hashedRequestPayload = SHA256Hex(requestPayload);string canonicalRequest = httpRequestMethod + "\n"+ canonicalUri + "\n"+ canonicalQueryString + "\n"+ canonicalHeaders + "\n"+ signedHeaders + "\n"+ hashedRequestPayload;Console.WriteLine(canonicalRequest);// ************* 步骤 2:拼接待签名字符串 *************string credentialScope = datestr + "/" + service + "/" + "tc3_request";string hashedCanonicalRequest = SHA256Hex(canonicalRequest);string stringToSign = algorithm + "\n"+ requestTimestamp.ToString() + "\n"+ credentialScope + "\n"+ hashedCanonicalRequest;Console.WriteLine(stringToSign);// ************* 步骤 3:计算签名 *************byte[] tc3SecretKey = Encoding.UTF8.GetBytes("TC3" + secretkey);byte[] secretDate = HmacSHA256(tc3SecretKey, Encoding.UTF8.GetBytes(datestr));byte[] secretService = HmacSHA256(secretDate, Encoding.UTF8.GetBytes(service));byte[] secretSigning = HmacSHA256(secretService, Encoding.UTF8.GetBytes("tc3_request"));byte[] signatureBytes = HmacSHA256(secretSigning, Encoding.UTF8.GetBytes(stringToSign));string signature = BitConverter.ToString(signatureBytes).Replace("-", "").ToLower();Console.WriteLine(signature);// ************* 步骤 4:拼接 Authorization *************string authorization = algorithm + " "+ "Credential=" + secretid + "/" + credentialScope + ", "+ "SignedHeaders=" + signedHeaders + ", "+ "Signature=" + signature;Console.WriteLine(authorization);Dictionary<string, string> headers = new Dictionary<string, string>();headers.Add("Authorization", authorization);headers.Add("Host", endpoint);headers.Add("Content-Type", contentType + "; charset=utf-8");headers.Add("X-TC-Timestamp", requestTimestamp.ToString());headers.Add("X-TC-Version", version);headers.Add("X-TC-Action", action);headers.Add("X-TC-Region", region);return headers;}//调用API地址,传递参数并获取返回值的通用方法public string GetResponseResult(string url, System.Text.Encoding encoding, string method, string postData, string[] headers, string ContentType = "application/x-www-form-urlencoded"){method = method.ToUpper();System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls | System.Net.SecurityProtocolType.Tls11 | System.Net.SecurityProtocolType.Tls12;if (method == "GET"){try{WebRequest request2 = WebRequest.Create(@url);request2.Method = method;WebResponse response2 = request2.GetResponse();Stream stream = response2.GetResponseStream();StreamReader reader = new StreamReader(stream, encoding);string content = reader.ReadToEnd();return content;}catch (Exception ex){ErrorMessage = ex.Message;return "";}}Stream outstream = null;Stream instream = null;StreamReader sr = null;HttpWebResponse response = null;HttpWebRequest request = null;byte[] data = encoding.GetBytes(postData);// 准备请求...try{// 设置参数request = WebRequest.Create(url) as HttpWebRequest;CookieContainer cookieContainer = new CookieContainer();request.CookieContainer = cookieContainer;request.AllowAutoRedirect = true;request.Method = method;debuginfo = headers.GetLength(0).ToString()+"\r\n";if (headers != null){for (int i = 0; i < headers.GetLength(0); i++){if (headers[i].Split(':').Length < 2){continue;}debuginfo += i.ToString()+headers[i]+"\r\n";if (headers[i].Split(':').Length > 1){if (headers[i].Split(':')[0] == "Host"){request.Host = headers[i].Split(':')[1].Trim();continue;}else if (headers[i].Split(':')[0] == "Content-Type"){request.ContentType = headers[i].Split(':')[1].Trim();ContentType = headers[i].Split(':')[1].Trim();continue;}}request.Headers.Add(headers[i].Trim());}debuginfo += "sd2" + "\r\n";}request.ContentType = ContentType;request.ContentLength = data.Length;outstream = request.GetRequestStream();outstream.Write(data, 0, data.Length);outstream.Close();//发送请求并获取相应回应数据response = request.GetResponse() as HttpWebResponse;//直到request.GetResponse()程序才开始向目标网页发送Post请求instream = response.GetResponseStream();sr = new StreamReader(instream, encoding);//返回结果网页(html)代码string content = sr.ReadToEnd();return content;}catch (Exception ex){ErrorMessage = ex.Message;return "";}}//get response result}

实现调用身份证识别API的示例 

                public class IdCard{public string name = "";        //姓名public string sex = "";         //性别public string photo_base64 = "";    //截取的身份证头像图像的编码值 public string nation = "";       //民族public string address = "";      //住址public string IDNumber = "";      //身份证号public string birthday = "";      //生日public string org = "";           //发证机关public string startDate = "";      //有效期起public string endDate = "";        //有效期止public string ResultJson = "";     //记录返回的JSON值public string ErrorMessage = "";   //记录错误信息public string direction = "";        //上传时图片的方向public string image_status = "";     //上传图片的识别状态public string risk_type = "";        //上传图片的识别类型public string edit_tool = "";        //上传图片是否P图public string idcard_number_type = "";   //上传图片的识别错误信息public IdCard(){}//得到指定文件的 byte[],参数为文件绝对路径值private  byte[] getImageByte(string imagePath){FileStream files = new FileStream(imagePath, FileMode.Open);byte[] imgByte = new byte[files.Length];files.Read(imgByte, 0, imgByte.Length);files.Close();return imgByte;}//识别身份证信息方法,参数为文件绝对路径值;正反面值:正面传 front,反面传 backpublic void valid(string imagePath, string id_card_side){name = "";sex = "";photo_base64 = "";nation = "";address = "";IDNumber = "";birthday = "";org = "";startDate = "";endDate = "";direction="";image_status = "";risk_type = "";edit_tool = "";idcard_number_type = "";byte[] image = getImageByte(imagePath);var APP_ID = 申请的开发ID;var API_KEY = 申请的开发KEY;var SECRET_KEY = 开发密钥;var client = new Baidu.Aip.Ocr.Ocr(API_KEY, SECRET_KEY);client.Timeout = 60000;  // 修改超时时间Newtonsoft.Json.Linq.JObject result = new JObject();var options = new Dictionary<string, object>{{"detect_risk", "true"},{"detect_direction", "true"},{"detect_photo", "true"}};try{result = client.Idcard(image, id_card_side, options);ResultJson = result.ToString();if (id_card_side == "front"){name = result["words_result"]["姓名"]["words"].ToString();sex = result["words_result"]["性别"]["words"].ToString();nation = result["words_result"]["民族"]["words"].ToString();address = result["words_result"]["住址"]["words"].ToString();IDNumber = result["words_result"]["公民身份号码"]["words"].ToString();photo_base64 = result["photo"].ToString();birthday = result["words_result"]["出生"]["words"].ToString();birthday = birthday.Substring(0, 4) + "-" + birthday.Substring(4, 2) + "-" + birthday.Substring(6, 2);}if (id_card_side == "back"){org = result["words_result"]["签发机关"]["words"].ToString();startDate = result["words_result"]["签发日期"]["words"].ToString();startDate = startDate.Substring(0, 4) + "-" + startDate.Substring(4, 2) + "-" + startDate.Substring(6, 2);endDate = result["words_result"]["失效日期"]["words"].ToString();endDate = endDate.Substring(0, 4) + "-" + endDate.Substring(4, 2) + "-" + endDate.Substring(6, 2);}direction = result["direction"].ToString();switch (direction){case "-1":direction = "未定义";break;case "0":direction = "正向";break;case "1":direction = "逆时针90度";break;case "2":direction = "逆时针180度";break;case "3":direction = "逆时针270度";break;}image_status = result["image_status"].ToString();switch (image_status){case "normal":image_status = "识别正常";break;case "reversed_side":image_status = "身份证正反面颠倒";break;case "non_idcard":image_status = "上传的图片中不包含身份证";break;case "blurred":image_status = "身份证模糊";break;case "other_type_card":image_status = "其他类型证照";break;case "over_exposure":image_status = "身份证关键字段反光或过曝";break;case "over_dark":image_status = "身份证欠曝(亮度过低)";break;case "unknown":image_status = "未知状态";break;}risk_type = result["risk_type"].ToString();switch (risk_type){case "normal":risk_type = "正常身份证";break;case "copy":risk_type = "复印件";break;case "temporary":risk_type = "临时身份证";break;case "screen":risk_type = "翻拍";break;case "unknown":risk_type = "其他未知情况";break;}if (ResultJson.IndexOf("edit_tool") != -1){edit_tool = result["edit_tool"].ToString();}else{edit_tool = "未P图";}if (ResultJson.IndexOf("idcard_number_type") != -1){idcard_number_type = result["idcard_number_type"].ToString();switch (idcard_number_type){case "-1":idcard_number_type = "身份证正面所有字段全为空";break;case "0":idcard_number_type = "身份证证号识别错误";break;case "1":idcard_number_type = "身份证证号和性别、出生信息一致";break;case "2":idcard_number_type = "身份证证号和性别、出生信息都不一致";break;case "3":idcard_number_type = "身份证证号和出生信息不一致";break;case "4":idcard_number_type = "身份证证号和性别信息不一致";break;}}}catch (Exception e){ErrorMessage = e.Message;}}}// idcard

小结

采用哪种识别方式,要根据我们在实际的应用场景中进行选择,而且也需要考虑调用的成本(本文涉及的调用成本仅供参考)。这里讲述的几种方案是我们自研产品中所采用的方式,腾讯云的人脸核身产品分支很多,大家可以根据具体需求进行选择、扩充自己的产品功能。

再次感谢您的阅读,欢迎大家讨论指正。

相关文章:

C# 基于腾讯云人脸核身和百度云证件识别技术相结合的 API 实现

目录 腾讯云人脸核身技术 Craneoffice.net 采用的识别方式 1、活体人脸核身(权威库)&#xff1a; 2、活体人脸比对&#xff1a; 3、照片人脸核身(权威库)&#xff1a; 调用成本 百度云身份证识别 调用成本 相关结合点 核心代码 实现调用人脸核身API的示例 实现调用身…...

LeetCode每日一题——275. H-Index II

文章目录 一、题目二、题解 一、题目 Given an array of integers citations where citations[i] is the number of citations a researcher received for their ith paper and citations is sorted in ascending order, return the researcher’s h-index. According to the…...

项目添加EZOpenSDK之后就开始报错:could not build module foundation等

最近修改一个老项目&#xff0c;出现了一个报错问题。困扰了很久。现在终于找到解决方法了。分享一下。 正常的项目&#xff0c;使用pod引入EZOpenSDK之后就开始报错了&#xff0c;下面就是错误信息&#xff1a; could not build module foundation错误 could not build modul…...

“智能科技·链接未来”2024中国国际人工智能产品展览会·智博会

2024年中国国际人工智能产品展览会&#xff08;简称世亚智博会&#xff09;将于3月份在上海举办&#xff0c;6月份在北京举办。本届展会以“智能科技链接未来”为主题&#xff0c;将集中展示全球前沿的人工智能技术和应用&#xff0c;以及人工智能在各个领域的新成果。 本届展会…...

华为NAT配置实例(含dhcp、ospf配置)

一、网络拓朴如下&#xff1a; 二、要求&#xff1a;PC1 能访问到Server1 三、思路&#xff1a; R2配置DHCP&#xff0c;R2和R1配OSPF&#xff0c;R1出NAT 四、主要配置&#xff1a; R2的DHCP和OSPF&#xff1a; ip pool 1gateway-list 10.1.1.1 network 10.1.1.0 mask 25…...

怎样才能把视频号的视频保存到相册,怎么下载视频号视频两个方法轻松解决

在微信客户端想要下载视频号视频却不知道怎么保存到本地相册&#xff1f;让不少网友犯了难&#xff0c;不用在纠结怎么样才可以将视频号视频下载下来&#xff0c;今天就分享两个小程序将视频号视频提取出来&#xff0c;另外在告诉大家一个下载技巧&#xff0c;一定要看到到结尾…...

软考系统架构师知识点集锦七:计算机系统基础知识

一、考情分析 二、考点精讲 2.1计算机系统概述 2.1.1计算机系统组成 2.1.2 存储系统 时间局部性:指程序中的某条指令一旦执行&#xff0c;不久以后该指令可能再次执行,典型原因是由于程序中存在着大量的循环操作。 空间局部性:指一旦程序访问了某个存储单元&#xff0c;不久…...

k8s节点已有镜像,但Pod一直在拉取镜像时卡着

Pod状态为ContainerCreating&#xff0c;查看日志提示pull镜像&#xff0c;但该镜像在Node节点已经存在&#xff0c;且拉取策略为IfNotPresent 解决&#xff1a;重启kubelet...

用图说话——流程图进阶

目录 一、基本流程图 二、时序流程图 一、基本流程图 经常阅读歪果仁绘制的流程图&#xff0c;感觉比较规范&#xff0c;自己在工作中也尝试用他们思维来绘图&#xff0c;这是一个小栗子&#xff1a; 二、时序流程图 在进行Detail设计过程中&#xff0c;一般的绘图软件显得…...

深入了解 Elasticsearch 8.1 中的 Script 使用

一、什么是 Elasticsearch Script&#xff1f; Elasticsearch 中的 Script 是一种灵活的方式&#xff0c;允许用户在查询、聚合和更新文档时执行自定义的脚本。这些脚本可以用来动态计算字段值、修改查询行为、执行复杂的条件逻辑等等。 二、支持的脚本语言有哪些 支持多种脚本…...

激光雷达点云基础-点云滤波算法与NDT匹配算法

激光雷达点云处理在五年前就做了较多的工作&#xff0c;最近有一些新的接触发现激光雷达代码原理五年前未见重大更新&#xff0c;或许C与激光雷达结合本身就是比较高的技术门槛。深度学习调包侠在硬核激光雷达技术面前可以说是完全的自愧不如啊。 1、点云滤波 在获取点云数据…...

回收废品抢派单小程序开源版开发

回收废品派单抢派单小程序开源版开发 在这个废品回收抢单派单小程序开源版开发中&#xff0c;我们将构建一个专业且富有趣味性的平台&#xff0c;以深度的模式来重塑废品回收体验。 我们将提供一个会员注册功能&#xff0c;用户可以通过小程序授权注册和手机号注册两种方式快…...

粤嵌实训医疗项目--day04(Vue + SpringBoot)

往期回顾 粤嵌实训医疗项目--day03&#xff08;Vue SpringBoot&#xff09;-CSDN博客粤嵌实训医疗项目day02&#xff08;Vue SpringBoot&#xff09;-CSDN博客粤嵌实训医疗项目--day01&#xff08;VueSpringBoot&#xff09;-CSDN博客 目录 一、用户详细信息查询 (查询信息与…...

redis加入window服务及删除

1、命令redis-server.exe --service-install redis.windows.conf&#xff0c;在服务中可配置自动启动 删除redis服务&#xff0c;先停止redis服务运行&#xff0c;管理员cmd模式&#xff0c;sc delete "redis" ,...

leetcode-哈希表

1. 理论 从哈希表的概念、哈希碰撞、哈希表的三种实现方式进行学习 哈希表&#xff1a;用来快速判断一个元素是否出现集合里。也就是查值就能快速判断&#xff0c;O&#xff08;1&#xff09;复杂度&#xff1b; 哈希碰撞&#xff1a;拉链法&#xff0c;线性探测法等。只是一种…...

NOIP2023模拟6联测27 旅行

题目大意 有一个有 n n n个点 n n n条边的无向连通图&#xff0c;一开始每条边都有一个颜色 c c c。 有 m m m次操作&#xff0c;每次操作将一条两个端点为 x , y x,y x,y的边的颜色修改为 c c c。求每次修改之后&#xff0c;图中有多少个颜色相同的连通块。 一个颜色相同的…...

【表面缺陷检测】钢轨表面缺陷检测数据集介绍(2类,含xml标签文件)

一、介绍 钢轨表面缺陷检测是指通过使用各种技术手段和设备&#xff0c;对钢轨表面进行检查和测量&#xff0c;以确定是否存在裂纹、掉块、剥离、锈蚀等缺陷的过程。这些缺陷可能会对铁路运输的安全和稳定性产生影响&#xff0c;因此及时进行检测和修复非常重要。钢轨表面缺陷…...

SHCTF 2023 新生赛 Web 题解

Web [WEEK1]babyRCE 源码过滤了cat 空格 我们使用${IFS}替换空格 和转义获得flag [WEEK1]飞机大战 源码js发现unicode编码 \u005a\u006d\u0078\u0068\u005a\u0033\u0074\u006a\u0059\u006a\u0045\u007a\u004d\u007a\u0067\u0030\u005a\u0069\u0030\u0031\u0059\u006d\u0045…...

二叉树题目合集(C++)

二叉树题目合集 1.二叉树创建字符串&#xff08;简单&#xff09;2.二叉树的分层遍历&#xff08;中等&#xff09;3.二叉树的最近公共祖先&#xff08;中等&#xff09;4.二叉树搜索树转换成排序双向链表&#xff08;中等&#xff09;5.根据树的前序遍历与中序遍历构造二叉树&…...

dbeaver配置es连接org.elasticsearch.xpack.sql.jdbc.EsDriver

查看目标es服务版本&#xff0c;下载对应驱动...

使用van-uploader 的UI组件,结合vue2如何实现图片上传组件的封装

以下是基于 vant-ui&#xff08;适配 Vue2 版本 &#xff09;实现截图中照片上传预览、删除功能&#xff0c;并封装成可复用组件的完整代码&#xff0c;包含样式和逻辑实现&#xff0c;可直接在 Vue2 项目中使用&#xff1a; 1. 封装的图片上传组件 ImageUploader.vue <te…...

AI,如何重构理解、匹配与决策?

AI 时代&#xff0c;我们如何理解消费&#xff1f; 作者&#xff5c;王彬 封面&#xff5c;Unplash 人们通过信息理解世界。 曾几何时&#xff0c;PC 与移动互联网重塑了人们的购物路径&#xff1a;信息变得唾手可得&#xff0c;商品决策变得高度依赖内容。 但 AI 时代的来…...

逻辑回归暴力训练预测金融欺诈

简述 「使用逻辑回归暴力预测金融欺诈&#xff0c;并不断增加特征维度持续测试」的做法&#xff0c;体现了一种逐步建模与迭代验证的实验思路&#xff0c;在金融欺诈检测中非常有价值&#xff0c;本文作为一篇回顾性记录了早年间公司给某行做反欺诈预测用到的技术和思路。百度…...

【从零开始学习JVM | 第四篇】类加载器和双亲委派机制(高频面试题)

前言&#xff1a; 双亲委派机制对于面试这块来说非常重要&#xff0c;在实际开发中也是经常遇见需要打破双亲委派的需求&#xff0c;今天我们一起来探索一下什么是双亲委派机制&#xff0c;在此之前我们先介绍一下类的加载器。 目录 ​编辑 前言&#xff1a; 类加载器 1. …...

API网关Kong的鉴权与限流:高并发场景下的核心实践

&#x1f525;「炎码工坊」技术弹药已装填&#xff01; 点击关注 → 解锁工业级干货【工具实测|项目避坑|源码燃烧指南】 引言 在微服务架构中&#xff0c;API网关承担着流量调度、安全防护和协议转换的核心职责。作为云原生时代的代表性网关&#xff0c;Kong凭借其插件化架构…...

Unity VR/MR开发-VR开发与传统3D开发的差异

视频讲解链接&#xff1a;【XR马斯维】VR/MR开发与传统3D开发的差异【UnityVR/MR开发教程--入门】_哔哩哔哩_bilibili...

从零开始了解数据采集(二十八)——制造业数字孪生

近年来&#xff0c;我国的工业领域正经历一场前所未有的数字化变革&#xff0c;从“双碳目标”到工业互联网平台的推广&#xff0c;国家政策和市场需求共同推动了制造业的升级。在这场变革中&#xff0c;数字孪生技术成为备受关注的关键工具&#xff0c;它不仅让企业“看见”设…...

AWS vs 阿里云:功能、服务与性能对比指南

在云计算领域&#xff0c;Amazon Web Services (AWS) 和阿里云 (Alibaba Cloud) 是全球领先的提供商&#xff0c;各自在功能范围、服务生态系统、性能表现和适用场景上具有独特优势。基于提供的引用[1]-[5]&#xff0c;我将从功能、服务和性能三个方面进行结构化对比分析&#…...

【Pandas】pandas DataFrame dropna

Pandas2.2 DataFrame Missing data handling 方法描述DataFrame.fillna([value, method, axis, …])用于填充 DataFrame 中的缺失值&#xff08;NaN&#xff09;DataFrame.backfill(*[, axis, inplace, …])用于**使用后向填充&#xff08;即“下一个有效观测值”&#xff09…...

分布式计算框架学习笔记

一、&#x1f310; 为什么需要分布式计算框架&#xff1f; 资源受限&#xff1a;单台机器 CPU/GPU 内存有限。 任务复杂&#xff1a;模型训练、数据处理、仿真并发等任务耗时严重。 并行优化&#xff1a;通过任务拆分和并行执行提升效率。 可扩展部署&#xff1a;适配从本地…...