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

基于JPBC的无证书聚合签名方案实现

基于JPBC的无证书聚合签名方案实现

摘要

一开始签名方案是基于PKI的,无证书签名起源于 基于身份密码体制, 2009 年第一篇无证书签名方案1被提出,随后出现了一些列方案2,3;包括无配对的无证书聚合签名方案4,更多内容参考文献5.

暂时没有看见无证书聚合签名方案实现相关的代码,本文基于JPBC库实现,使用方法可以参考B站视频。也可以使用C++和PBC库实现。

方案概述

本文方案是基于论文3描述的。

Setup
给定安全参数 κ ∈ Z \kappa \in Z κZ,KGC选择两个循环群 G 1 G_1 G1 G 2 G_2 G2,其阶均为素数 q q q G 1 G_1 G1 的生成元 P P P,计算可接受的配对 e : G 1 × G 1 → G 2 e:G_1×G_1→G_2 e:G1×G1G2 。 KGC 随机选择主密钥 s ∈ Z q ∗ s\in Z_q^\ast sZq ,设置 P p u b = s P P_{pub}=sP Ppub=sP ,选择加密哈希函数 H 1 : { 0 , 1 } ∗ → G 1 H_1:\{0,1\}^\ast→G_1 H1:{0,1}G1 , H 2 : { 0 , 1 } ∗ → G 1 H_2:\{0,1\}^\ast→G_1 H2:{0,1}G1, H 3 : { 0 , 1 } ∗ → Z q ∗ H_3:\{0,1\}^\ast→Z_q^\ast H3:{0,1}Zq. 系统参数为 { q , G 1 , G 2 , e , P , P p u b , H 1 , H 2 , H 3 } \{q,G_1,G_2,e,P,P_{pub},H_1,H_2,H_3 \} {q,G1,G2,e,P,Ppub,H1,H2,H3}, 主密钥是s。

PartialKeyGen:
给定用户身份 I D i ∈ { 0 , 1 } ∗ ID_i\in \{0,1\}^\ast IDi{0,1},KGC首先计算 Q I D i = H 1 ( I D i ) Q_{ID_i }=H_1 (ID_i) QIDi=H1(IDi)。 然后,它设置该用户的部分密钥 p s k I D i = s Q ( I D i ) psk_{ID_i }=sQ_(ID_i ) pskIDi=sQ(IDi)并将其通过安全通道传输给对应用户。 用户可以通过检查是否正确来检查其正确性 e ( p s k I D i , P ) = e ( Q I D i , P p u b ) e(psk_{ID_i },P)=e(Q_{ID_i },P_{pub}) e(pskIDi,P)=e(QIDi,Ppub)

UserKeyGen:
用户 I D i ID_i IDi随机选择值 x I D i ∈ Z q ∗ x_{ID_i }\in Z_q^\ast xIDiZq作为他的用户私钥 u s k I D i usk_{ID_i } uskIDi,并且计算用户公钥 u p k I D i = x I D i P upk_{ID_i}=x_{ID_i } P upkIDi=xIDiP

Sign:
对于消息 m i ∈ 0 , 1 ∗ m_i∈{0,1}^\ast mi0,1,选择状态信息 ∆ ∆ (选择公开参数作为状态信息),具有 I D i ID_i IDi身份的签名者执行以下步骤:

  1. 选择随机数 r i ∈ Z q ∗ r_i∈Z_q^\ast riZq并且计算 U i = r i P ∈ G 1 U_i=r_i P∈G_1 Ui=riPG1.
  2. 计算 Q = H 2 ( ∆ ) , h i = H 3 ( m i , I D i , u p k I D i , U i ) Q=H_2(∆),h_i=H_3(m_i,ID_i,upk_{ID_i},U_i) Q=H2(),hi=H3(mi,IDi,upkIDi,Ui)
  3. 计算 V i = p s k I D i + r i ⋅ Q + h i ⋅ x i ⋅ P p u b V_i=psk_{ID_i }+r_i⋅Q+h_i⋅x_i⋅P_{pub} Vi=pskIDi+riQ+hixiPpub.

输出 ( U i , V i ) (U_i,V_i ) (Ui,Vi)作为 m i m_i mi的签名。

Verify
给定一个消息 m i m_i mi签名 ( U i , V i ) (U_i,V_i ) (Ui,Vi),其对应的身份为 I D i ID_i IDi和公钥 u p k I D i upk_{ID_i} upkIDi,计算 Q ( I D i ) = H 1 ( I D i ) , Q = H 2 ( ∆ ) Q_(ID_i )=H_1 (ID_i ),Q=H_2 (∆) Q(IDi)=H1(IDi),Q=H2() ,
h i = H 3 ( m i , I D i , u p k I D i , U i ) h_i=H_3 (m_i,ID_i,upk_{ID_i },U_i ) hi=H3(mi,IDi,upkIDi,Ui)
如果等式 e ( V i , P ) = e ( h i ⋅ u p k I D i + Q I D i , P p u b ) e ( U i , Q ) e(V_i,P)=e(h_i⋅upk_{ID_i }+Q_{ID_i },P_{pub} )e(U_i,Q) e(Vi,P)=e(hiupkIDi+QIDi,Ppub)e(Ui,Q) 成立,接收签名;否则拒绝。

Aggregate
任何人都可以充当聚合签名生成器, 对于n个用户的聚合集 { U 1 , … , U n } \{U_1,…,U_n\} {U1,,Un}其对应身份为 { I D 1 , … , I D n } \{ID_1,…,ID_n \} {ID1,,IDn}以及对应公钥 { u p k 1 , … , u p k n } \{upk_1,…,upk_n\} {upk1,,upkn},对应消息签名对为 { ( m 1 , σ 1 = ( U 1 , V 1 ) ) , … , ( m n , σ n = ( U n , V n ) ) } \{(m_1,σ_1=(U_1,V_1 )),…,(m_n,σ_n=(U_n,V_n))\} {(m1,σ1=(U1,V1)),,(mn,σn=(Un,Vn))},
聚合签名计算: V = ∑ i = 1 n V i V=∑_{i=1}^n V_i V=i=1nVi, 将 σ = ( U 1 , … , U n , V ) σ=(U_1,…,U_n,V) σ=(U1,,Un,V)作为聚合签名。

Aggregate-Verify
验证聚合签名 σ = ( U 1 , … , U n , V ) σ=(U_1,…,U_n,V) σ=(U1,,Un,V)由n个用户 { U 1 , … , U n } \{U_1,…,U_n\} {U1,,Un}身份为 { I D 1 , … , I D n } \{ID_1,…,ID_n\} {ID1,,IDn}和对应的公钥 { u p k 1 , … , u p k n } \{upk_1,…,upk_n\} {upk1,,upkn};关于消息 { m 1 , … , m n } \{m_1,…,m_n \} {m1,,mn} 验证者执行以下操作:
计算 Q I D i = H 1 ( I D i ) , Q = H 2 ( ∆ ) , h i = H 3 ( m i , I D i , u p k I D i , U i ) , i = 1 , … , n Q_{ID_i }=H_1 (ID_i ),Q=H_2 (∆),h_i=H_3 (m_i,ID_i,upk_{ID_i },U_i ),i=1,…,n QIDi=H1(IDi),Q=H2(),hi=H3(mi,IDi,upkIDi,Ui),i=1,,n.
验证: e ( V , P ) = e ( ∑ i = 1 n [ h i ⋅ u p k I D i + Q I D i ] , P p u b ) e ( ∑ i = 1 n U i , Q ) e(V,P)=e(∑_{i=1}^n [h_i⋅upk_{ID_i}+Q_{ID_i} ] ,P_{pub} )e(∑_{i=1}^n U_i ,Q) e(V,P)=e(i=1n[hiupkIDi+QIDi],Ppub)e(i=1nUi,Q).如果满足则通过;否则验证失败。

代码实现

整体思路, 将相关密钥信息作为文件保存(序列化后可以通过网络传输),根据方案不同的功能设计不同的函数。

关于文件a_181_603.properties的内容

type=a
q=98826429041171753291515535532523512299028170537954154869719707264887274916552228805607584116490046284509883309001532457986879277885241872021906840932513241346999389365188296460009947
h=32243626948934860887488490158437299489453513352745889246437755713701521031193083418924110592954582395114812811896992400310730276
r=3064991081731777546575510593831386635550174528483098623
exp2=181
exp1=127
sign1=-1
sign0=-1

代码

import it.unisa.dia.gas.jpbc.Element;
import it.unisa.dia.gas.jpbc.Pairing;
import it.unisa.dia.gas.plaf.jpbc.pairing.PairingFactory;import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.*;public class CLAS {//生成公私钥对,并保存到文件中public static void Setup(String pairingParametersFileName, String pubParamFileName, String KGC_SK_FileName) {Pairing bp = PairingFactory.getPairing(pairingParametersFileName);//G1的生成元PElement P = bp.getG1().newRandomElement().getImmutable();//计算主私钥和公钥Element s = bp.getZr().newRandomElement().getImmutable();Element P_Pub = P.mulZn(s);Properties pubParamProp = new Properties();//后面对写的元素统一采用如下方法:首先将元素转为字节数组,然后进行Base64编码为可读字符串pubParamProp.setProperty("P", Base64.getEncoder().encodeToString(P.toBytes()));pubParamProp.setProperty("P_Pub", Base64.getEncoder().encodeToString(P_Pub.toBytes()));storePropToFile(pubParamProp, pubParamFileName);Properties param_s = new Properties();//私钥不存入公开参数中,由KGC自己保存param_s.setProperty("s", Base64.getEncoder().encodeToString(s.toBytes()));storePropToFile(param_s, KGC_SK_FileName);}//根据用户id生成私钥public static void PartialPrivateKeyGen(String pairingParametersFileName, String id, String KGC_SK_FileName) throws NoSuchAlgorithmException {Pairing bp = PairingFactory.getPairing(pairingParametersFileName);//使用HASH 将 id 转为QIDbyte[] idHash = HASH(id);Element QID = bp.getG1().newElementFromHash(idHash, 0, idHash.length).getImmutable();//从文件中读取 主私钥Properties mskProp = loadPropFromFile(KGC_SK_FileName);String sString = mskProp.getProperty("s");Element s = bp.getZr().newElementFromBytes(Base64.getDecoder().decode(sString)).getImmutable();  //Base64编码后对应的恢复元素的方法//计算用户私钥, 这里应该将私钥安全的传输给用户//方便模拟,统一存入一个文件中Element psk_ID = QID.powZn(s).getImmutable();Properties pskProp = new Properties();pskProp.setProperty("psk", Base64.getEncoder().encodeToString(psk_ID.toBytes()));storePropToFile(pskProp, id + ".properties");}//生成用户私钥public static void UserKeyGen(String pairingParametersFileName, String pubParamFileName, String id) {Pairing bp = PairingFactory.getPairing(pairingParametersFileName);//从文件中读取公钥Properties pkProp = loadPropFromFile(pubParamFileName);String PString = pkProp.getProperty("P");Element P = bp.getG1().newElementFromBytes(Base64.getDecoder().decode(PString)).getImmutable();//生成随机数x,作为用户的私钥Element x = bp.getZr().newRandomElement().getImmutable();//计算用户公钥Element upk = P.mulZn(x);Properties userProp = new Properties();userProp.setProperty("usk", Base64.getEncoder().encodeToString(x.toBytes()));userProp.setProperty("upk", Base64.getEncoder().encodeToString(upk.toBytes()));storePropToFile(userProp, id + ".properties");}//签名public static Element[] Sign(String pairingParametersFileName, String pubParamFileName, String id, byte[] message) throws NoSuchAlgorithmException {Pairing bp = PairingFactory.getPairing(pairingParametersFileName);//获取公开参数Properties pubProp = loadPropFromFile(pubParamFileName);Element P = bp.getG1().newElementFromBytes(Base64.getDecoder().decode(pubProp.getProperty("P"))).getImmutable();Element P_Pub = bp.getG1().newElementFromBytes(Base64.getDecoder().decode(pubProp.getProperty("P_Pub"))).getImmutable();//获取用户自己的信息Properties userProp = loadPropFromFile(id + ".properties");Element upk = bp.getG1().newElementFromBytes(Base64.getDecoder().decode(userProp.getProperty("upk"))).getImmutable();Element x = bp.getZr().newElementFromBytes(Base64.getDecoder().decode(userProp.getProperty("usk"))).getImmutable();Element psk = bp.getG1().newElementFromBytes(Base64.getDecoder().decode(userProp.getProperty("psk"))).getImmutable();//选择随机数Element r = bp.getZr().newRandomElement();Element U = P.mulZn(r).getImmutable();//获取状态信息,将公开参数作为状态信息String p = pubProp.getProperty("P");String pPub = pubProp.getProperty("P_Pub");byte[] hash = HASH(p + pPub);Element Q = hashToG(bp, hash);// 计算m, id, upk,U组合的hash值byte[] res = hashCombination(message, id.getBytes(), upk.toBytes(), U.toBytes());Element h = hashToZ(bp, res);Element V = P_Pub.mulZn(x).mulZn(h).add(Q.mulZn(r)).add(psk).getImmutable();Element[] sigma = new Element[2];sigma[0] = U;sigma[1] = V;return sigma;}//验证public static boolean Verify(String pairingParametersFileName, String pubParamFileName, String id, byte[] message, Element[] sigma) throws NoSuchAlgorithmException {Pairing bp = PairingFactory.getPairing(pairingParametersFileName);//使用sha1 将 id 转为QIDbyte[] idHash = HASH(id);Element QID = bp.getG1().newElementFromHash(idHash, 0, idHash.length).getImmutable();//获取公开参数Properties pubProp = loadPropFromFile(pubParamFileName);Element P = bp.getG1().newElementFromBytes(Base64.getDecoder().decode(pubProp.getProperty("P"))).getImmutable();Element P_Pub = bp.getG1().newElementFromBytes(Base64.getDecoder().decode(pubProp.getProperty("P_Pub"))).getImmutable();//获取状态信息,将公开参数作为状态信息String p = pubProp.getProperty("P");String pPub = pubProp.getProperty("P_Pub");byte[] hash = HASH(p + pPub);Element Q = hashToG(bp, hash);//获取用户的公钥,Properties userProp = loadPropFromFile(id + ".properties");Element upk = bp.getG1().newElementFromBytes(Base64.getDecoder().decode(userProp.getProperty("upk"))).getImmutable();// 计算m, id, upk,U组合的hash值byte[] res = hashCombination(message, id.getBytes(), upk.toBytes(), sigma[0].toBytes());Element h = hashToZ(bp, res);Element left = bp.pairing(sigma[1], P);Element right = bp.pairing(QID.add(upk.mulZn(h)), P_Pub).mul(bp.pairing(sigma[0], Q));return left.isEqual(right);}//聚合签名, U_1,U_2,...,U_n,Vpublic static Element[] Aggregate(List<Element[]> sigmaList) {Element[] res = new Element[sigmaList.size() + 1];Element[] init = sigmaList.get(0);res[0] = init[0];Element V = init[1];for (int i = 1; i < sigmaList.size(); i++) {res[i] = sigmaList.get(i)[0];V = V.add(sigmaList.get(1)[1]);}res[sigmaList.size()] = V;return res;}// 聚合签名验证public static boolean AggregateVerify(String pairingParametersFileName, String pubParamFileName, String[] idx, byte[][] message, Element[] sigma) throws NoSuchAlgorithmException {Pairing bp = PairingFactory.getPairing(pairingParametersFileName);Element[] QIDX = new Element[idx.length];for (int i = 0; i < idx.length; i++) {byte[] idHash = HASH(idx[i]);Element QID = bp.getG1().newElementFromHash(idHash, 0, idHash.length).getImmutable();QIDX[i] = QID;}//获取公开参数信息Properties pubProp = loadPropFromFile(pubParamFileName);Element P = bp.getG1().newElementFromBytes(Base64.getDecoder().decode(pubProp.getProperty("P"))).getImmutable();Element P_Pub = bp.getG1().newElementFromBytes(Base64.getDecoder().decode(pubProp.getProperty("P_Pub"))).getImmutable();String p = pubProp.getProperty("P");String pPub = pubProp.getProperty("P_Pub");byte[] hash = HASH(p + pPub);Element Q = hashToG(bp, hash);Element[] PKX = new Element[idx.length];for (int i = 0; i < idx.length; i++) {Properties userProp = loadPropFromFile(idx[i] + ".properties");Element upk = bp.getG1().newElementFromBytes(Base64.getDecoder().decode(userProp.getProperty("upk"))).getImmutable();PKX[i] = upk;}Element[] hx = new Element[idx.length];for (int i = 0; i < idx.length; i++) {byte[] res = hashCombination(message[i], idx[i].getBytes(), PKX[i].toBytes(), sigma[i].toBytes());Element h = hashToZ(bp, res);hx[i] = h;}Element left = bp.pairing(sigma[idx.length], P);Element U = sigma[0];for (int i = 1; i < idx.length; i++) {U = U.add(sigma[i]);}Element part = QIDX[0].add(PKX[0].mulZn(hx[0]));for (int i = 1; i < idx.length; i++) {part = part.add(QIDX[i].add(PKX[i].mulZn(hx[i])));}Element right = bp.pairing(part, P_Pub).mul(bp.pairing(U, Q));return left.isEqual(right);}//一种可行的组合方法public static byte[] hashCombination(byte[] message, byte[] id, byte[] upk, byte[] U) throws NoSuchAlgorithmException {int m_len = message.length, id_len = id.length, upk_len = upk.length, u_len = U.length;int total_len = m_len + id_len + upk_len + u_len;byte[] res = new byte[total_len];for (int i = 0; i < m_len; i++) {res[i] = message[i];}for (int i = 0; i < id_len; i++) {res[i + m_len] = id[i];}for (int i = 0; i < upk_len; i++) {res[i + m_len + id_len] = upk[i];}for (int i = 0; i < u_len; i++) {res[i + m_len + id_len + upk_len] = U[i];}MessageDigest instance = MessageDigest.getInstance("SHA-256");instance.update(res);return instance.digest();}public static void storePropToFile(Properties prop, String fileName) {try (FileOutputStream out = new FileOutputStream(fileName, true)) {prop.store(out, null);} catch (IOException e) {e.printStackTrace();System.out.println(fileName + " save failed!");System.exit(-1);}}public static Properties loadPropFromFile(String fileName) {Properties prop = new Properties();try (FileInputStream in = new FileInputStream(fileName)) {prop.load(in);} catch (IOException e) {e.printStackTrace();System.out.println(fileName + " load failed!");System.exit(-1);}return prop;}public static byte[] HASH(String content) throws NoSuchAlgorithmException {MessageDigest instance = MessageDigest.getInstance("SHA-1");instance.update(content.getBytes());return instance.digest();}public static Element hashToG(Pairing pb, byte[] code) {return pb.getG1().newElementFromHash(code, 0, code.length).getImmutable();}public static Element hashToZ(Pairing pb, byte[] code) {return pb.getZr().newElementFromHash(code, 0, code.length).getImmutable();}public static void main(String[] args) throws Exception {String pairingParametersFileName = "a_181_603.properties";String idAlice = "alice@example.com";String idBob = "bob@example.com";String pubParamFileName = "data/pub.properties";String KGCFileName = "data/kgc.properties";Setup(pairingParametersFileName, pubParamFileName, KGCFileName);PartialPrivateKeyGen(pairingParametersFileName, idAlice, KGCFileName);PartialPrivateKeyGen(pairingParametersFileName, idBob, KGCFileName);UserKeyGen(pairingParametersFileName, pubParamFileName, idAlice);UserKeyGen(pairingParametersFileName, pubParamFileName, idBob);String message_a = "Alice,This is a message from Alice!";String message_b = "Bob,This is a message from Bob!";Element[] sigma1 = Sign(pairingParametersFileName, pubParamFileName, idAlice, message_a.getBytes());Element[] sigma2 = Sign(pairingParametersFileName, pubParamFileName, idBob, message_b.getBytes());boolean result = Verify(pairingParametersFileName, pubParamFileName, idAlice, message_a.getBytes(), sigma1);System.out.println("Alice 验证签名通过? " + result);result = Verify(pairingParametersFileName, pubParamFileName, idBob, message_b.getBytes(), sigma2);System.out.println("Bob 验证签名通过? " + result);List<Element[]> sigmaList = new ArrayList<>();sigmaList.add(sigma1);sigmaList.add(sigma2);Element[] SIGMA = Aggregate(sigmaList);String[] idx = {idAlice, idBob};byte[][] message = {message_a.getBytes(), message_b.getBytes()};
//        message[0][1] = 1;//假如消息被篡改result = AggregateVerify(pairingParametersFileName, pubParamFileName, idx, message, SIGMA);System.out.println("聚合签名验证通过? " + result);}}

参考文献

  1. A new certificateless aggregate signature scheme

  2. Cryptanalysis and improvement of a certificateless aggregate signature scheme

  3. A certificateless aggregate signature scheme for healthcare wireless sensor network

  4. Efficient certificateless aggregate signcryption scheme without bilinear pairings

  5. Security issues in IoT applications using certificateless aggregate signcryption schemes: An overview

相关文章:

基于JPBC的无证书聚合签名方案实现

基于JPBC的无证书聚合签名方案实现 摘要 一开始签名方案是基于PKI的&#xff0c;无证书签名起源于 基于身份密码体制&#xff0c; 2009 年第一篇无证书签名方案1被提出&#xff0c;随后出现了一些列方案2,3;包括无配对的无证书聚合签名方案4,更多内容参考文献5. 暂时没有看见…...

FreeRTOS内存管理分析

目录 heap_1.c内存管理算法 heap_2.c内存管理算法 heap_3.c内存管理算法 heap_4.c内存管理算法 heap_5.c内存管理算法 内存管理对应用程序和操作系统来说非常重要&#xff0c;而内存对于嵌入式系统来说是寸土寸金的资源&#xff0c;FreeRTOS操作系统将内核与内存管理分开实…...

hashMap索引原理

平日里面经常使用map这种数据结构&#xff0c;令人称奇的是他的访问速度为什么那么快&#xff1f;为什么可以通过key以接近O(1)的速度查找&#xff1f; 一、基础数据结构特点分析 1.1数组 查找的时间复杂度为O(1) 插入时间复杂度为O(n) 1.2链表 查找的时间复杂度为O(n) 插…...

qcow2、raw、vmdk等镜像格式工具

如果没有qemu&#xff0c;可以从这里下载安装&#xff1a;https://qemu.weilnetz.de/w64/...

GaussDB新特性Ustore存储引擎介绍

1、 Ustore和Astore存储引擎介绍 Ustore存储引擎&#xff0c;又名In-place Update存储引擎&#xff08;原地更新&#xff09;&#xff0c;是openGauss 内核新增的一种存储模式。此前的版本使用的行存储引擎是Append Update&#xff08;追加更新&#xff09;模式。相比于Append…...

人工智能基础_机器学习046_OVR模型多分类器的使用_逻辑回归OVR建模与概率预测---人工智能工作笔记0086

首先我们来看一下什么是OVR分类.我们知道sigmoid函数可以用来进行二分类,那么多分类怎么实现呢?其中一个方法就是使用OVR进行把多分类转换成二分类进行计算. OVR,全称One-vs-Rest,是一种将多分类问题转化为多个二分类子问题的策略。在这种策略中,多分类问题被分解为若干个二…...

【LeetCode刷题-链表】--23.合并K个升序链表

23.合并K个升序链表 方法&#xff1a;顺序合并 在前面已经知道合并两个升序链表的前提下&#xff0c;用一个变量ans来维护以及合并的链表&#xff0c;第i次循环把第i个链表和ans合并&#xff0c;答案保存到ans中 /*** Definition for singly-linked list.* public class List…...

强化学习笔记

这里写自定义目录标题 参考资料基础知识16.3 有模型学习16.3.1 策略评估16.3.2 策略改进16.3.3 策略迭代16.3.3 值迭代 16.4 免模型学习16.4.1 蒙特卡罗强化学习16.4.2 时序差分学习Sarsa算法&#xff1a;同策略算法&#xff08;on-policy&#xff09;&#xff1a;行为策略是目…...

经典双指针算法试题(一)

&#x1f4d8;北尘_&#xff1a;个人主页 &#x1f30e;个人专栏:《Linux操作系统》《经典算法试题 》《C》 《数据结构与算法》 ☀️走在路上&#xff0c;不忘来时的初心 文章目录 一、移动零1、题目讲解2、讲解算法原理3、代码实现 二、复写零1、题目讲解2、讲解算法原理3、…...

MATLAB | 绘图复刻(十三) | 带NaN图例的地图绘制

有粉丝问我地图绘制如何添加NaN&#xff0c;大概像这样&#xff1a; 或者这样&#xff1a; 直接上干货&#xff1a; 原始绘图 假设我们有这样的一张图地图&#xff0c;注意运行本文代码需要去matlab官网下载Mapping Toolbox工具箱&#xff0c;但是其实原理都是相似的&…...

netty整合websocket(完美教程)

websocket的介绍&#xff1a; WebSocket是一种在网络通信中的协议&#xff0c;它是独立于HTTP协议的。该协议基于TCP/IP协议&#xff0c;可以提供双向通讯并保有状态。这意味着客户端和服务器可以进行实时响应&#xff0c;并且这种响应是双向的。WebSocket协议端口通常是80&am…...

选择PC示波器的10种理由!

PC示波器&#xff08;PCs&#xff09;在测试仪器领域中的关键项目上正迅速地取代传统的数字存储示波器&#xff08;DSOs&#xff09;&#xff0c;其中有十个理由&#xff1a; 小巧和便携示波器利用你的PC显示器实现大屏幕和精细彩色显示信号存储只受限于你的PC存储器大小捕捉波…...

【pytorch深度学习 应用篇02】训练中loss图的解读,训练中的问题与经验汇总

文章目录 loss图解析train loss ↘ \searrow ↘ ↗ \nearrow ↗ 先降后升 loss图解析 train loss ↘ \searrow ↘ 不断下降&#xff0c;test loss ↗ \nearrow ↗ 不断上升&#xff1a;原因很多&#xff0c;我是把workers1&#xff0c;batchSize8192train loss ↘ \searro…...

uniapp 微信小程序如何实现多个item列表的分享

以下代码是某个循环里面的item <button class"cu-btn" style"background-color: transparent;padding: 0;"open-type"share" :data-tree"item.treeId" :data-project"item.projectId"v-if"typeId1 && userI…...

.NET 8 正式 GA 遥遥领先

.NET 8 一正式 已正式 GA。 微软称 .NET 8 提供了数以千计的性能、稳定性和安全性改进&#xff0c;以及平台和工具增强功能&#xff0c;有助于提高开发者的工作效率和创新速度。 比如 .NET 8 为 Android 和 WASM 引入了全新的 AOT 模式、改进 System.Text.Json&#xff0c;以…...

2216. 美化数组的最少删除数 --力扣 --JAVA

题目 给你一个下标从 0 开始的整数数组 nums &#xff0c;如果满足下述条件&#xff0c;则认为数组 nums 是一个 美丽数组 &#xff1a; nums.length 为偶数对所有满足 i % 2 0 的下标 i &#xff0c;nums[i] ! nums[i 1] 均成立 注意&#xff0c;空数组同样认为是美丽数组。…...

DDD 领域驱动设计

文章目录 请解释下什么是 DDD 领域驱动设计DDD 的四层领域模型是怎样的&#xff1f;包含哪些基础概念&#xff1f;DDD 中的贫血模型和充血模型有什么区别在 DDD 中&#xff0c;如何处理模型的聚合和聚合根DDD 中的实体和值对象有什么区别&#xff1f;在 DDD 中&#xff0c;如何…...

转型做视频了,博客就是稿子,继续坚持写博客,同时发布视频,能写博客说明思路清晰了,能再讲明白,理解就更透彻了,紧跟上时代发展。

1&#xff0c;今天特别记录下&#xff0c;B站给开通了《合集》功能 最近使用视频制作了几个视频。播放量还不错&#xff0c;最好的已经到了 2.6K了。 然后粉丝也涨到了 200个。 添加链接描述 紧跟时代&#xff1a;从写博客到录视频&#xff0c;粉丝大涨&#xff0c;突破200个&…...

小众市场:探索跨境电商中的利基领域

随着全球数字化和互联网的普及&#xff0c;跨境电子商务已经成为了一个蓬勃发展的产业。从亚马逊到阿里巴巴&#xff0c;大型电商平台已经占据了很大一部分市场份额。 然而&#xff0c;在这个竞争激烈的领域&#xff0c;寻找小众市场和利基领域可能是一种成功的策略。本文将探…...

C++中的mutable关键字

mutable是C中的一个关键字&#xff0c;它用来修饰类的成员变量。 当我们将一个成员变量声明为mutable时&#xff0c;就意味着这个成员变量可以被类的任何方法修改&#xff0c;即使这个方法是const类型的。这是因为mutable关键字可以打破const类型的限制&#xff0c;使得const类…...

Vim 调用外部命令学习笔记

Vim 外部命令集成完全指南 文章目录 Vim 外部命令集成完全指南核心概念理解命令语法解析语法对比 常用外部命令详解文本排序与去重文本筛选与搜索高级 grep 搜索技巧文本替换与编辑字符处理高级文本处理编程语言处理其他实用命令 范围操作示例指定行范围处理复合命令示例 实用技…...

OpenLayers 可视化之热力图

注&#xff1a;当前使用的是 ol 5.3.0 版本&#xff0c;天地图使用的key请到天地图官网申请&#xff0c;并替换为自己的key 热力图&#xff08;Heatmap&#xff09;又叫热点图&#xff0c;是一种通过特殊高亮显示事物密度分布、变化趋势的数据可视化技术。采用颜色的深浅来显示…...

边缘计算医疗风险自查APP开发方案

核心目标:在便携设备(智能手表/家用检测仪)部署轻量化疾病预测模型,实现低延迟、隐私安全的实时健康风险评估。 一、技术架构设计 #mermaid-svg-iuNaeeLK2YoFKfao {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg…...

工程地质软件市场:发展现状、趋势与策略建议

一、引言 在工程建设领域&#xff0c;准确把握地质条件是确保项目顺利推进和安全运营的关键。工程地质软件作为处理、分析、模拟和展示工程地质数据的重要工具&#xff0c;正发挥着日益重要的作用。它凭借强大的数据处理能力、三维建模功能、空间分析工具和可视化展示手段&…...

第一篇:Agent2Agent (A2A) 协议——协作式人工智能的黎明

AI 领域的快速发展正在催生一个新时代&#xff0c;智能代理&#xff08;agents&#xff09;不再是孤立的个体&#xff0c;而是能够像一个数字团队一样协作。然而&#xff0c;当前 AI 生态系统的碎片化阻碍了这一愿景的实现&#xff0c;导致了“AI 巴别塔问题”——不同代理之间…...

嵌入式学习笔记DAY33(网络编程——TCP)

一、网络架构 C/S &#xff08;client/server 客户端/服务器&#xff09;&#xff1a;由客户端和服务器端两个部分组成。客户端通常是用户使用的应用程序&#xff0c;负责提供用户界面和交互逻辑 &#xff0c;接收用户输入&#xff0c;向服务器发送请求&#xff0c;并展示服务…...

通过MicroSip配置自己的freeswitch服务器进行调试记录

之前用docker安装的freeswitch的&#xff0c;启动是正常的&#xff0c; 但用下面的Microsip连接不上 主要原因有可能一下几个 1、通过下面命令可以看 [rootlocalhost default]# docker exec -it freeswitch fs_cli -x "sofia status profile internal"Name …...

uniapp 集成腾讯云 IM 富媒体消息(地理位置/文件)

UniApp 集成腾讯云 IM 富媒体消息全攻略&#xff08;地理位置/文件&#xff09; 一、功能实现原理 腾讯云 IM 通过 消息扩展机制 支持富媒体类型&#xff0c;核心实现方式&#xff1a; 标准消息类型&#xff1a;直接使用 SDK 内置类型&#xff08;文件、图片等&#xff09;自…...

es6+和css3新增的特性有哪些

一&#xff1a;ECMAScript 新特性&#xff08;ES6&#xff09; ES6 (2015) - 革命性更新 1&#xff0c;记住的方法&#xff0c;从一个方法里面用到了哪些技术 1&#xff0c;let /const块级作用域声明2&#xff0c;**默认参数**&#xff1a;函数参数可以设置默认值。3&#x…...

WebRTC调研

WebRTC是什么&#xff0c;为什么&#xff0c;如何使用 WebRTC有什么优势 WebRTC Architecture Amazon KVS WebRTC 其它厂商WebRTC 海康门禁WebRTC 海康门禁其他界面整理 威视通WebRTC 局域网 Google浏览器 Microsoft Edge 公网 RTSP RTMP NVR ONVIF SIP SRT WebRTC协…...