人脸识别业务(基于腾讯人脸识别接口)

news2024/10/6 10:29:49

使用腾讯云人脸识别接口,基于优图祖母模型。

一、准备工作

人脸识别账号

申请腾讯云服务器账号,生成自己的秘钥。记录秘钥和秘钥ID。

创建人员库

记下人员库id

在配置文件application.yml中添加配置。

plateocr:
  SecretId: 秘钥ID
  SecretKey: 秘钥
  serverIp: iai.tencentcloudapi.com
  area: ap-guangzhou #人脸识别服务器所在区域,官方推荐就近
  groupId: 1 #刚才创建的人脸库ID
  used: true  #表示人脸识别是否开启
  passPercent: 80 #通过率,相似率到达多少算通过
  nonceStr: 123456 #随机数

二、录入人脸的类

需要用到的类:

1.Base64Util :自己写的base64工具类,用于将base64解码写到本地磁盘。

package com.qcby.mycommunity_003.util;

import org.apache.commons.codec.binary.Base64;

import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;

public class Base64Util {
    /**
     * 将二进制数据编码为BASE64字符串
     *
     * @param binaryData
     * @return
     */
    public static String encode(byte[] binaryData) {
        try {
            return new String(Base64.encodeBase64(binaryData), "UTF-8");
        } catch (UnsupportedEncodingException e) {
            return null;
        }
    }

    /**
     * 将BASE64字符串恢复为二进制数据
     *
     * @param base64String
     * @return
     */
    public static byte[] decode(String base64String) {
        try {
            return Base64.decodeBase64(base64String.getBytes("UTF-8"));
        } catch (UnsupportedEncodingException e) {
            return null;
        }
    }

    /**
     * 将文件转成base64 字符串
     *
     *  path文件路径
     * @return *
     * @throws Exception
     */

    public static String encodeBase64File(String path) throws Exception {
        File file = new File(path);
        FileInputStream inputFile = new FileInputStream(file);
        byte[] buffer = new byte[(int) file.length()];
        inputFile.read(buffer);
        inputFile.close();
        return encode(buffer);
    }
    //读取网络图片
    public static String encodeBase64URLFile(String path) throws Exception {
        URL url = new URL(path);
        HttpURLConnection conn = (HttpURLConnection)url.openConnection();
        conn.setRequestMethod("GET");
        conn.setConnectTimeout(5*1000);
        InputStream is = conn.getInputStream();
        byte[] data = readInputStream(is);
        is.close();
        conn.disconnect();
        return encode(data);
    }
    public static byte[] readInputStream(InputStream inStream) throws Exception{
        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
        //创建一个Buffer字符串
        byte[] buffer = new byte[1024];
        //每次读取的字符串长度,如果为-1,代表全部读取完毕
        int len = 0;
        //使用一个输入流从buffer里把数据读取出来
        while( (len=inStream.read(buffer)) != -1 ){
            //用输出流往buffer里写入数据,中间参数代表从哪个位置开始读,len代表读取的长度
            outStream.write(buffer, 0, len);
        }
        //关闭输入流
        inStream.close();
        //把outStream里的数据写入内存
        return outStream.toByteArray();
    }
    /**
     * 将base64字符解码保存文件
     *
     * @param base64Code
     * @param targetPath
     * @throws Exception
     */

    public static void decoderBase64File(String base64Code, String targetPath) throws Exception {
        byte[] buffer = decode(base64Code);
        FileOutputStream out = new FileOutputStream(targetPath);
        out.write(buffer);
        out.close();
    }

    /**
     * 将base64字符保存文本文件
     *
     * @param base64Code
     * @param targetPath
     * @throws Exception
     */

    public static void toFile(String base64Code, String targetPath) throws Exception {

        byte[] buffer = base64Code.getBytes();
        FileOutputStream out = new FileOutputStream(targetPath);
        out.write(buffer);
        out.close();
    }
}

2.RootResp 类,封装腾讯人脸识别返回的信息。 


import com.alibaba.fastjson.JSON;

public class RootResp {
    //腾讯api返回的状态码,如果是0代表添加成功,否则会有异常码
    private int ret = 0;

    public int getRet() {
        return this.ret;
    }

    public void setRet(int ret) {
        this.ret = ret;
    }

    private String msg;

    public String getMsg() {
        return this.msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    private Object data;

    public Object getData() {
        return this.data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}

 3.FaceApi :调用api接口

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.qcby.mycommunity_003.configuration.ApiConfiguration;
import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import com.tencentcloudapi.common.profile.ClientProfile;
import com.tencentcloudapi.common.profile.HttpProfile;
import com.tencentcloudapi.iai.v20180301.IaiClient;
import com.tencentcloudapi.iai.v20180301.models.*;
import org.apache.log4j.Logger;

public class FaceApi {

    private Logger logger = Logger.getLogger(FaceApi.class);

    //人脸分析
    public RootResp detectFace(ApiConfiguration config, String url) {
        RootResp result = new RootResp();
        try{
            Credential cred = new Credential(config.getSecretId(), config.getSecretKey());
            HttpProfile httpProfile = new HttpProfile();
            httpProfile.setEndpoint(config.getServerIp());
            ClientProfile clientProfile = new ClientProfile();
            clientProfile.setHttpProfile(httpProfile);
            IaiClient client = new IaiClient(cred, config.getArea(), clientProfile);
            JSONObject paramObj = new JSONObject();
            paramObj.put("Url", url);
            paramObj.put("MaxFaceNum",1);
            paramObj.put("MinFaceSize",34);
            paramObj.put("NeedFaceAttributes",0);
            paramObj.put("NeedQualityDetection",1);
            DetectFaceRequest req = DetectFaceRequest.fromJsonString(paramObj.toJSONString(),DetectFaceRequest.class);
            DetectFaceResponse resp = client.DetectFace(req);
            result.setData(DetectFaceResponse.toJsonString(resp));
        } catch (TencentCloudSDKException e) {
            result.setRet(-1);
            result.setMsg(e.toString());
            logger.error(e.toString());
        }
        logger.info(result);
        return result;
    }

    //添加个体
    public RootResp newperson(ApiConfiguration config, String personId, String personName, String image) {
        RootResp result = new RootResp();
        try{
            //访问腾讯云服务所需要的秘钥信息,进行身份验证和授权凭证
            Credential cred = new Credential(config.getSecretId(), config.getSecretKey());
            //设置与腾讯云服务通信的http配置
            HttpProfile httpProfile = new HttpProfile();
            //配置接口请求域名
            httpProfile.setEndpoint(config.getServerIp());
            //配置客户端相关参数,包括http配置
            ClientProfile clientProfile = new ClientProfile();
            clientProfile.setHttpProfile(httpProfile);
            //和腾讯云人脸服务进行通信
            IaiClient client = new IaiClient(cred, config.getArea(), clientProfile);
            JSONObject paramObj = new JSONObject();
            paramObj.put("GroupId", config.getGroupId());
            paramObj.put("PersonId", config.getPersonIdPre() + personId);
            paramObj.put("PersonName", personName);
            paramObj.put("Image", image);
            //调取创建person的请求
            CreatePersonRequest req = CreatePersonRequest.fromJsonString(paramObj.toJSONString(), CreatePersonRequest.class);
            //响应回来的数据转成json
            CreatePersonResponse resp = client.CreatePerson(req);
            result.setData(CreatePersonResponse.toJsonString(resp));
        } catch (TencentCloudSDKException e) {
            result.setRet(-1);
            result.setMsg(e.toString());
            logger.error(e.toString());
        }
        logger.info(result);
        return result;
    }

    //删除个体
    public RootResp delperson(ApiConfiguration config, String personId) {
        RootResp result = new RootResp();
        try{
            Credential cred = new Credential(config.getSecretId(), config.getSecretKey());
            HttpProfile httpProfile = new HttpProfile();
            httpProfile.setEndpoint(config.getServerIp());
            ClientProfile clientProfile = new ClientProfile();
            clientProfile.setHttpProfile(httpProfile);
            IaiClient client = new IaiClient(cred, config.getArea(), clientProfile);
            JSONObject paramObj = new JSONObject();
            paramObj.put("PersonId", config.getPersonIdPre() + personId);
            DeletePersonRequest req = DeletePersonRequest.fromJsonString(paramObj.toJSONString(), DeletePersonRequest.class);
            DeletePersonResponse resp = client.DeletePerson(req);
            result.setData(DeletePersonResponse.toJsonString(resp));
        } catch (TencentCloudSDKException e) {
            result.setRet(-1);
            result.setMsg(e.toString());
            logger.error(e.toString());
        }
        logger.info(result);
        return result;
    }

    //增加人脸
    public RootResp addface(ApiConfiguration config, String personId, String image) {
        RootResp result = new RootResp();
        try{
            Credential cred = new Credential(config.getSecretId(), config.getSecretKey());
            HttpProfile httpProfile = new HttpProfile();
            httpProfile.setEndpoint(config.getServerIp());
            ClientProfile clientProfile = new ClientProfile();
            clientProfile.setHttpProfile(httpProfile);
            IaiClient client = new IaiClient(cred, config.getArea(), clientProfile);
            JSONObject paramObj = new JSONObject();
            JSONArray images = new JSONArray();
            images.add(image);
            paramObj.put("PersonId", config.getPersonIdPre() + personId);
            paramObj.put("Images", images);
            CreateFaceRequest req = CreateFaceRequest.fromJsonString(paramObj.toJSONString(), CreateFaceRequest.class);
            CreateFaceResponse resp = client.CreateFace(req);
            result.setData(CreateFaceResponse.toJsonString(resp));
        } catch (TencentCloudSDKException e) {
            result.setRet(-1);
            result.setMsg(e.toString());
            logger.error(e.toString());
        }
        logger.info(result);
        return result;
    }

    //删除人脸
    public RootResp delface(ApiConfiguration config, String personId, String faceId) {
        RootResp result = new RootResp();
        try{
            Credential cred = new Credential(config.getSecretId(), config.getSecretKey());
            HttpProfile httpProfile = new HttpProfile();
            httpProfile.setEndpoint(config.getServerIp());
            ClientProfile clientProfile = new ClientProfile();
            clientProfile.setHttpProfile(httpProfile);
            IaiClient client = new IaiClient(cred, config.getArea(), clientProfile);
            JSONObject paramObj = new JSONObject();
            JSONArray faces = new JSONArray();
            faces.add(faceId);
            paramObj.put("PersonId", config.getPersonIdPre() + personId);
            paramObj.put("FaceIds", faces);
            DeleteFaceRequest req = DeleteFaceRequest.fromJsonString(paramObj.toJSONString(), DeleteFaceRequest.class);
            DeleteFaceResponse resp = client.DeleteFace(req);
            result.setData(DeleteFaceResponse.toJsonString(resp));
        } catch (TencentCloudSDKException e) {
            result.setRet(-1);
            result.setMsg(e.toString());
            logger.error(e.toString());
        }
        logger.info(result);
        return result;
    }

    //人脸验证
    public RootResp faceVerify(ApiConfiguration config, String personId, String image) {
        RootResp result = new RootResp();
        try{
            Credential cred = new Credential(config.getSecretId(), config.getSecretKey());
            HttpProfile httpProfile = new HttpProfile();
            httpProfile.setEndpoint(config.getServerIp());
            ClientProfile clientProfile = new ClientProfile();
            clientProfile.setHttpProfile(httpProfile);
            IaiClient client = new IaiClient(cred, config.getArea(), clientProfile);
            JSONObject paramObj = new JSONObject();
            paramObj.put("PersonId", config.getPersonIdPre() + personId);
            paramObj.put("Image", image);
            VerifyFaceRequest req = VerifyFaceRequest.fromJsonString(paramObj.toJSONString(), VerifyFaceRequest.class);
            VerifyFaceResponse resp = client.VerifyFace(req);
            result.setData(VerifyFaceResponse.toJsonString(resp));
        } catch (TencentCloudSDKException e) {
            result.setRet(-1);
            result.setMsg(e.toString());
            logger.error(e.toString());
        }
        logger.info(result);
        return result;
    }

    //人员搜索按库返回
    public RootResp searchPersonsReturnsByGroup(ApiConfiguration config, String image) {
        RootResp result = new RootResp();
        try{
            Credential cred = new Credential(config.getSecretId(), config.getSecretKey());
            HttpProfile httpProfile = new HttpProfile();
            httpProfile.setEndpoint(config.getServerIp());
            ClientProfile clientProfile = new ClientProfile();
            clientProfile.setHttpProfile(httpProfile);
            IaiClient client = new IaiClient(cred, config.getArea(), clientProfile);
            JSONObject paramObj = new JSONObject();
            paramObj.put("GroupIds", new String[] {config.getGroupId()});
            paramObj.put("Image", image);
            //最多返回的最相似人员数目
            paramObj.put("MaxPersonNumPerGroup", 5);
            //返回人员具体信息
            paramObj.put("NeedPersonInfo", 1);
            //最多识别的人脸数目
            paramObj.put("MaxFaceNum", 1);
            SearchFacesReturnsByGroupRequest req = SearchFacesReturnsByGroupRequest.fromJsonString(paramObj.toJSONString(), SearchFacesReturnsByGroupRequest.class);
            SearchFacesReturnsByGroupResponse resp = client.SearchFacesReturnsByGroup(req);
            result.setData(VerifyFaceResponse.toJsonString(resp));
        } catch (TencentCloudSDKException e) {
            result.setRet(-1);
            result.setMsg(e.toString());
            logger.error(e.toString());
        }
        logger.info(result);
        return result;
    }
}

4.ApiConfiguration :封装配置信息(调用腾讯接口需要的部分参数) 

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@ConfigurationProperties(value="plateocr")
@Component
@Data
@ApiModel(value = "ApiConfiguration",description = "人脸识别参数描述")
public class ApiConfiguration {

    @ApiModelProperty("人脸识别secretId")
    private String secretId;
    @ApiModelProperty("人脸识别secretKey")
    private String secretKey;
    //	服务器ip
    @ApiModelProperty("人脸识别服务器ip")
    private String serverIp;
    //	服务器区域
    @ApiModelProperty("人脸识别服务器区域")
    private String area;
    //	默认分组
    @ApiModelProperty("人脸识别默认分组")
    private String groupId;
    //	用户id前缀,这个属性在配置文件里面没有
    @ApiModelProperty("人脸识别用户id前缀")
    private String personIdPre;
    //	随机数
    @ApiModelProperty("人脸识别随机数")
    private String nonceStr;
    //	是否使用
    @ApiModelProperty("人脸识别,是否启用人脸识别功能")
    private boolean used = false;
    //	识别准确率
    @ApiModelProperty("人脸识别比对准确度,如符合80%就识别通过")
    private float passPercent;

}

 5.表现层代码

@PostMapping("/addPerson")
    public Result addFace(@RequestBody AddFaceVo personFaceForm){
        //1============严谨性判断
        Person person = personService.getById(personFaceForm.getPersonId());
        if(person==null){
            return Result.error("居民不存在");
        }
        if(personFaceForm.getFileBase64()==null||personFaceForm.getFileBase64().equals("")){
          return Result.error("请上传base64编码的文件");
        }
        //1.腾讯接口使用的是腾讯优图祖母模型,
        if(apiConfiguration.isUsed()){
            //**************方法一:调用腾讯api识别。
            String faceId = newPerson(personFaceForm, person.getUserName());
            String faceBase = personFaceForm.getFileBase64().substring(0, 60);
//            ************方法二:自己模拟判断是不是人脸图片************:
//            String faceId = RandomUtil.getBitRandom();
            //如果不是头像(这一行如果不注释就报错)
//            if(faceBase.equals("iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0IArs4c")) {
//                return Result.error("人脸识别失败");
//            }
            //2.存到本地的文件夹内
//            //存储头像
            String filename = faceId + "." + personFaceForm.getExtName();
//            String savePath = face + filename;
//            try {
//                Base64Util.decoderBase64File(personFaceForm.getFileBase64(), savePath);
//            } catch (Exception e) {
//                e.printStackTrace();
//            }
            //**********************这是方法一结束*****************:
            //生成头像访问路径
            String faceUrl = urlPrefix + "community/upload/face/" + filename;
            person.setFaceUrl(faceUrl);
            person.setState(2);
            person.setFaceBase(faceBase);
            //3.存到数据库中(包括base64编码存储)
            //更新人脸识别状态及图片地址
            this.personService.updateById(person);
            return Result.ok();
        }
        return Result.error("未开启人脸识别");
    }

    /**
     * 腾讯api接口相关
     * @param vo
     * @param personName
     * @return
     */
    private String newPerson(AddFaceVo vo,String personName) {
        String faceId = null;
        String faceBase64 = vo.getFileBase64();
        String extname = vo.getExtName();
        String personId = vo.getPersonId()+"";
        String savePath = face;
        if (faceBase64!=null && !faceBase64.equals("")) {
            FaceApi faceApi = new FaceApi();
            RootResp resp = faceApi.newperson(apiConfiguration, personId, personName, faceBase64);
            if(resp.getRet()==0) {
                JSONObject data = JSON.parseObject(resp.getData().toString());
                faceId = data.getString("FaceId");
                if(faceId!=null) {
                    String filename = faceId + "." + extname;
                    savePath += filename;
                    try {
                        //调用自定义工具类,将base64编码文件解码,并报存在指定路径
                        Base64Util.decoderBase64File(faceBase64, savePath);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            }
            else {
                return faceId;
            }
        }
        return faceId;
    }

6.接收前端传递参数的类

import lombok.Data;

@Data
public class AddFaceVo {
    private Integer personId;
    private String extName;
    private String fileBase64;
}

三、录入人脸的流程 

1.调用腾讯api

调用api需要的参数有: 

配置文件中配置的秘钥、秘钥id、服务器ip、区域、人脸库id、是否开启、精确度、随机数

人员id、人员姓名、图片的base64码

 

2.如果腾讯接口返回的状态码是0,就说明保存成功,将图片存到本地。

3.更新数据库,存base64编码。

四、人脸识别 

1.表现层代码

  //1判断是不是在人员库存在)
//        (1)调用腾讯AI接口(
        FaceApi faceApi = new FaceApi();
        RootResp resp = faceApi.searchPersonsReturnsByGroup(apiConfiguration, inOutFaceForm.getFileBase64());
        String msg = "";
//        封装人员信息的json对象
        JSONObject personInfo = null;
//        (2)根据状态码,如果是0就是在人员库
        if(resp.getRet() == 0) {
            JSONObject object = JSONObject.parseObject(resp.getData().toString());
            JSONArray resultsReturnsByGroup = object.getJSONArray("ResultsReturnsByGroup");
            JSONObject returnsByGroupJSONObject = resultsReturnsByGroup.getJSONObject(0);
            JSONArray groupCandidates = returnsByGroupJSONObject.getJSONArray("GroupCandidates");
            JSONObject groupCandidatesJSONObject = groupCandidates.getJSONObject(0);
            JSONArray candidates = groupCandidatesJSONObject.getJSONArray("Candidates");
//            (3)拿到全部人员库对象,匹配数据库人员信息
            String personId ="";
            String faceId = "";
            String personName = "";
            String faceUrl = "";
            long pid = 0;
            Person p = null, p1 = null;
            for(int i = 0;i < candidates.size();i++) {
               personInfo= candidates.getJSONObject(i);
                personId = personInfo.getString("PersonId");
                faceId = personInfo.getString("FaceId");
                personName = personInfo.getString("PersonName");
                personId = personId.substring(4);
                pid = Integer.parseInt(personId);
                p = personService.getById(pid);
                if(p == null)
                    continue;
                else
                    p1 = p;
                faceUrl = p.getFaceUrl();
                if(faceUrl == null || faceUrl.equals("")){
                    continue;
                }
                faceUrl = faceUrl.substring(faceUrl.lastIndexOf("/")+1,faceUrl.lastIndexOf("."));
                if(faceId.equals(faceUrl)) {
                    break;
                }
            }
//          (4)
            if(p==null) {
                return Result.ok().put("data","人员信息不存在");
            }
            if(inOutFaceForm.getCommunityId() != p.getCommunityId()) {
                return Result.ok().put("data","对不起,你不是本小区居民,请与系统管理员联系。");
            }
//        (5)创建出入记录对象,封装
            InOutRecord inoutrecord = new InOutRecord();
            inoutrecord.setCommunityId(p.getCommunityId());
            inoutrecord.setPersonId(p.getPersonId());
            try {
                //保存图片
                String newFileName = UUID.randomUUID()+"." + inOutFaceForm.getExtName();
                String fileName = face + newFileName;
                Base64Util.decoderBase64File(inOutFaceForm.getFileBase64(),fileName);
                String basePath = urlPrefix + "community/upload/face/" + newFileName;
                //查找系统中是否有该人员的出入场信息
                InOutRecord inoutrecord1 = this.inOutRecordMapper.getInOutRecord(inoutrecord);
//        (6)根据出去等于null来查,如果查不到就新建一个对象,查到了就是出去小区
                //进入小区
                if(inoutrecord1 == null) {
                    inoutrecord.setInPic(basePath);
                    this.inOutRecordMapper.insert(inoutrecord);
                    return Result.ok().put("status", "success").put("data", "【"+p.getUserName() + "】进入小区");
                    //离开小区
                } else {
                    inoutrecord1.setOutPic(basePath);
                    inoutrecord1.setOutTime(new Date());
                    this.inOutRecordMapper.updateById(inoutrecord1);
                    return Result.ok().put("status", "success").put("data", "【"+p.getUserName() + "】离开小区");
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }else{
            msg = "人脸识别失败,错误码=" + resp.getRet() + "," + resp.getMsg();
        }
        return Result.ok().put("data",msg);

五、人脸识别流程

1.调用腾讯接口进行比对

2.根据状态码,判断是不是存在相似度通过的人脸。如果存在就和根据查找到的人员id来查找数据库中对应的id的人员的姓名。如果姓名也和人员库返回的一致就通过。

3.如需做进出登记,就在进出登记数据表中存入信息。

如果本id下是有“出”是null的就表示改人员是出小区,否则就新建一条记录,表示进小区。

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

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

相关文章

全国水科技大会 免费征集《水环境治理减污降碳协同增效示范案例》

申报时间截止到2024年4月15日&#xff0c;请各单位抓紧申报&#xff0c;申报条件及申报表请联系&#xff1a;13718793867 围绕水环境治理减污降碳协同增效领域&#xff0c;以资源化、生态化和可持续化为导向&#xff0c;面向生态、流城、城市、农村、工业园区、电力、石化、钢…

高效实现红黑树范围查询:RB-ENUMERATE操作的设计与分析

高效实现红黑树范围查询&#xff1a;RB-ENUMERATE操作的设计与分析 一、RB-ENUMERATE操作的需求分析二、RB-ENUMERATE操作的设计思路三、RB-ENUMERATE操作的具体实现四、性能分析五、结论 在红黑树的广泛应用中&#xff0c;我们经常需要对树中的元素进行查询和操作。除了基本的…

堆放砖块-第12届蓝桥杯选拔赛Python真题精选

[导读]&#xff1a;超平老师的Scratch蓝桥杯真题解读系列在推出之后&#xff0c;受到了广大老师和家长的好评&#xff0c;非常感谢各位的认可和厚爱。作为回馈&#xff0c;超平老师计划推出《Python蓝桥杯真题解析100讲》&#xff0c;这是解读系列的第47讲。 堆放砖块&#xf…

SuperMap GIS基础产品FAQ集锦(202403)

一、SuperMap GIS基础产品桌面GIS-FAQ集锦 问题1&#xff1a;【iDesktop】安装了idesktop 11i&#xff0c;现想进行插件开发&#xff0c;根据安装指南安装SuperMap.Tools.RegisterTemplate.exe&#xff0c;运行多次均失败 【问题原因】该脚本是之前老版本针对VS2010写的&…

亚信安慧AntDB:点亮数据灯塔

亚信安慧AntDB 是国产的分布式数据库&#xff0c;它具备快速发展的潜力。随着互联网技术的迅猛发展&#xff0c;大数据时代的到来&#xff0c;数据库的需求不断增长。在这样的背景下&#xff0c;国产分布式数据库正逐渐崭露头角&#xff0c;AntDB作为其中的重要代表&#xff0c…

MySQL学习笔记(数据类型, DDL, DML, DQL, DCL)

Learning note 1、前言2、数据类型2.1、数值类型2.2、字符串类型2.3、日期类型 3、DDL总览数据库/表切换数据库查看表内容创建数据库/表删除数据库/表添加字段删除字段表的重命名修改字段名&#xff08;以及对应的数据类型&#xff09; 4、DML往字段里写入具体内容修改字段内容…

Android输入框架

输入是一个操作系统的重要组成部分&#xff0c;没有输入&#xff0c;用户就无法向系统发送指令&#xff0c;也就没法完成人机交互。在Android系统中&#xff0c;输入系统是不可缺少的&#xff0c;下面简单介绍输入系统的整体框架&#xff0c;以下内容参考清华出版社出版的《And…

[react] useRef场景

1.记忆功能 -- 清定时器 先看和useState的差别 代码如下 不断地开启定时器 加上缓存就行,这样每次都是它 2.获取dom节点 当然!你可以直接在模板上面写函数! 函数变种也是可以的 你想获取整个组件也是没问题的 import React, { useRef, forwardRef } from "react";…

uniapp 2.0可视化开发工具高级事件使用技巧探索

摘要 随着移动应用市场的不断扩大和前端技术的飞速发展&#xff0c;开发者们对于快速、高效构建跨平台应用的需求日益增强。uniapp作为一款优秀的跨平台应用开发框架&#xff0c;凭借其强大的功能和易用的特性&#xff0c;赢得了广大开发者的青睐。在uniapp 2.0版本中&#xf…

ht1622不显示无反应问题解决

如果你正在写ht1622 驱动时&#xff0c;怎么看程序都没问题&#xff0c;抓取波形&#xff0c;示波器分析波形&#xff0c;如果都没有问题&#xff0c;那么很大可能是硬件问题&#xff0c;检测看看 ht1622 RD是不是接地了。 RD 低会进入读取模式&#xff0c;所以不用RD 请将RD悬…

基于Java+SpringBoot+Vue养老院管理系统(源码+文档+部署+讲解)

一.系统概述 随着信息时代的来临&#xff0c;过去的传统管理方式缺点逐渐暴露&#xff0c;对过去的传统管理方式的缺点进行分析&#xff0c;采取计算机方式构建养老院管理系统。本文通过课题背景、课题目的及意义相关技术&#xff0c;提出了一种社区活动、活动记录、床位信息、…

C++类与对象上(个人笔记)

类与对象 1.面向过程和面向对象初步认识2.类的定义3.类的访问限定符及封装3.1 访问限定符 4.封装5.类的实例化6.类对象6.1类对象的内存计算6.2内存对齐规则&#xff08;回顾&#xff09; 7.this指针7.1 this指针的特性 1.面向过程和面向对象初步认识 C语言是面向过程的&#x…

RabbitMQ安装延时插件

下载延迟插件 在 RabbitMQ 的 3.5.7 版本之后&#xff0c;提供了一个插件&#xff08;rabbitmq-delayed-message-exchange&#xff09;来实现延迟队列 &#xff0c;同时需保证 Erlang/OPT 版本为 18.0 之后。 我这里 MQ 的版本是 3.10.0 现在去 GitHub 上根据版本号下载插件 链…

Go第三方框架--ants协程池框架

1. 背景介绍 1.1 goroutine ants是站在巨人的肩膀上开发出来的&#xff0c;这个巨人是goroutine&#xff0c;这是连小学生都知道的事儿&#xff0c;那么为什么不继续使用goroutine(以下简称go协程)呢。这是个思考题&#xff0c;希望讲完本文大家可以有个答案。 go协程只涉及用…

Echarts柱状图多样式实现

样式一 样式二 在这里插入代码片

MATLAB 点云体素滤波 (58)

MATLAB 体素滤波 (58) 一、基本原理二、算法实现1.代码数据的海量性始终是点云处理时需要面临的一个大问题,严重的时间消耗和内存占用影响了点云处理的发展,当然了,点云数量主要应该看项目的实际需求,若是对细节要求较高,那么点云数量不可过少,但是要求过低时,我们就可…

蓝桥杯——16

学习视频&#xff1a;17-深搜的剪枝策略视频讲解_哔哩哔哩_bilibili #include<iostream> #include<cstring> using namespace std; int n, m; string maze[110]; bool vis[110][110]; int dir[4][2] { {0,1},{0,-1},{1,0},{-1,0} }; int ans 100000; bool in(in…

CesiumJS内置三维数字地球,你都不知道效果有多炫酷。

CesiumJS是一个开源的JavaScript库&#xff0c;用于在Web浏览器中创建高性能的3D地球和地理空间应用程序。它提供了强大的工具和API&#xff0c;使开发者能够构建具有交互性、可视化和地理空间分析功能的应用。 以下是CesiumJS的一些主要特点和功能&#xff1a; 3D地球可视化&…

win11 连接海康摄像头 ONVif协议

目录 Win 11 通过脚本打开自带的IE浏览器访问海康摄像头 海康摄像头设置支持onvif协议 安装onvif协议 onvif协议示例代码 Win 11 通过脚本打开自带的IE浏览器访问海康摄像头 第一步、桌面右键新建一个 txt 的文档 第二步、打开文档并且复制粘贴下面代码 CreateObject(&…

reids-AOF(Append Only File)持久化使用方法

一&#xff0c;什么是AOF&#xff08;Append Only File&#xff09; 将我们所有的命令都记录下来&#xff0c;history&#xff0c;恢复的时候就把这个文件全部再执行一遍 以日志的形式来记录每个写的操作&#xff0c;将Redis执行过的所有指令记录下来&#xff08;读操作不记录&…